Ejemplo n.º 1
0
        public frmTraSach()
        {
            InitializeComponent();

            sachBUS      = new SachBUS();
            theDGBus     = new TheDocGiaBUS();
            phieumuonBUS = new PhieuMuonBUS();
            phieutraBUS  = new PhieuTraBUS();
        }
Ejemplo n.º 2
0
        public frmTraSach(PhieuMuonDTO selectedreceipt)
        {
            InitializeComponent();

            sachBUS         = new SachBUS();
            theDGBus        = new TheDocGiaBUS();
            phieumuonBUS    = new PhieuMuonBUS();
            phieutraBUS     = new PhieuTraBUS();
            SelectedReceipt = selectedreceipt;
            SelectedBookIDs = new List <string>();
        }
Ejemplo n.º 3
0
        public frmChiTietPhieuMuon(PhieuMuonDTO phieuMuon)
        {
            InitializeComponent();
            sachBus  = new SachBUS();
            theDGBus = new TheDocGiaBUS();

            GetInfo_From(phieuMuon);
            GetTenDG_From_MaDG();
            AddSach_Into_ListSach();
            SetTenDG_NgayMuon();

            LoadDataGirdView_ChiTietPM();
        }
Ejemplo n.º 4
0
        private void TheDocGia_Load(object sender, EventArgs e)
        {
            LoaiDocGiaBUS        bus = new LoaiDocGiaBUS();
            List <LoaiDocGiaDTO> ListOfLoaiDocGia = (List <LoaiDocGiaDTO>)bus.GetAll();

            cmbType.DataSource    = ListOfLoaiDocGia;
            cmbType.DisplayMember = "TenLoaiDocGia";
            cmbType.ValueMember   = "MaLoaiDocGia";

            TheDocGiaBUS               tdgBus          = new TheDocGiaBUS();
            List <TheDocGiaDTO>        ListOfTheDocGia = (List <TheDocGiaDTO>)tdgBus.GetAll();
            BindingList <TheDocGiaDTO> bl = new BindingList <TheDocGiaDTO>(ListOfTheDocGia);

            dgv.DataSource = bl;
            bl.AllowNew    = false;
            //bl.AllowRemove = false;
            //bl.AllowEdit = false;
        }
Ejemplo n.º 5
0
        public frmThemSach(Form1 form1, PhieuMuonDTO phieuMuon_CellClick)
        {
            InitializeComponent();
            this.frm1 = form1;


            sachBus        = new SachBUS();
            theDGBus       = new TheDocGiaBUS();
            phieuMuonBus   = new PhieuMuonBUS();
            QdPhieuMuonBus = new QuyDinhPhieuMuonBUS();

            Create_DataGV_ThemSach();
            LoadMaDG_Into_CmbxMaDG();
            txtTenDG_frmMuon.Text = ListTenDG[ListMaDG.IndexOf(phieuMuon_CellClick.Madg.ToString())];
            cmbxMaDG_frmMuon.Text = phieuMuon_CellClick.Madg;
            mapm = phieuMuon_CellClick.Mapm;

            GetQuyDinh_PhieuMuon();

            ListMaSach = new List <string>();
            ListMaSach = InputChecking.Instance.SeparateWords(phieuMuon_CellClick.Masach.ToString());
            //Tim Kiem Ten DG Dua Vao MaDG
            ListSLSachMuon.Clear();
            for (int index = 0; index < ListMaSach.Count; index++)
            {
                ListSLSachMuon.Add(1);
            }

            intTongSoSachDangChon = ListMaSach.Count;


            AddSach_Into_ListSach();
            ThemSach_Into_DgvThemSach_FromList();
            this.LoadDataGirdView_NhapSach();
            ThemSachFrom_DgvLoadSach_Into_DgvThemSach();
            CheckIfRowIsChecked_In_Dgv_LoadSach();

            flag = 2;
        }
Ejemplo n.º 6
0
        public frmThemSach(Form1 form1)
        {
            InitializeComponent();
            this.frm1 = form1;


            Create_DataGV_ThemSach();

            sachBus        = new SachBUS();
            theDGBus       = new TheDocGiaBUS();
            phieuMuonBus   = new PhieuMuonBUS();
            QdPhieuMuonBus = new QuyDinhPhieuMuonBUS();
            QD             = new QuyDinhPhieuMuonDTO();
            QdinhPtra      = new QuyDinhPhieuTraDTO();
            QdPhieuTraBus  = new QuyDinhPhieuTraBUS();

            LoadDataGirdView_NhapSach();
            LoadMaDG_Into_CmbxMaDG();

            GetQuyDinh_PhieuMuon();

            flag = 1;
        }
Ejemplo n.º 7
0
        private void btnFind_Click(object sender, EventArgs e)
        {
            // Lấy thông tin của các chuỗi điều kiện
            string        strName    = txtName.Text.Trim();
            string        strAddress = txtAddress.Text.Trim();
            string        strEmail   = txtEmail.Text.Trim();
            LoaiDocGiaDTO loaidocgia = (LoaiDocGiaDTO)cmbType.SelectedItem;
            DateTime      dtBegin    = dtpBegin.Value;
            DateTime      dtEnd      = dtpEnd.Value;
            DateTime      dtBirth    = dtpBirth.Value;

            // Thêm điều kiện
            TheDocGiaBUS bus = new TheDocGiaBUS();

            List <string> lstKey   = new List <string>();
            List <object> lstValue = new List <object>();
            List <bool>   lstExact = new List <bool>();

            // Họ tên
            if (strName != "")
            {
                lstKey.Add("HoTen");
                lstValue.Add(strName);
                lstExact.Add(false);
            }
            // Số nhà
            if (strAddress != "")
            {
                lstKey.Add("SoNha");
                lstValue.Add(strAddress);
                lstExact.Add(false);
            }
            // Đường
            if (strEmail != "")
            {
                lstKey.Add("Email");
                lstValue.Add(strEmail);
                lstExact.Add(false);
            }

            lstKey.Add("MaLoaiDocGia");
            lstValue.Add(loaidocgia.MaLoaiDocGia);
            lstExact.Add(true);

            if (chkBegin.Checked == true)
            {
                lstKey.Add("NgayLapThe");
                lstValue.Add(dtBegin);
                lstExact.Add(true);
            }
            if (chkEnd.Checked == true)
            {
                lstKey.Add("NgayHetHan");
                lstValue.Add(dtEnd);
                lstExact.Add(true);
            }
            if (chkBirth.Checked == true)
            {
                lstKey.Add("NgaySinh");
                lstValue.Add(dtBirth);
                lstExact.Add(true);
            }

            List <TheDocGiaDTO> result = (List <TheDocGiaDTO>)bus.GetByProperties(lstKey, lstValue, lstExact);

            dgv.DataSource = result;

            // Thông báo
            if (result.Count == 0)
            {
                MessageBox.Show("Không có thẻ độc giả tương ứng.");
            }
            else
            {
                MessageBox.Show(result.Count + " thẻ độc giả được tìm thấy.");
            }

//            bus.Close();
        }
Ejemplo n.º 8
0
        public void Sua(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)
        {
            TheDocGiaDTO    tdgDTO = new TheDocGiaDTO();
            QDLoaiDocGiaDTO ldgDTO = new QDLoaiDocGiaDTO();

            tdgBUS.MapDataDGFromGUI(ref tdgDTO, txtMaDG, txtHoTen, dtpNgaySinh, txtDiaChi, txtEmail);
            ldgBUS.MapDataLDGFromGUIDG(ref ldgDTO, cbxLoaiDG);
            //MapDataDGFromGUI(tdgDTO);
            //MapDataLDGFromGUIDG(ldgDTO);
            if (tdgBUS.Sua(tdgDTO, ldgDTO) == true)
            {
                MessageBox.Show("Cập nhật thành công");
                tdgBUS.LoadTabQLDG(ref dgvDG, ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo, ref txtTuoiToiThieu, ref txtTuoiToiDa, ref cbxTimKiemDG, ref txtThoiHanThe, ldgBUS, tdgBUS, qddgBUS);
            }
            else
            {
                MessageBox.Show("Cập nhật không thành công", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 9
0
 public void Xoa(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 ComboBoxEx cbxTimKiemDG, TheDocGiaBUS tdgBUS)
 {
     if (dgvDG.RowCount != 0)
     {
         TheDocGiaDTO tdgDTO = new TheDocGiaDTO();
         foreach (DataGridViewRow row in dgvDG.SelectedRows)
         {
             tdgDTO.Madg = row.Cells["MADG"].Value.ToString();
             tdgBUS.Xoa(tdgDTO);
         }
         tdgBUS.LoadDgvDG(ref dgvDG, tdgBUS);
         if (dgvDG.RowCount != 0)
         {
             tdgBUS.GetDataWhenClickDGVDG(dgvDG.Rows[0], ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo);
         }
     }
     //Sau khi delete
     if (dgvDG.RowCount == 0)
     {
         tdgBUS.ResetSTT();
         tdgBUS.ClearPanelDG(tdgBUS, ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo, ref cbxTimKiemDG);
     }
 }
Ejemplo n.º 10
0
        public void Them(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)
        {
            TheDocGiaDTO    tdgDTO = new TheDocGiaDTO();
            QDLoaiDocGiaDTO ldgDTO = new QDLoaiDocGiaDTO();

            tdgBUS.MapDataDGFromGUI(ref tdgDTO, txtMaDG, txtHoTen, dtpNgaySinh, txtDiaChi, txtEmail);
            ldgBUS.MapDataLDGFromGUIDG(ref ldgDTO, cbxLoaiDG);
            //this.MapDataDGFromGUI(tdgDTO);
            //this.MapDataLDGFromGUIDG(ldgDTO);
            //if (IsDataPanelDGInValid(tdgDTO, ldgDTO))
            //    MessageBox.Show("Kiểm tra lại dữ liệu", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            List <string> listQuyDinh = new List <string>()
            {
                txtTuoiToiThieu.Text, txtTuoiToiDa.Text, txtThoiHanThe.Text
            };

            if (tdgBUS.IsTrungKhopKhoaChinh(tdgDTO.Madg, dgvDG))
            {
                return;
            }


            if (tdgBUS.CheckDataPanelDGInValid(tdgDTO, ldgDTO) == false)
            {
                return;
            }

            if (tdgBUS.CheckQuyDinhDG(tdgDTO, listQuyDinh) == false)
            {
                return;
            }


            if (tdgBUS.Them(tdgDTO, ldgDTO, int.Parse(txtThoiHanThe.Text), listQuyDinh))
            {
                MessageBox.Show("Thêm thành công");
                tdgBUS.LoadTabQLDG(ref dgvDG, ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo, ref txtTuoiToiThieu, ref txtTuoiToiDa, ref cbxTimKiemDG, ref txtThoiHanThe, ldgBUS, tdgBUS, qddgBUS);
            }
            else
            {
                MessageBox.Show("Thêm không thành công", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }