Пример #1
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            Class.XuLyThuVien KiemTra = new Class.XuLyThuVien();

            if (stt != "")
            {
                KiemTra.Plus_SoLuongSach(KiemTra.LayMaSach_TempView(Convert.ToInt32(stt)));
                KiemTra.RemoveSach_DgvTemp(Convert.ToInt32(stt));

                GridViewSachMuon.DataSource = KiemTra.InfoSach_DgvTemp();
                //reset stt;
                stt = "";
                txtRemoveBook.Clear();
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Chưa Chọn Dòng Cần Xoá", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void btnDatThe_Click(object sender, EventArgs e)
        {
            Class.XuLyThuVien KiemTra = new Class.XuLyThuVien();

            if (KiemTra.DemSachTemp() < 1)
            {
                if (MetroFramework.MetroMessageBox.Show(this, "Chắc Chắn Hay Không", "Thoát", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    this.Close();
                }
            }
            else
            {
                if (MetroFramework.MetroMessageBox.Show(this, "Chắc Chắn Hay Không", "Bạn Muốn Đặt Sách ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int    SoLuongSach = KiemTra.DemSachTemp();
                    int    STT;
                    string MaSach;
                    KiemTra.XoaPhieuMuonSach(MaVe_FormMain);
                    KiemTra.PhieuMuonSach(lblNgayMuon.Text, MaVe_FormMain);

                    for (int i = 0; i < SoLuongSach; i++)
                    {
                        STT    = Convert.ToInt32(GridViewSachMuon.Rows[i].Cells[0].Value.ToString());
                        MaSach = KiemTra.LayMaSach_TempView(STT);

                        KiemTra.ChiTietMuonSach(MaSach, STT, MaVe_FormMain);
                    }


                    //clear DGV_Temp
                    KiemTra.DeleteAll_DgvTemp();
                    MetroFramework.MetroMessageBox.Show(this, string.Format("Đặt Thành Công Cho Độc Giả : {0}", lblTenDocGia.Text), "Thông Báo");
                    this.Close();
                }
            }
        }