private void btnLuu_Click(object sender, EventArgs e) { var phieuMuon_BUS = new PhieuMuon_BUS(); if (phieuMuon_BUS.Insert_Phieu(int.Parse(txtMaNhanVien.Text), dateMuon.Value)) { MessageBox.Show("Đã thêm phiếu!!"); } if (phieuMuon_BUS.Insert_PhieuMuon(int.Parse(lblMaPhieuMuon.Text), int.Parse(txtMaDocGia.Text))) { MessageBox.Show("Đã thêm phiếu mượn!!!"); } for (var i = 0; i < dgvSachMuon.Rows.Count - 1; i++) { var maDauSach = dgvSachMuon.Rows[i].Cells[0].Value.ToString(); var maSach = dgvSachMuon.Rows[i].Cells[1].Value.ToString(); var tenSach = dgvSachMuon.Rows[i].Cells[2].Value.ToString(); var ngayTra = DateTime.Parse(dgvSachMuon.Rows[i].Cells[3].Value.ToString()); var ngayTra1 = ngayTra.ToString("yyyy - MM - dd HH: mm:ss.fff"); if (phieuMuon_BUS.Insert_PhieuMuonChiTiet(int.Parse(maSach), int.Parse(lblMaPhieuMuon.Text), int.Parse(maDauSach), ngayTra1)) { MessageBox.Show("Đã thêm phiếu mượn chi tiết"); } } dgvSachMuon.Rows.Clear(); dgvSachMuon.Refresh(); }
private void cbMaPhieuMuon_KhoiTao() { if (txtMaDocGia.Text != "") { cbMaPhieuMuon.ValueMember = "MaPhieuMuon"; cbMaPhieuMuon.DisplayMember = "MaPhieuMuon"; cbMaPhieuMuon.DataSource = PhieuMuon_BUS.GetPhieuMuonFromMaDocGia(txtMaDocGia.Text.ToInt32()); if (cbMaPhieuMuon != null) { cbMaPhieuMuon.SelectedIndex = 0; } } }
public frm_MuonSach() { // CheckForIllegalCrossThreadCalls = false; InitializeComponent(); muonsachBUS = new PhieuMuon_BUS(); muonsachDTO = new PhieuMuon_DTO(); CTmuonsachBUS = new ChiTietMuonSach_BUS(); CTmuonsachDTO = new ChiTietMuonSach_DTO(); quydinh3BUS = new QuyDinh3_BUS(); quydinh3DTO = new QuyDinh3_DTO(); var qd = quydinh3BUS.Select().Rows[0].ItemArray; dtNgayMuon.Value = DateTime.Now; dtNgayDuKienTra.Value = dtNgayMuon.Value.AddDays(int.Parse(qd[1].ToString())); lbSoLuong.Text = "0"; KhoiTaoCmbTiemKiem(); }
public frm_TTCTSachChuaTracs(string _maPhieuMuon) { InitializeComponent(); phieuMuon = new PhieuMuon_BUS(); maPhieuMuon = _maPhieuMuon; }
public frm_ThongTinSachChuaTra() { InitializeComponent(); phieuMuon = new PhieuMuon_BUS(); KhoitaoCmb(); }