Exemplo n.º 1
0
        public void loadInfo()
        {
            chkNgayTra.Checked = false;
            dtpNgayT.Enabled   = false;
            tbMaMT.Text        = maMT;
            cboTenDS.Text      = tenDS;
            cboMaDG.Text       = maDG;
            cboNV.Text         = maNV;
            tbGhiChu.Text      = ghiChu;
            cboMaSach.Text     = maSach;
            if (ngayM != DateTime.MinValue)
            {
                dtpNgayM.Value = ngayM;
            }
            if (ngayT != DateTime.MinValue)
            {
                //checkT = true;
                chkNgayTra.Checked = true;
                dtpNgayT.Value     = ngayT;
                dtpNgayT.Enabled   = true;
            }
            if (hanTra != DateTime.MinValue)
            {
                dtpNgayHH.Value = hanTra;
            }
            int sl = cboTenDS.Items.Count;

            for (int i = 0; i < sl; i++)
            {
                cboTenDS.Items.RemoveAt(0);
            }
            DataTable dtb = DauSach_BUS.dsTenDS();

            for (int i = 0; i < dtb.Rows.Count; i++)
            {
                // string name = dtb.Rows[i][0].ToString().ToUpper();
                string name = dtb.Rows[i][0].ToString();
                cboTenDS.Items.Add(name);
            }
            sl = cboMaDG.Items.Count;
            for (int i = 0; i < sl; i++)
            {
                cboMaDG.Items.RemoveAt(0);
            }
            dtb = DocGia_BUS.dsMaDG();
            for (int i = 0; i < dtb.Rows.Count; i++)
            {
                // string name = dtb.Rows[i][0].ToString().ToUpper();
                string name = dtb.Rows[i][0].ToString();
                cboMaDG.Items.Add(name);
            }
            sl = cboMaSach.Items.Count;
            for (int i = 0; i < sl; i++)
            {
                cboMaSach.Items.RemoveAt(0);
            }
            dtb = Sach_BUS.dsmaSach(tenDS);
            for (int i = 0; i < dtb.Rows.Count; i++)
            {
                // string name = dtb.Rows[i][0].ToString().ToUpper();
                string name = dtb.Rows[i][0].ToString();
                cboMaSach.Items.Add(name);
            }
            sl = cboNV.Items.Count;
            for (int i = 0; i < sl; i++)
            {
                cboNV.Items.RemoveAt(0);
            }
            dtb = NhanVien_BUS.dsMaNV();
            for (int i = 0; i < dtb.Rows.Count; i++)
            {
                // string name = dtb.Rows[i][0].ToString().ToUpper();
                string name = dtb.Rows[i][0].ToString();
                cboNV.Items.Add(name);
            }
            if (maDG != "")
            {
                tbTenDG.Text = DocGia_BUS.TenDG(maDG);
            }
        }
Exemplo n.º 2
0
 private void cboMaDG_SelectedIndexChanged(object sender, EventArgs e)
 {
     tbTenDG.Text = DocGia_BUS.TenDG(cboMaDG.Text);
 }