Ejemplo n.º 1
0
        private void delete_dm_headcount()
        {
            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_HEADCOUNT v_us = new US_DM_HEADCOUNT();

            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();
            }
        }
Ejemplo n.º 2
0
        private void us_object2grid(US_DM_HEADCOUNT 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);
        }
Ejemplo n.º 3
0
        private void grid2us_object(US_DM_HEADCOUNT 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);
        }
Ejemplo n.º 4
0
 private void us_object_2_form(US_DM_HEADCOUNT ip_us_dm_headcount)
 {
     m_txt_ma_headcount.Text = ip_us_dm_headcount.strMA_HEADCOUNT;
     m_txt_actions.Text      = ip_us_dm_headcount.strACTIONS;
     m_txt_mo_ta.Text        = ip_us_dm_headcount.strMO_TA;
     m_txt_trang_thai.Text   = ip_us_dm_headcount.strTRANG_THAI;
     switch (m_e_form_mode)
     {
     case DataEntryFormMode.ViewDataState:
         m_txt_trang_thai.ReadOnly    = true;
         m_txt_mo_ta.ReadOnly         = true;
         m_txt_ma_headcount.ReadOnly  = true;
         m_txt_actions.ReadOnly       = true;
         m_txt_actions.BackColor      = SystemColors.Info;
         m_txt_ma_headcount.BackColor = SystemColors.Info;
         m_txt_mo_ta.BackColor        = SystemColors.Info;
         m_txt_trang_thai.BackColor   = SystemColors.Info;
         m_cmd_save.Visible           = false;
         m_cmd_refresh.Visible        = false;
         break;
     }
 }
Ejemplo n.º 5
0
 public void display_for_view(US_DM_HEADCOUNT ip_v_us_dm_headcount)
 {
     m_e_form_mode = DataEntryFormMode.ViewDataState;
     us_object_2_form(ip_v_us_dm_headcount);
     this.ShowDialog();
 }