private void grdTestType_RowCheckStateChanged(object sender, RowCheckStateChangeEventArgs e) { try { if (grdTestType.CurrentRow.IsChecked) { LUserTestType obj = new LUserTestType(); obj.UserName = Utility.sDbnull(grdUser.GetValue("PK_sUID")); obj.TestTypeId = Utility.Int32Dbnull(grdTestType.GetValue("TestType_ID")); obj.IsNew = true; obj.Save(); } else { new Delete().From(LUserTestType.Schema.Name).Where(LUserTestType.Columns.UserName). IsEqualTo(grdUser.GetValue("PK_sUID")).And(LUserTestType.Columns.TestTypeId). IsEqualTo(grdTestType.GetValue("TestType_ID")).Execute(); } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
private void grdTestType_RowCheckStateChanged(object sender, RowCheckStateChangeEventArgs e) { try { if (grdTestType.CurrentRow.IsChecked) { LUserTestType obj = new LUserTestType(); obj.UserName = Utility.sDbnull(grdUser.GetValue("PK_sUID")); obj.TestTypeId = Utility.Int32Dbnull(grdTestType.GetValue("TestType_ID")); obj.IsNew = true; obj.Save(); } else { new Delete().From(LUserTestType.Schema.Name).Where(LUserTestType.Columns.UserName). IsEqualTo(grdUser.GetValue("PK_sUID")).And(LUserTestType.Columns.TestTypeId). IsEqualTo(grdTestType.GetValue("TestType_ID")).Execute(); } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
public void Update(string UserName,int TestTypeId) { LUserTestType item = new LUserTestType(); item.MarkOld(); item.IsLoaded = true; item.UserName = UserName; item.TestTypeId = TestTypeId; item.Save(UserName); }
public void Insert(string UserName,int TestTypeId) { LUserTestType item = new LUserTestType(); item.UserName = UserName; item.TestTypeId = TestTypeId; item.Save(UserName); }