Exemplo n.º 1
0
        private void delete_v_gd_qua_trinh_lam_viec()
        {
            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_QUA_TRINH_LAM_VIEC v_us = new US_V_GD_QUA_TRINH_LAM_VIEC();

            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();
            }
        }
Exemplo n.º 2
0
        private void delete_v_gd_qua_trinh_lam_viec()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_grv_qua_trinh_lam_viec))
            {
                return;
            }
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_grv_qua_trinh_lam_viec, m_grv_qua_trinh_lam_viec.Row))
            {
                return;
            }
            if (BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted)
            {
                return;
            }
            US_V_GD_QUA_TRINH_LAM_VIEC v_us = new US_V_GD_QUA_TRINH_LAM_VIEC();

            grid2us_object(v_us, m_grv_qua_trinh_lam_viec.Row);
            try {
                //v_us.BeginTransaction();
                //v_us.Delete();
                //v_us.CommitTransaction();
                //m_grv_qua_trinh_lam_viec.Rows.Remove(m_grv_qua_trinh_lam_viec.Row);
                v_us.BeginTransaction();
                v_us.delete_by_id_gd_chi_tiet_chuc_vu(v_us.dcID);
                v_us.CommitTransaction();
                m_grv_qua_trinh_lam_viec.Rows.Remove(m_grv_qua_trinh_lam_viec.Row);
                BaseMessages.MsgBox_Infor("Đã xóa thành công!");
                load_data_2_grid_search();
            }
            catch (Exception v_e) {
                v_us.Rollback();
                CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
                                                                              new CDBClientDBExceptionInterpret());
                v_objErrHandler.showErrorMessage();
            }
        }