private void myChkBoxCar_Checked(object sender, RoutedEventArgs e) { try { CheckBox chk = sender as CheckBox; if (chk.IsChecked.Value) { T_OA_REIMBURSEMENTDETAIL btlist = (T_OA_REIMBURSEMENTDETAIL)chk.DataContext; if (btlist != null) { var ents = from ent in TravelDetailList_Golbal where ent.REIMBURSEMENTDETAILID == btlist.REIMBURSEMENTDETAILID select ent; if (ents.Count() > 0) { int k = TravelDetailList_Golbal.IndexOf(ents.FirstOrDefault()); TravelDetailList_Golbal[k].COMPANYCAR = "1"; ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("您已勾选公司派车,无交通补贴!"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } } } } catch (Exception ex) { Logger.Current.Log(ex.Message, Category.Debug, Priority.Low); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }
private void myChkBoxCar_Unchecked(object sender, RoutedEventArgs e) { CheckBox chk = sender as CheckBox; if (!chk.IsChecked.Value) { T_OA_REIMBURSEMENTDETAIL btlist = (T_OA_REIMBURSEMENTDETAIL)chk.DataContext; if (btlist != null) { var ents = from ent in TravelDetailList_Golbal where ent.REIMBURSEMENTDETAILID == btlist.REIMBURSEMENTDETAILID select ent; if (ents.Count() > 0) { int k = TravelDetailList_Golbal.IndexOf(ents.FirstOrDefault()); TravelDetailList_Golbal[k].COMPANYCAR = "0"; } } } }