Esempio n. 1
0
 private void mnuquanlyphieumuon_Click(object sender, EventArgs e)
 {
     frmQuanlydanhsachphieumuon frm = new frmQuanlydanhsachphieumuon();
     this.IsMdiContainer = true;
     frm.MdiParent = this;
     frm.Show();
 }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     frmQuanlydanhsachphieumuon frm = new frmQuanlydanhsachphieumuon();
     frm.type = 1;
     frm.Owner = this;
     sachlist = null;
     frm.ShowDialog();
     if (sachlist != null)
     {
         DataTable dt = new DataTable();
         dt.Columns.Add("Chọn", System.Type.GetType("System.Boolean"));
         dt.Columns.Add("Mã sách", System.Type.GetType("System.Int16"));
         dt.Columns.Add("Tên sách", System.Type.GetType("System.String"));
         for (int count = 0; count < sachlist.Tables[0].Rows.Count; count++)
             if ((bool)sachlist.Tables[0].Rows[count][2] == false)
             {
                 DataRow rowdes = dt.NewRow();
                 rowdes[0] = false;
                 rowdes[1] = (int)sachlist.Tables[0].Rows[count][0];
                 rowdes[2] = sachlist.Tables[0].Rows[count][1].ToString();
                 dt.Rows.Add(rowdes);
             }
         PhieuMuonDto phieu = BUS.PhieuMuonBus.Search(mPhieu);
         DocGiaDto docgia = BUS.DocGiaBus.Search(phieu.MDocGia);
         txtMadocgia.Text = phieu.MDocGia.ToString();
         txtHoTen.Text = docgia.HoTen;
         txtNgaymuon.Text = phieu.NgayMuon.ToShortDateString();
         txtSongay.Text = phieu.SoNgayMuon.ToString();
         dtgSach.DataSource = dt;
         dtgSach.Columns[2].Width = 220;
     }
 }