private void delete_v_rpt_f460_tinh_hinh_bo_lop()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_V_RPT_F460_TINH_HINH_BO_LOP v_us = new US_V_RPT_F460_TINH_HINH_BO_LOP();
     grid2us_object(v_us, m_fg.Row);
     try
     {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
     }
     catch (Exception v_e)
     {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void delete_v_rpt_450_bao_cao_so_luong_luong_hoc_vien_hien_nay()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_V_RPT_450_BAO_CAO_SO_LUONG_LUONG_HOC_VIEN_HIEN_NAY v_us = new US_V_RPT_450_BAO_CAO_SO_LUONG_LUONG_HOC_VIEN_HIEN_NAY();
     grid2us_object(v_us, m_fg.Row);
     try
     {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
     }
     catch (Exception v_e)
     {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 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 delete_v_tong_hop_cpn_theo_phong_ban()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_V_TONG_HOP_CPN_THEO_PHONG_BAN v_us = new US_V_TONG_HOP_CPN_THEO_PHONG_BAN();
     grid2us_object(v_us, m_fg.Row);
     try
     {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
     }
     catch (Exception v_e)
     {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void delete_v_dm_hoc_sinh()
 {
     if(!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if(!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if(BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_GD_HOC v_us = new US_GD_HOC();
     grid2us_object(v_us, m_fg.Row);
     try {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
         //v_us.DeleteByID(v_us.dcID);
         //m_fg.Rows.Remove(m_fg.Row);
     }
     catch(Exception v_e) {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void delete_rpt_tong_hop_hien_trang_tsk()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg_tai_san_khac)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg_tai_san_khac, m_fg_tai_san_khac.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_RPT_TONG_HOP_HIEN_TRANG_TSK v_us = new US_RPT_TONG_HOP_HIEN_TRANG_TSK();
     grid2us_object(v_us, m_fg_tai_san_khac.Row);
     try
     {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg_tai_san_khac.Rows.Remove(m_fg_tai_san_khac.Row);
     }
     catch (Exception v_e)
     {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
        private void delete_nguoi_dai_dien()
        {
            if (!HelpUtils.is_validated_edit_grid_row(m_fg_nguoi_dai_dien.Row, m_fg)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)  return;
            US_V_DM_NGUOI_DAI_DIEN v_us = new US_V_DM_NGUOI_DAI_DIEN();
            grid2us_object_nguoi_dai_dien(v_us, m_fg_nguoi_dai_dien.Row);
            try {
                v_us.BeginTransaction();
                v_us.Delete();
                v_us.CommitTransaction();
                m_fg.Rows.Remove(m_fg.Row);
            }
            catch (Exception v_e) {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
            }
        private void delete_phieu_cu()
        {
            DS_V_RPT_CHI_TIET_PHIEU_THU v_ds_v_rpt_chi_tiet_phieu_thu = new DS_V_RPT_CHI_TIET_PHIEU_THU();
            US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu = new US_V_RPT_CHI_TIET_PHIEU_THU();

            v_us_v_rpt_chi_tiet_phieu_thu.FillDataset(v_ds_v_rpt_chi_tiet_phieu_thu, CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue), m_dat_tai_ngay.Value.Date);
            for (int i = 0; i < v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows.Count; i++)
            {
                US_V_RPT_CHI_TIET_PHIEU_THU v_us_v_rpt_chi_tiet_phieu_thu_detail = new US_V_RPT_CHI_TIET_PHIEU_THU(v_ds_v_rpt_chi_tiet_phieu_thu.Tables[0].Rows[i]);
                try
                {
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.BeginTransaction();
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.DeleteByID(v_us_v_rpt_chi_tiet_phieu_thu_detail.dcID);
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.CommitTransaction();
                }
                catch (Exception v_e)
                {
                    v_us_v_rpt_chi_tiet_phieu_thu_detail.Rollback();
                    CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                        new CDBClientDBExceptionInterpret());
                    v_objErrHandler.showErrorMessage();
                    //BaseMessages.MsgBox_Infor("Không xóa được học sinh này do học sinh này đang học một lớp môn nào đó!");
                }
            }
        }
        private void delete_v_hoc_sinh()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;

            //if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
            bool v_lua_chon_xoa = BaseMessages.MsgBox_Confirm("Nếu xóa học sinh này, tất cả dữ liệu của học sinh này về lớp học, phiếu thu, điểm danh,... sẽ bị xóa. Bạn chắc chắn chứ?");
            if (v_lua_chon_xoa == false)
            {
                return;
            }
            US_V_HOC_SINH v_us = new US_V_HOC_SINH();
            grid2us_object(v_us, m_fg.Row);
            try
            {
                v_us.BeginTransaction();
                v_us.Delete();
                v_us.CommitTransaction();
                m_fg.Rows.Remove(m_fg.Row);
                BaseMessages.MsgBox_Infor("Đã xóa thành công");
            }
            catch (Exception v_e)
            {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
                //BaseMessages.MsgBox_Infor("Không xóa được học sinh này do học sinh này đang học một lớp môn nào đó!");
            }
        }
 private void m_obj_edit_controller_BeforeUpdate(object sender, CC1InplaceEdittingEventArgs e)
 {
     try
     {
         int v_i_grid_row = m_fg.Row;
         m_us_cur.ClearAllFields();
         grid_2_us_object(m_us_cur, v_i_grid_row);
         m_us_cur.BeginTransaction();
         if (m_us_cur.isUpdatable())
         {
             e.continue_editting = true;
         }
     }
     catch (Exception v_e)
     {
         m_us_cur.Rollback();
         e.continue_editting = false;
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void m_obj_edit_controller_BeforeInsert(object sender, CC1InplaceEdittingEventArgs e)
 {
     try
     {
         m_us_cur.BeginTransaction();
         e.continue_editting = true;
     }
     catch (Exception v_e)
     {
         e.continue_editting = false;
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void catch_fg_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
 {
     try
     {
         if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg))
         {
             return;
         }
         if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row))
         {
             return;
         }
         StartUpdate();
     }
     catch (Exception v_e)
     {
         e.Cancel = true;
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private static void Initialize_NgayTrongTuan()
 {
     try
     {
         US_HT_NGAY_TRONG_TUAN v_us_ht_ngay_trong_tuan = new US_HT_NGAY_TRONG_TUAN();
         DS_HT_NGAY_TRONG_TUAN v_ds_ngaytrongtuan = new DS_HT_NGAY_TRONG_TUAN();
         v_us_ht_ngay_trong_tuan.FillDataset(v_ds_ngaytrongtuan);
         m_View_NgayTrongTuan = new DataView(v_ds_ngaytrongtuan.HT_NGAY_TRONG_TUAN);
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_handler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_handler.showErrorMessage();
     }
 }
            if( disposing )
            {
                if(components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        private void delete_v_gd_thong_ke()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_grv_thong_ke_hoc_vien)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_grv_thong_ke_hoc_vien, m_grv_thong_ke_hoc_vien.Row)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)  return;
            US_GD_THONG_KE v_us = new US_GD_THONG_KE();
            dm_grid2us_object(v_us, m_grv_thong_ke_hoc_vien.Row);
            try {
                v_us.BeginTransaction();
                v_us.Delete();
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if(components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        private void delete_rpt_tang_giam_tai_san()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)  return;
            US_RPT_TANG_GIAM_TAI_SAN v_us = new US_RPT_TANG_GIAM_TAI_SAN();
            grid2us_object(v_us, m_fg.Row);
            try {
 private void m_obj_edit_controller_OnCancelDelete(object sender, EventArgs e)
 {
     try
     {
         m_us_cur.Rollback();
         if (OnCancelDeleteEvent != null)
             OnCancelDeleteEvent(this, new EventArgs());
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
        private void delete_ht_user_group()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
            var dlg = DevExpress.XtraEditors.XtraMessageBox.Show("Bạn có chắc chắn muốn xóa dữ liệu?", "THÔNG BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dlg != System.Windows.Forms.DialogResult.Yes) return;

            US_HT_USER_GROUP v_us = new US_HT_USER_GROUP();
            grid2us_object(v_us, m_fg.Row);
            try
            {
                v_us.BeginTransaction();
                v_us.Delete();
                v_us.CommitTransaction();
                m_fg.Rows.Remove(m_fg.Row);
            }
            catch (Exception v_e)
            {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
            }
        }
 private void m_obj_edit_controller_OnCancelInsert(object sender, EventArgs e)
 {
     try
     {
         m_fg.Rows.Remove(m_fg.Row);
         if (OnCancelDeleteEvent != null)
             OnCancelDeleteEvent(this, new System.EventArgs());
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
        }

        private void delete_v_dm_co_so_dinh_muc()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_grv_co_so_dinh_muc)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_grv_co_so_dinh_muc, m_grv_co_so_dinh_muc.Row)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)  return;
            US_DM_CO_SO_DINH_MUC v_us = new US_DM_CO_SO_DINH_MUC();
            dm_grid2us_object(v_us, m_grv_co_so_dinh_muc.Row);
            try {
                v_us.BeginTransaction();
                v_us.Delete();
                v_us.CommitTransaction();
                m_grv_co_so_dinh_muc.Rows.Remove(m_grv_co_so_dinh_muc.Row);
            }
            catch (Exception v_e) {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
 private void m_obj_edit_controller_OnCancelUpdate(object sender, EventArgs e)
 {
     try
     {
         m_us_cur.Rollback();
         //Dua du lieu cu len grid
         restored_old_grid_data(m_fg.Row);
         if (OnCancelUpdateEvent != null)
             OnCancelUpdateEvent(this, new EventArgs());
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
Beispiel #21
0
                }
            }
            base.Dispose( disposing );
        }

        private void delete_dm_nha_cung_cap()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_grv_nha_cc)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_grv_nha_cc, m_grv_nha_cc.Row)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)  return;
            US_DM_NHA_CUNG_CAP v_us = new US_DM_NHA_CUNG_CAP();
            grid2us_object(v_us, m_grv_nha_cc.Row);
            try {
                v_us.BeginTransaction();
                v_us.Delete();
                v_us.CommitTransaction();
                m_grv_nha_cc.Rows.Remove(m_grv_nha_cc.Row);
            }
            catch (Exception v_e) {
                v_us.Rollback();
 private void m_obj_edit_controller_OnUpdate(object sender, CC1InplaceEdittingOnEventArgs e)
 {
     try
     {
         m_us_cur.Update();
         CC1InplaceEdittingOnEventArgs v_e = new CC1InplaceEdittingOnEventArgs(e_CC1_inplace_editting_next_action.success_and_change_to_none_status);
         if (OnUpdateEvent != null)
             OnUpdateEvent(this, v_e);
         if (v_e.next_action == e_CC1_inplace_editting_next_action.success_and_change_to_none_status)
         {
             m_us_cur.CommitTransaction();
             us_object_2_grid(m_us_cur, m_fg.Row);
             e.next_action = e_CC1_inplace_editting_next_action.success_and_change_to_none_status;
         }
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
         e.next_action = e_CC1_inplace_editting_next_action.continue_editting;
     }
 }
        private void delete_v_rpt_bao_cao_danh_sach_phieu_thu()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
            US_V_RPT_BAO_CAO_DANH_SACH_PHIEU_THU v_us = new US_V_RPT_BAO_CAO_DANH_SACH_PHIEU_THU();
            grid2us_object(v_us, m_fg.Row);

            if (!check_ban_giao_is_da_thu_or_admin(v_us))
            {
                BaseMessages.MsgBox_Infor("Phiếu này đã bàn giao, không được quyền xóa!");
                return;
            }

            try
            {
                v_us.BeginTransaction();
                v_us.DeletePhieuThuVaChiTiet(v_us.dcID);
                v_us.CommitTransaction();
                m_fg.Rows.Remove(m_fg.Row);
                BaseMessages.MsgBox_Infor("Đã xóa thành công");
            }
            catch (Exception v_e)
            {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
            }
            load_data_2_grid();
        }
 private void insert_chi_tiet_phieu_thu(decimal ip_id_phieu_thu)
 {
     try
     {
         m_us_gd_ct_phieu_thu.BeginTransaction();
         for (int v_i_cur_row = m_fg.Rows.Fixed; v_i_cur_row < m_fg.Rows.Count; v_i_cur_row++)
         {
             US_V_F340_LOP_MON_CUA_HS v_us_lm_hs = new US_V_F340_LOP_MON_CUA_HS();
             grid2us_object(v_us_lm_hs, v_i_cur_row);
             m_us_gd_ct_phieu_thu.dcID_LOP_MON = v_us_lm_hs.dcID_LOP_MON;
             m_us_gd_ct_phieu_thu.dcSO_TIEN = CIPConvert.ToDecimal(m_fg.Rows[v_i_cur_row][(int)e_col_Number.SO_TIEN].ToString().Trim());////Cho nay de chet, can sua sau
             m_us_gd_ct_phieu_thu.Insert();
         }
         m_us_gd_ct_phieu_thu.CommitTransaction();
     }
     catch (Exception v_e)
     {
         if (m_us_gd_phieu_thu.is_having_transaction())
         {
             m_us_gd_phieu_thu.Rollback();
         }
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private void delete_v_gd_van_thu_all()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_V_GD_VAN_THU_ALL v_us = new US_V_GD_VAN_THU_ALL();
     US_GD_VAN_THU v_us_gd_van_thu = new US_GD_VAN_THU();
     grid2us_object(v_us, m_fg.Row);
     try
     {
         v_us_gd_van_thu = new US_GD_VAN_THU(v_us.dcID);
         v_us_gd_van_thu.BeginTransaction();
         v_us_gd_van_thu.Delete();
         v_us_gd_van_thu.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
     }
     catch (Exception v_e)
     {
         v_us_gd_van_thu.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
 private static void Initialize()
 {
     try
     {
         InitializeMaThamSo();
         m_ds_tham_so = new DS_HT_THAM_SO_HE_THONG();
         US_HT_THAM_SO_HE_THONG v_us = new US_HT_THAM_SO_HE_THONG();
         v_us.FillDataset(m_ds_tham_so);
     }
     catch (Exception v_e)
     {
         CDBExceptionHandler v_handler = new CDBExceptionHandler(v_e, new CDBClientDBExceptionInterpret());
         v_handler.showErrorMessage();
         Debug.Assert(true, "Không khởi tạo được tham số HT - csung");
     }
 }
 private void delete_ht_phan_quyen_he_thong()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if (CHRM_BaseMessages.askUser_DataCouldBeDeleted(8) != CHRM_BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_HT_PHAN_QUYEN_HE_THONG v_us = new US_HT_PHAN_QUYEN_HE_THONG();
     grid2us_object(v_us, m_fg.Row);
     try {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
     }
     catch (Exception v_e) {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
        private void add_danh_sach_du_lieu()
        {
            US_DM_BILL v_us_dm_bill = new US_DM_BILL();
            DS_DM_BILL v_ds_dm_bill = new DS_DM_BILL();
            try
            {
                m_lbl_loading.Visible = true;
                v_us_dm_bill.BeginTransaction();
                for (int v_int_row = m_fg_load_file.Rows.Fixed; v_int_row <= m_fg_load_file.Rows.Count - 1; v_int_row++)
                {
                    //IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB", true);

                    //DateTime theDateTime = DateTime.ParseExact(abc, "mm-dd-yyyy", theCultureInfo);

                    v_us_dm_bill.strNOI_DUNG = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.NOI_DUNG]);
                    v_us_dm_bill.strNOI_NHAN = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.NOI_NHAN]);
                    v_us_dm_bill.strNGUOI_NHAN = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.NGUOI_NHAN]);
                    v_us_dm_bill.strTRONG_NUOC = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.TRONG_NUOC]);
                    v_us_dm_bill.strNUOC_NGOAI = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.NUOC_NGOAI]);
                    v_us_dm_bill.strSO_BILL = CIPConvert.ToStr(m_fg_load_file[v_int_row, (int)e_col_Number.SO_BILL]);
                    v_us_dm_bill.strNGUOI_GUI = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.NGUOI_GUI]);
                    v_us_dm_bill.datNGAY_GUI = Convert.ToDateTime(m_fg_load_file[v_int_row, (int)e_col_Number.NGAY_GUI].ToString());
                    v_us_dm_bill.strGHI_CHU = nullToString((string)m_fg_load_file[v_int_row, (int)e_col_Number.GHI_CHU]);
                    v_us_dm_bill.dcID_PHONG_BAN = CIPConvert.ToDecimal(m_cbo_phong_ban.SelectedValue.ToString());
                    v_us_dm_bill.SetSO_TIENNull();
                    v_us_dm_bill.dcID_TRANG_THAI = CONST_ID_TRANG_THAI_THU.ID_DA_NHAN_NOI_BO;
                    v_us_dm_bill.Insert();
                }
                v_us_dm_bill.CommitTransaction();
                m_lbl_load.Visible = false;
                ghi_log_he_thong();
                m_i_flag = 0;
                BaseMessages.MsgBox_Infor("Đã import dữ liệu nhận từ Bưu cục thành công");
            }
            catch (Exception v_e)
            {

                v_us_dm_bill.Rollback();
                CDBExceptionHandler v_exceptionHander = new CDBExceptionHandler(v_e,
                    new CDBClientDBExceptionInterpret());
                v_exceptionHander.showErrorMessage();
            }
        }
 private void delete_v_gd_don_dat_hang()
 {
     if (!CGridUtils.IsThere_Any_NonFixed_Row(m_fg_don_dat_hang)) return;
     if (!CGridUtils.isValid_NonFixed_RowIndex(m_fg_don_dat_hang, m_fg_don_dat_hang.Row)) return;
     if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_V_GD_DON_DAT_HANG v_us = new US_V_GD_DON_DAT_HANG();
     grid2us_object(v_us, m_fg_don_dat_hang.Row);
     try
     {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg_don_dat_hang.Rows.Remove(m_fg_don_dat_hang.Row);
     }
     catch (Exception v_e)
     {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.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();
            }
        }