public override object PerformSelectOneObject() { Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan rex_Dm_Tpbanthan = new Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan(); try { int focusedRow = gridView1.GetDataSourceRowIndex(gridView1.FocusedRowHandle); DataRow dr = ds_Tpbanthan.Tables[0].Rows[focusedRow]; if (dr != null) { rex_Dm_Tpbanthan.Id_Tpbanthan = dr["Id_Tpbanthan"]; rex_Dm_Tpbanthan.Ma_Tpbanthan = dr["Ma_Tpbanthan"]; rex_Dm_Tpbanthan.Ten_Tpbanthan = dr["Ten_Tpbanthan"]; } Selected_Rex_Dm_Tpbanthan = rex_Dm_Tpbanthan; this.Dispose(); this.Close(); return(rex_Dm_Tpbanthan); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif return(null); } }
public object DeleteObject() { Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan objRex_Dm_Tpbanthan = new Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan(); objRex_Dm_Tpbanthan.Id_Tpbanthan = gridView1.GetFocusedRowCellValue("Id_Tpbanthan"); return(objMasterService.Delete_Rex_Dm_Tpbanthan(objRex_Dm_Tpbanthan)); }
public object InsertObject() { Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan objRex_Dm_Tpbanthan = new Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan(); objRex_Dm_Tpbanthan.Id_Tpbanthan = -1; objRex_Dm_Tpbanthan.Ma_Tpbanthan = txtMa_Tpbanthan.EditValue; objRex_Dm_Tpbanthan.Ten_Tpbanthan = txtTen_Tpbanthan.EditValue; return(objMasterService.Insert_Rex_Dm_Tpbanthan(objRex_Dm_Tpbanthan)); }
public object UpdateObject() { Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan objRex_Dm_Tpbanthan = new Ecm.WebReferences.MasterService.Rex_Dm_Tpbanthan(); objRex_Dm_Tpbanthan.Id_Tpbanthan = gridView1.GetFocusedRowCellValue("Id_Tpbanthan"); objRex_Dm_Tpbanthan.Ma_Tpbanthan = txtMa_Tpbanthan.EditValue; objRex_Dm_Tpbanthan.Ten_Tpbanthan = txtTen_Tpbanthan.EditValue; return(objMasterService.Update_Rex_Dm_Tpbanthan(objRex_Dm_Tpbanthan)); }