private void xoaGiaTriTuDien() { if (!this.isMaTuDienRow(m_fg.Row)) { return; } if (BaseMessages.askUser_DataCouldBeDeleted(8) == BaseMessages.IsDataCouldBeDeleted.ShouldNotBeDeleted) { return; } DataRow v_drTuDien = (DataRow) (m_fg.Rows[m_fg.Row].UserData); US_CM_DM_TU_DIEN v_usTuDien = new US_CM_DM_TU_DIEN(); v_usTuDien.DataRow2Me(v_drTuDien); try { v_usTuDien.BeginTransaction(); //If v_usTuDien.isUpdatable() Then v_usTuDien.Delete(); m_fg.Rows.Remove(m_fg.Row); //End If v_usTuDien.CommitTransaction(); } catch (System.Exception v_e) { v_usTuDien.Rollback(); CDBExceptionHandler v_ErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret()); v_ErrHandler.showErrorMessage(); } }
private void loadData_fromDB_toDatasets() { US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN(); try { v_us_tu_dien.BeginTransaction(); this.m_ds_tu_dien = new DS_CM_DM_TU_DIEN(); v_us_tu_dien.FillDataset(m_ds_tu_dien); US_CM_DM_LOAI_TD v_us_loai_tu_dien = new US_CM_DM_LOAI_TD(); v_us_loai_tu_dien.UseTransOfUSObject(v_us_tu_dien); this.m_ds_loai_tu_dien = new DS_CM_DM_LOAI_TD(); v_us_loai_tu_dien.FillDataset(m_ds_loai_tu_dien); v_us_tu_dien.CommitTransaction(); } catch (Exception v_e) { v_us_tu_dien.Rollback(); CDBExceptionHandler v_handler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret()); v_handler.showErrorMessage(); } }