sharepoint event receiver checkbox yes/no

May be you want to run a list event during adding/ updating items. Following codes help to grab the yes/no value from checkbox.

base.ItemAdding(properties);

bool CheckBoxValue = (Convert.ToBoolean(properties.AfterProperties[“Order”]));

if (CheckBoxValue == true)

{properties.AfterProperties[“Comment”] = “My new comment”;}