public void ClearPanelQDDG(QuyDinhDocGiaBUS qddgBUS, ref TextBoxX txtMaQDDG, ref TextBoxX txtQDDGHanThe, ref TextBoxX txtQDDGTuoiToiThieu, ref TextBoxX txtQDDGTuoiToiDa)
 {
     txtMaQDDG.Text           = "QDDG" + qddgBUS.GetNewSTT().ToString();
     txtQDDGHanThe.Text       = "0";
     txtQDDGTuoiToiThieu.Text = "0";
     txtQDDGTuoiToiDa.Text    = "0";
 }
        public bool MapDataQDDGFromGUI(ref QuyDinhDocGiaDTO qddgDTO, TextBoxX txtMaQDDG, TextBoxX txtQDDGHanThe, TextBoxX txtQDDGTuoiToiThieu, TextBoxX txtQDDGTuoiToiDa, QuyDinhDocGiaBUS qddgBUS)
        {
            qddgDTO.Maqd = txtMaQDDG.Text;
            if (qddgBUS.IsOnlyNumber(txtQDDGHanThe.Text))
            {
                qddgDTO.Thoihanthe = int.Parse(txtQDDGHanThe.Text);
            }
            else
            {
                return(false);
            }

            if (qddgBUS.IsOnlyNumber(txtQDDGTuoiToiThieu.Text))
            {
                qddgDTO.Tuoitoithieu = int.Parse(txtQDDGTuoiToiThieu.Text);
            }
            else
            {
                return(false);
            }

            if (qddgBUS.IsOnlyNumber(txtQDDGTuoiToiDa.Text))
            {
                qddgDTO.Tuoitoida = int.Parse(txtQDDGTuoiToiDa.Text);
            }
            else
            {
                return(false);
            }

            qddgDTO.Ngayra      = DateTime.Today;
            qddgDTO.Ngayketthuc = DateTime.MaxValue;
            return(true);
        }
 public void LoadPanelQDDG(ref DataGridViewX dgvQDDG, ref TextBoxX txtMaQDDG, ref TextBoxX txtQDDGHanThe, ref TextBoxX txtQDDGTuoiToiThieu, ref TextBoxX txtQDDGTuoiToiDa, QuyDinhDocGiaBUS qddgBUS)
 {
     LoadDgvQDDG(ref dgvQDDG, qddgBUS);
     if (dgvQDDG.RowCount != 0)
     {
         GetDataWhenClickDGVQDDG(dgvQDDG.Rows[0], ref txtMaQDDG, ref txtQDDGHanThe, ref txtQDDGTuoiToiThieu, ref txtQDDGTuoiToiDa); //Load data từ datagridview vào panel
     }
     else
     {
         ClearPanelQDDG(qddgBUS, ref txtMaQDDG, ref txtQDDGHanThe, ref txtQDDGTuoiToiThieu, ref txtQDDGTuoiToiDa);
     }
 }
 public void LoadDgvQDDG(ref DataGridViewX dgvQDDG, QuyDinhDocGiaBUS qddgBUS)
 {
     dgvQDDG.DataSource = qddgBUS.LoadBangQDDG();
 }
 public void LoadTabQLDG(ref DataGridViewX dgvDG, ref TextBoxX txtMaDG, ref TextBoxX txtHoTen, ref DateTimeInput dtpNgaySinh, ref TextBoxX txtDiaChi, ref TextBoxX txtEmail, ref ComboBoxEx cbxLoaiDG, ref DateTimeInput dtpNgayLapThe, ref DateTimeInput dtpNgayHetHan, ref TextBoxX txtSoSachDangMuon, ref TextBoxX txtTongTienNo, ref TextBoxX txtTuoiToiThieu, ref TextBoxX txtTuoiToiDa, ref ComboBoxEx cbxTimKiemDG, ref TextBoxX txtThoiHanThe, QDLoaiDocGiaBUS ldgBUS, TheDocGiaBUS tdgBUS, QuyDinhDocGiaBUS qddgBUS)
 {
     LoadListLoaiDG(ref cbxLoaiDG, ldgBUS);
     LoadDgvDG(ref dgvDG, tdgBUS);
     LoadQDDG(ref txtTuoiToiThieu, ref txtTuoiToiDa, ref txtThoiHanThe, qddgBUS);
     if (dgvDG.RowCount != 0)
     {
         GetDataWhenClickDGVDG(dgvDG.Rows[0], ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo);//Load data từ datagridview vào panel
     }
     else
     {
         tdgBUS.ResetSTT();
         ClearPanelDG(tdgBUS, ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo, ref cbxTimKiemDG);
     }
 }
        public void LoadQDDG(ref TextBoxX txtTuoiToiThieu, ref TextBoxX txtTuoiToiDa, ref TextBoxX txtThoiHanThe, QuyDinhDocGiaBUS qddgBUS)
        {
            DataTable data = qddgBUS.LoadBangQDDG();

            if (data.Rows.Count != 0)
            {
                DataRow row = data.Rows[data.Rows.Count - 1];
                txtTuoiToiThieu.Text = row["TUOITOITHIEU"].ToString();
                txtTuoiToiDa.Text    = row["TUOITOIDA"].ToString();
                txtThoiHanThe.Text   = row["THOIHANTHE"].ToString();
            }
            else
            {
                txtTuoiToiThieu.Text = "";
                txtTuoiToiDa.Text    = "";
                txtThoiHanThe.Text   = "";
            }
        }