示例#1
0
        private void delete_dm_ky()
        {
            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_DM_KY v_us = new US_DM_KY();

            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();
            }
        }
示例#2
0
 public void display_for_update(US_DM_KY m_us)
 {
     m_e_form_mode = DataEntryFormMode.UpdateDataState;
     m_us_dm_ky    = m_us;
     us_obj_2_form();
     this.ShowDialog();
 }
示例#3
0
        /// <summary>
        /// Create custom source for autocomplete from DM_KY
        /// </summary>
        /// <returns>Custom source</returns>
        public static AutoCompleteStringCollection create_csac_ky()
        {
            // Initialize
            US_DM_KY v_us_dm_ky = new US_DM_KY();
            DS_DM_KY v_ds_dm_ky = new DS_DM_KY();
            AutoCompleteStringCollection v_acsc = new AutoCompleteStringCollection();

            try
            {
                // Fill dataset
                v_us_dm_ky.FillDataset(v_ds_dm_ky);

                // Create custom source
                foreach (var v_rows in v_ds_dm_ky.DM_KY)
                {
                    v_acsc.Add((String)v_rows[DM_KY.MA_KY]);
                }
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
                return(null);
            }

            return(v_acsc);
        }
示例#4
0
        private void us_object2grid(US_DM_KY i_us
                                    , int i_grid_row)
        {
            DataRow v_dr = (DataRow)m_fg.Rows[i_grid_row].UserData;

            i_us.Me2DataRow(v_dr);
            m_obj_trans.DataRow2GridRow(v_dr, i_grid_row);
        }
示例#5
0
        private void grid2us_object(US_DM_KY i_us
                                    , int i_grid_row)
        {
            DataRow v_dr;

            v_dr = (DataRow)m_fg.Rows[i_grid_row].UserData;
            m_obj_trans.GridRow2DataRow(i_grid_row, v_dr);
            i_us.DataRow2Me(v_dr);
        }
示例#6
0
        /// <summary>
        /// Tạo datasource mã kỳ
        /// </summary>
        /// <returns>DataSet làm DataSource</returns>
        public static DataSet create_datasrc_ma_ky()
        {
            // Initialize
            US_DM_KY v_us = new US_DM_KY();
            DS_DM_KY v_ds = new DS_DM_KY();

            v_us.FillDataset(v_ds);

            return(v_ds);
        }
        /// <summary>
        /// Hàm setup các properties của members
        /// </summary>
        private void init_members()
        {
            // m_cmd_xuat_exel
            m_cmd_xuat_excel.Visible = false;

            // m_ds_tong_luong_n
            m_ds_tong_luong_n = new Dictionary <string, DS_RPT_TONG_LUONG>();

            // Init
            US_DM_KY v_us_ky = new US_DM_KY();
            DS_DM_KY v_ds_ky = new DS_DM_KY();


            // Fill DS
            v_us_ky.FillDataset(v_ds_ky);

            // m_fg
            m_fg.AllowEditing = false;

            Column v_col;

            // Add column mã tổng lương
            v_col          = m_fg.Cols.Add();
            v_col.Name     = "MA_TONG_LUONG";
            v_col.Caption  = "Mã tổng lương";
            v_col.DataType = typeof(string);

            // Add các column mã kỳ
            foreach (DataRow v_row in v_ds_ky.DM_KY.Rows)
            {
                string v_ma_ky = (String)v_row[DM_KY.MA_KY];
                v_col          = m_fg.Cols.Add();
                v_col.Name     = v_ma_ky;
                v_col.Caption  = v_ma_ky;
                v_col.DataType = typeof(Decimal);
                v_col.Format   = "#,###";
            }
        }
        private void load_data_2_cbo()
        {
            // Cbo ma ky
            US_DM_KY v_us_dm_ky = new US_DM_KY();
            DS_DM_KY v_ds_dm_ky = new DS_DM_KY();

            v_us_dm_ky.FillDataset(v_ds_dm_ky);

            DataTable v_dt = v_ds_dm_ky.Tables[0];
            DataRow   v_dr = v_dt.NewRow();

            v_dr[DM_KY.ID]    = -1;
            v_dr[DM_KY.MA_KY] = "Tất cả";

            v_dt.Rows.InsertAt(v_dr, 0);

            m_cbo_ky.DataSource    = v_dt;
            m_cbo_ky.ValueMember   = DM_KY.ID;
            m_cbo_ky.DisplayMember = DM_KY.MA_KY;


            // Cbo loai luong
            CUtils.load_datasource_loai_quyet_dinh(m_cbo_loai_luong, 1, true);
        }
示例#9
0
 public void display_for_insert()
 {
     m_e_form_mode = DataEntryFormMode.InsertDataState;
     m_us_dm_ky    = new US_DM_KY();
     this.ShowDialog();
 }