Inheritance: IP.Core.IPUserService.US_Object
 private void load_danh_sach_don_vi()
 {
     US_DM_DON_VI v_us = new US_DM_DON_VI();
     DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
     v_us.FillDataset(v_ds, "order by SO_THU_TU");
     m_sle_chon_don_vi.Properties.DataSource = v_ds.Tables[0];
 }
 //check validate data
 private bool check_ma_don_vi_is_exist()
 {
     US_DM_DON_VI v_us = new US_DM_DON_VI();
     DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
     v_us.FillDataset(v_ds, "where ma_don_vi = N'" + m_txt_ma_dv.Text + "'");
     if (m_txt_ma_dv.Text != m_us_dm_dv.strMA_DON_VI && v_ds.Tables[0].Rows.Count !=0)
     {
         return true;
     }
     return false;
 }
        private void load_data_2_tree()
        {
            US_DM_DON_VI v_us_dv = new US_DM_DON_VI();
            DS_DM_DON_VI v_ds_dv = new DS_DM_DON_VI();
            v_us_dv.FillDataset(v_ds_dv);

            m_tree_don_vi.ParentFieldName = DM_DON_VI.ID_DON_VI_CAP_TREN;
            m_tree_don_vi.DataSource = v_ds_dv.Tables[0];
            m_tree_don_vi.RefreshDataSource();

            m_tree_don_vi.ExpandAll();
        }
 public void display_4_update(US_DM_DON_VI ip_us)
 {
     this.Text = "F101 - Sửa đơn vị";
     m_lbl_header.Text = "SỬA ĐƠN VỊ";
     m_e_form_mode = DataEntryFormMode.UpdateDataState;
     m_txt_ma_dv.Text = ip_us.strMA_DON_VI;
     m_txt_ten_dv.Text = ip_us.strTEN_DON_VI;
     //m_sle_loai_dv.EditValue = ip_us.dcID_LOAI_DON_VI;
     m_txt_thu_tu.Text = ip_us.dcSO_THU_TU.ToString();
     m_sle_chon_dv_cap_tren.EditValue = ip_us.dcID_DON_VI_CAP_TREN;
     m_us_dm_dv = ip_us;
     this.CenterToScreen();
     this.ShowDialog();
 }
 private void load_data_to_sle_don_vi()
 {
     US_DM_DON_VI v_us = new US_DM_DON_VI();
     DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
     v_us.FillDataset(v_ds);
     m_sle_don_vi.Properties.DataSource = v_ds.Tables[0];
     m_sle_don_vi.Properties.DisplayMember = DM_DON_VI.TEN_DON_VI;
     m_sle_don_vi.Properties.ValueMember = DM_DON_VI.ID;
     //m_sle_don_vi.Properties.NullText = "---Chọn đơn vị---";
 }
 private DataTable load_data_to_don_vi()
 {
     US_DM_DON_VI v_us = new US_DM_DON_VI();
     DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
     v_us.FillDataset(v_ds);
     return v_ds.Tables[0];
 }
        void m_cmd_delete_Click(object sender, EventArgs e)
        {
            try
            {
                if (CHRM_BaseMessages.MsgBox_Confirm(CONST_ID_MSGBOX.QUESTION_XAC_NHAN_XOA_DU_LIEU) ==  true)
                {
                    DataRow v_dr = m_grv_tham_so.GetDataRow(m_grv_tham_so.FocusedRowHandle);
                    decimal v_id_don_vi = CIPConvert.ToDecimal(v_dr["ID"]);

                    US_DM_DON_VI v_us = new US_DM_DON_VI(v_id_don_vi);
                    v_us.BeginTransaction();
                    v_us.Delete();
                    v_us.CommitTransaction();
                    load_data_2_grid();
                    CHRM_BaseMessages.MsgBox_Infor(CONST_ID_MSGBOX.INFOR_XOA_DU_LIEU_THANH_CONG);
                }
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
 private DataSet load_data_2_ds_v_dm_don_vi()
 {
     US_DM_DON_VI v_us = new US_DM_DON_VI();
     DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
     v_us.FillDataset(v_ds);
     return v_ds;
 }
 void m_cmd_update_Click(object sender, EventArgs e)
 {
     try
     {
         F101_dm_don_vi_de v_f = new F101_dm_don_vi_de();
         decimal v_id_don_vi = CIPConvert.ToDecimal(m_tree_don_vi.FocusedNode.GetValue("ID"));
         US_DM_DON_VI v_us = new US_DM_DON_VI(v_id_don_vi);
         v_f.display_4_update(v_us);
         load_data_2_tree();
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
 void m_cmd_delete_Click(object sender, EventArgs e)
 {
     try
     {
         decimal v_id_don_vi = CIPConvert.ToDecimal(m_tree_don_vi.FocusedNode.GetValue("ID"));
         if (check_validate_data(v_id_don_vi))
         {
             string v_str_confirm = "Bạn có chắc chắn muốn xóa đơn 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_DON_VI v_us = new US_DM_DON_VI(v_id_don_vi);
                 v_us.Delete();
                 XtraMessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 load_data_2_tree();
             }
         }
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(v_e);
     }
 }
        private DS_DM_DON_VI load_data_2_dm_loai_don_vi()
        {
            DS_DM_DON_VI v_ds = new DS_DM_DON_VI();
            US_DM_DON_VI v_us = new US_DM_DON_VI();

            v_us.FillDataset(v_ds);

            return v_ds;
        }