Inheritance: IP.Core.IPUserService.US_Object
 private void load_data_2_sle_chon_vi_tri()
 {
     m_sle_chon_vi_tri.EditValue = null;
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds, " where id_don_vi = " + Convert.ToDecimal(m_sle_chon_don_vi.EditValue));
     m_sle_chon_vi_tri.Properties.DataSource = v_ds.Tables[0];
 }
 internal void display_for_update(US_DM_CHUC_VU ip_us)
 {
     m_e_form_mode = DataEntryFormMode.UpdateDataState;
     m_us = ip_us;
     us_to_form(ip_us);
     m_sle_don_vi.Enabled = false;
     this.CenterToParent();
     this.ShowDialog();
 }
 private bool check_ma_cv_da_ton_tai()
 {
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds, "where ma_chuc_vu = N'" + m_txt_ma_chuc_vu.Text +"'");
     if (m_us.strMA_CHUC_VU != m_txt_ma_chuc_vu.Text && v_ds.Tables[0].Rows.Count !=0)
     {
         return true;
     }
     return false;
 }
 private bool check_cv_dang_su_dung(decimal ip_id_don_vi)
 {
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds, "where id_don_vi = " + ip_id_don_vi);
     if (v_ds.Tables[0].Rows.Count == 0)
     {
         return false;
     }
     else return true;
 }
 void m_cmd_update_Click(object sender, EventArgs e)
 {
     try
     {
         F110_dm_chuc_vu_de v_f = new F110_dm_chuc_vu_de();
         decimal v_id_chuc_vu = CIPConvert.ToDecimal(m_grv.GetDataRow(m_grv.FocusedRowHandle)[DM_CHUC_VU.ID]);
         US_DM_CHUC_VU v_us = new US_DM_CHUC_VU(v_id_chuc_vu);
         v_f.display_for_update(v_us);
         load_data_to_grid();
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
 void m_cmd_delete_Click(object sender, EventArgs e)
 {
     try
     {
         decimal v_id_chuc_vu = CIPConvert.ToDecimal(m_grv.GetDataRow(m_grv.FocusedRowHandle)[DM_CHUC_VU.ID]);
         if (check_validate_data(v_id_chuc_vu))
         {
             string v_str_confirm = "Bạn có chắn chắn muốn xóa chức vụ này?";
             DialogResult v_dialog = XtraMessageBox.Show(v_str_confirm, "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (v_dialog == DialogResult.Yes)
             {
                 US_DM_CHUC_VU v_us = new US_DM_CHUC_VU(v_id_chuc_vu);
                 v_us.Delete();
                 XtraMessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 load_data_to_grid();
             }
         }
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
 private void load_data_to_sle_chuc_vu()
 {
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds, " where id_don_vi = " + Convert.ToDecimal(m_sle_don_vi.EditValue));
     m_sle_chuc_vu.Properties.DataSource = v_ds.Tables[0];
     m_sle_chuc_vu.Properties.DisplayMember = DM_CHUC_VU.TEN_CHUC_VU;
     m_sle_chuc_vu.Properties.ValueMember = DM_CHUC_VU.ID;
     //m_sle_chuc_vu.Properties.NullText = "---Chọn chức vụ---";
     m_sle_chuc_vu.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
     m_sle_chuc_vu.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFit;
 }
 private void us_to_form(US_DM_CHUC_VU ip_us)
 {
     m_sle_don_vi.EditValue = ip_us.dcID_DON_VI;
     m_sle_loai_chuc_vu.EditValue = ip_us.dcID_LOAI_CHUC_VU;
     m_txt_ma_chuc_vu.Text = ip_us.strMA_CHUC_VU;
     m_txt_ten_chuc_vu.Text = ip_us.strTEN_CHUC_VU;
     m_txt_thu_tu.Text = ip_us.dcSO_THU_TU.ToString();
     m_txt_ghi_chu.Text = ip_us.strGHI_CHU;
 }
 private DataTable load_data_to_chuc_vu()
 {
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds);
     return v_ds.Tables[0];
 }
        private void load_data_2_sle_chon_vi_tri()
        {
            US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
            DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
            v_us.FillDataset(v_ds, " where id_don_vi = " + Convert.ToDecimal(m_sle_chon_don_vi.EditValue));
            m_sle_chon_vi_tri.Properties.DataSource = v_ds.Tables[0];

            m_sle_chon_vi_tri.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            m_sle_chon_vi_tri.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFit;
        }
 private void load_data_to_sle_chuc_vu()
 {
     US_DM_CHUC_VU v_us = new US_DM_CHUC_VU();
     DS_DM_CHUC_VU v_ds = new DS_DM_CHUC_VU();
     v_us.FillDataset(v_ds);
     m_sle_chuc_vu.Properties.DataSource = v_ds.Tables[0];
     m_sle_chuc_vu.Properties.DisplayMember = DM_CHUC_VU.TEN_CHUC_VU;
     m_sle_chuc_vu.Properties.ValueMember = DM_CHUC_VU.ID;
     m_sle_chuc_vu.Properties.NullText = "---Chọn chức vụ---";
 }