public override object PerformSelectOneObject() { Ecm.WebReferences.MasterService.Rex_Dm_Dantoc rex_Dm_Dantoc = new Ecm.WebReferences.MasterService.Rex_Dm_Dantoc(); try { int focusedRow = gridView1.GetDataSourceRowIndex(gridView1.FocusedRowHandle); DataRow dr = ds_Dantoc.Tables[0].Rows[focusedRow]; if (dr != null) { rex_Dm_Dantoc.Id_Dantoc = dr["Id_Dantoc"]; rex_Dm_Dantoc.Ma_Dantoc = dr["Ma_Dantoc"]; rex_Dm_Dantoc.Ten_Dantoc = dr["Ten_Dantoc"]; } Selected_Rex_Dm_Dantoc = rex_Dm_Dantoc; this.Dispose(); this.Close(); return(rex_Dm_Dantoc); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif return(null); } }
public object UpdateObject() { Ecm.WebReferences.MasterService.Rex_Dm_Dantoc objRex_Dm_Dantoc = new Ecm.WebReferences.MasterService.Rex_Dm_Dantoc(); objRex_Dm_Dantoc.Id_Dantoc = gridView1.GetFocusedRowCellValue("Id_Dantoc"); objRex_Dm_Dantoc.Ma_Dantoc = txtMa_Dantoc.EditValue; objRex_Dm_Dantoc.Ten_Dantoc = txtTen_Dantoc.EditValue; return(objMasterService.Update_Rex_Dm_Dantoc(objRex_Dm_Dantoc)); }
public object InsertObject() { Ecm.WebReferences.MasterService.Rex_Dm_Dantoc objRex_Dm_Dantoc = new Ecm.WebReferences.MasterService.Rex_Dm_Dantoc(); objRex_Dm_Dantoc.Id_Dantoc = -1; objRex_Dm_Dantoc.Ma_Dantoc = txtMa_Dantoc.EditValue; objRex_Dm_Dantoc.Ten_Dantoc = txtTen_Dantoc.EditValue; return(objMasterService.Insert_Rex_Dm_Dantoc(objRex_Dm_Dantoc)); }
public object DeleteObject() { Ecm.WebReferences.MasterService.Rex_Dm_Dantoc objRex_Dm_Dantoc = new Ecm.WebReferences.MasterService.Rex_Dm_Dantoc(); objRex_Dm_Dantoc.Id_Dantoc = gridView1.GetFocusedRowCellValue("Id_Dantoc"); return(objMasterService.Delete_Rex_Dm_Dantoc(objRex_Dm_Dantoc)); }