public NhapThongTinChuyenBay()
 {
     InitializeComponent();
     quanlyBUS  = new QuanlysanbayvatuyenbayBUS();
     quydinhBUS = new QuyDinhBUS();
     QuyDinh    = quydinhBUS.LayDanhSachQuyDinh();
 }
 public frmChuyenLop()
 {
     InitializeComponent();
     DataService.OpenConnection();
     _quyDinhBUS = new QuyDinhBUS();
     _lopBUS     = new LopBUS();
 }
예제 #3
0
        private void frmMuonTraSach_Load(object sender, EventArgs e)
        {
            qdBUS  = new QuyDinhBUS();
            listQD = new List <QuyDinhDTO>();
            listQD = qdBUS.select();

            this.comboBox_PhuongThuc.Items.Insert(0, "Toàn bộ");
            this.comboBox_PhuongThuc.Items.Insert(1, "Bằng mã phiếu mượn");
            this.comboBox_PhuongThuc.Items.Insert(2, "Bằng mã phiếu trả");
            this.comboBox_PhuongThuc.Items.Insert(3, "Bằng mã đọc giả");
            this.comboBox_PhuongThuc.Items.Insert(4, "Bằng mã sách");
            this.comboBox_PhuongThuc.SelectedIndex = 0;
            dgBus         = new DocGiaBUS();
            sachBus       = new SachBUS();
            ldgBus        = new LoaiDocGiaBUS();
            pmBus         = new PhieuMuonBUS();
            listPhieuMuon = new List <PhieuMuonDTO>();
            listDocGia    = new List <DocGiaDTO>();
            listSach      = new List <SachDTO>();
            //  loadData_Vao_GridView("", DocGiaDAL.TimToanBo);
            listPhieuMuon = pmBus.select();
            loadLoaiDocGia_Combobox();
            loadMaSach_Combobox();
            loadData_Vao_GridView(listPhieuMuon);
        }
예제 #4
0
        private void btnHoanTat_Click(object sender, EventArgs e)
        {
            try
            {
                docGia.MaDocGia   = txtMaDocGia.Text;
                docGia.HoTenDG    = txtHoTen.Text;
                docGia.NgaySinh   = dtpNgaySinh.Value.ToString("MM/dd/yyyy").Substring(0, 10);
                docGia.DiaChi     = txtDiaChi.Text;
                docGia.Email      = txtEmail.Text;
                docGia.TTDG       = "TTDG01";
                docGia.MaLoaiDG   = cbbLoaiDocGia.SelectedValue.ToString();
                docGia.NvLapThe   = cbbMaNhanVien.SelectedValue.ToString();
                docGia.NgayLapThe = dtpNgayTiepNhan.Value.ToString("MM/dd/yyyy").Substring(0, 10);
                docGia.TongNo     = 0;
                QuyDinhBUS quyDinhBUS = new QuyDinhBUS();
                DataTable  dsQuyDinh  = quyDinhBUS.LayDanhSachQuyDinh();
                int        thoiHanThe = int.Parse(dsQuyDinh.Rows[0][2].ToString());
                docGia.NgayHetHan = dtpNgayTiepNhan.Value.AddMonths(thoiHanThe).ToString("MM/dd/yyyy").Substring(0, 10);

                DocGiaBUS docGiaBUS = new DocGiaBUS();
                docGiaBUS.ThemDocGia(docGia);
                MessageBox.Show("Thêm thành công");

                LamMoi();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Thêm thất bại. Lỗi:" + ex.ToString());
            }
        }
예제 #5
0
        private void Submit_Click(object sender, RoutedEventArgs e)
        {
            submit.Visibility                       = Visibility.Collapsed;
            cancel.Visibility                       = Visibility.Collapsed;
            edit.Visibility                         = Visibility.Visible;
            TextBox_MaxDebt.IsEnabled               = false;
            TextBox_MinExAfterBuying.IsEnabled      = false;
            TextBox_MinAddBeforeSupplying.IsEnabled = false;
            TextBox_MinExBeforeSupplying.IsEnabled  = false;
            btnChangeRule4.IsEnabled                = false;
            btnChangeRule3.IsEnabled                = false;
            btnChangeRule2.IsEnabled                = false;
            btnChangeRule1.IsEnabled                = false;

            QuyDinhDTO quyDinhMoi = new QuyDinhDTO(double.Parse(TextBox_MaxDebt.Text), int.Parse(TextBox_MinExAfterBuying.Text), int.Parse(TextBox_MinAddBeforeSupplying.Text), int.Parse(TextBox_MinExBeforeSupplying.Text));

            if (QuyDinhBUS.thayDoiQuyDinh(quyDinhMoi))
            {
                Global.quyDinh = quyDinhMoi;
            }
            else
            {
                MessageBox.Show("Thay đổi quy định thất bại", "Thông báo");
                TextBox_MaxDebt.Text               = Global.quyDinh.NoToiDa.ToString();
                TextBox_MinExAfterBuying.Text      = Global.quyDinh.LuongTonSauKhiBan.ToString();
                TextBox_MinAddBeforeSupplying.Text = Global.quyDinh.LuongNhapToiThieu.ToString();
                TextBox_MinExBeforeSupplying.Text  = Global.quyDinh.LuongTonToiThieuKhiNhap.ToString();
            }
            QuyDinhBUS.thayDoiKiemTraQuyDinh(Global.ControlRules);
        }
예제 #6
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int id;
            if (string.IsNullOrEmpty(txtID.Text))
            {
                MessageBox.Show("Chưa chọn quy định");
                return;
            }
            string maquydinh, noidung;
            id = Int32.Parse(txtID.Text.Trim());
            maquydinh = txtMaQD.Text.Trim();
            noidung = txtNoiDung.Text.Trim();
            QuyDinh qd = new QuyDinh(id, maquydinh, noidung);
            try
            {
                int i = new QuyDinhBUS().ThayDoiQuyDinh(qd);
                if (i == -2)
                {
                    MessageBox.Show("Chưa chọn thông tin");
                }
            }
            catch (Exception)
            {

            }
            MessageBox.Show("Thay đổi thành công");
            dgrQuyDinh.DataSource = qdbus.getQuyDinh();
        }
예제 #7
0
        private void Tai_Thong_Tin()
        {
            QuyDinhBUS QuyDinhBUS = new QuyDinhBUS();

            dsQuyDinh = QuyDinhBUS.LayDanhSachQuyDinh();

            dgvQuyDinh.DataSource = dsQuyDinh;
        }
예제 #8
0
 public XemLuong(TaiKhoanDTO nv)
 {
     nvBUS = new NhanVienBUS();
     qdBUS = new QuyDinhBUS();
     qd    = qdBUS.Laydulieu();
     tkDTO = nv;
     nvDTO = nvBUS.Laynv(tkDTO.manv);
     InitializeComponent();
 }
 private void frmQuanLyTheDocGia_Load(object sender, EventArgs e)
 {
     dgBus      = new DocGiaBUS();
     ldgBus     = new LoaiDocGiaBUS();
     listDocGia = new List <DocGiaDTO>();
     loadData_Vao_GridView("", DocGiaDAL.TimToanBo);
     qdBUS  = new QuyDinhBUS();
     listQD = new List <QuyDinhDTO>();
     listQD = qdBUS.select();
     loadLoaiDocGia_Combobox();
     AddDataToCmbTimKiem();
 }
 public FrmPhanLop()
 {
     InitializeComponent();
     _namHocBUS       = new NamHocBUS();
     _khoiBUS         = new KhoiBUS();
     _lopBUS          = new LopBUS();
     _hocSinhBUS      = new HocSinhBUS();
     _phanLopBUS      = new PhanLopBUS();
     _quyDinhBUS      = new QuyDinhBUS();
     _chuyenLopBUS    = new ChuyenLopBUS();
     _maNamHocHienTai = _quyDinhBUS.LayMaNamHoc_HienTai();
 }
예제 #11
0
 public FrmHocSinh()
 {
     InitializeComponent();
     _namHocBUS      = new NamHocBUS();
     _khoiBUS        = new KhoiBUS();
     _lopBUS         = new LopBUS();
     _hocSinhBUS     = new HocSinhBUS();
     _quyDinhBUS     = new QuyDinhBUS();
     _phanLopBUS     = new PhanLopBUS();
     _isAddButton    = true;
     _isDeleteButton = true;
 }
예제 #12
0
 public ChiTietMonAn(MonAnDTO ma)
 {
     maBUS      = new MonAnBUS();
     nlBUS      = new NguyenLieuBUS();
     dsnlBUS    = new DSNguyenLieuBUS();
     qdBUS      = new QuyDinhBUS();
     quydinh    = qdBUS.Laydulieu();
     this.maDTO = ma;
     GiaTien    = ma.dongia;
     InitializeComponent();
     loadDataVaoComboBox();
     loadData_Vao_GridView();
 }
예제 #13
0
        private void frmQuyDinh_Load(object sender, EventArgs e)
        {
            qdBUS  = new QuyDinhBUS();
            listQD = new List <QuyDinhDTO>();
            listQD = qdBUS.select();

            //        this.tb_MaDG.Text = listQD[0].MaQD;
            this.numericUpDown_TuoiToiThieu.Value  = listQD[0].TuoiToiThieu;
            this.numericUpDown_TuoiToiDa.Value     = listQD[0].TuoiToiDa;
            this.numericUpDown_NgayMuonToiDa.Value = listQD[0].SoNgayMuonToiDa;
            this.numericUpDown_SachMuonToiDa.Value = listQD[0].SoSachMuonToiDa;
            this.numericUpDown_NamXuatBan.Value    = listQD[0].KhoangCachNamXuatBan;
        }
예제 #14
0
 public ChiTietHoaDon(hoaDonDTO hoadon)
 {
     maBUS       = new MonAnBUS();
     nlBUS       = new NguyenLieuBUS();
     dsmaBUS     = new DSMonAnBUS();
     hdBUS       = new hoaDonBUS();
     qdBUS       = new QuyDinhBUS();
     dsnlBUS     = new DSNguyenLieuBUS();
     quydinh     = qdBUS.Laydulieu();
     this.hoadon = hoadon;
     InitializeComponent();
     loadDataVaoComboBox();
     loadData_Vao_GridView();
 }
예제 #15
0
        private void LoadQuyDinh()
        {
            QuyDinhBUS quyDinhBUS = new QuyDinhBUS();

            numericQD11.Text = quyDinhBUS.getByID(1).GiaTri.ToString();
            numericQD12.Text = quyDinhBUS.getByID(2).GiaTri.ToString();
            numericQD21.Text = quyDinhBUS.getByID(3).GiaTri.ToString();
            numericQD22.Text = quyDinhBUS.getByID(4).GiaTri.ToString();

            if (quyDinhBUS.getByID(5).GiaTri == 1)
            {
                checkBoxQD4.Checked = true;
            }
        }
예제 #16
0
        public NhapSachControl()
        {
            InitializeComponent();

            //load quy dinh
            QuyDinhBUS quyDinhBUS = new QuyDinhBUS();

            this.qd11 = quyDinhBUS.getByID(1).GiaTri;
            this.qd12 = quyDinhBUS.getByID(2).GiaTri;

            //Load dgv phieu nhap
            LoadDgvPhieuNhap();

            //Load combobox Sach
            loadComboBoxTenSach();
        }
예제 #17
0
        public HoaDonControl()
        {
            InitializeComponent();

            //Load quy dinh
            QuyDinhBUS quyDinhBUS = new QuyDinhBUS();

            this.qd21 = quyDinhBUS.getByID(3).GiaTri;
            this.qd22 = quyDinhBUS.getByID(4).GiaTri;

            //Load dgv phieu nhap
            LoadDgvHoaDon();

            //Load combobox Sach
            loadComboBoxTenSach();
        }
        public DashboardWindow()
        {
            InitializeComponent();
            Global.Books          = SachBUS.loadAll();
            Global.Categories     = TheLoaiBUS.loadAllAndConvertToFillCombobox();
            Global.BookCategories = TheLoaiBUS.loadAll();
            Global.Customers      = KhachHangBUS.loadAll();
            KiemTraQuyDinh kt = QuyDinhBUS.loadKiemTraQuyDinh();

            Global.ControlRules = kt;


            var rules = QuyDinhBUS.loadQuyDinh();

            Global.quyDinh         = rules;
            Global.BookBoughtBills = new List <ChiTietHoaDonBanSachDTO>();
        }
        void InsertCT()
        {
            if (txtMaPN.Text == "" || txtMaSach.Text == "" || txtDonGia.Text == "" || txtSLnhap.Text == "" || txtTongTien.Text == "")
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin");
                return;
            }
            if (IsNumber(txtSLnhap.Text) == false)
            {
                MessageBox.Show("Số lượng phải là số và không được âm", "Thông báo");
                return;
            }
            if (IsNumber(txtDonGia.Text) == false)
            {
                MessageBox.Show("Đơn giá phải là số và không được âm", "Thông báo");
                return;
            }

            string  mapn     = txtMaPN.Text;
            string  masach   = txtMaSach.Text;
            int     dongia   = Int32.Parse(txtDonGia.Text);
            int     soluong  = Int32.Parse(txtSLnhap.Text);
            int     tongtien = Int32.Parse(txtTongTien.Text);
            Sach    s        = TimSachBUS.getThongTinSach(masach);
            QuyDinh qd       = QuyDinhBUS.GetQD();

            if (s.TonCuoi > Int32.Parse(qd.TonNhapToiThieu))
            {
                MessageBox.Show("Chỉ được nhập sách có số lượng tồn ít hơn " + qd.TonNhapToiThieu);
                return;
            }
            if (soluong < Int32.Parse(qd.NhapToiThieu))
            {
                MessageBox.Show("Số lượng nhập tối thiểu là " + qd.NhapToiThieu);
                return;
            }
            if (CTPhieuNhapBUS.checkTrung(txtMaPN.Text, txtMaSach.Text) == false)
            {
                MessageBox.Show("Sách này đã có trong phiếu nhập");
                return;
            }
            CTPhieuNhapBUS.InsertCTPhieuNhap(mapn, masach, soluong, dongia, tongtien);
            UpdateSoLuongTon();
            UpdateTongTien();
            MessageBox.Show("Thêm sách vào phiếu nhập thành công!");
        }
예제 #20
0
        private void frmQuanLySach_Load(object sender, EventArgs e)
        {
            qdBUS  = new QuyDinhBUS();
            listQD = new List <QuyDinhDTO>();
            listQD = qdBUS.select();

            sachBUS  = new SachBUS();
            tlBUS    = new TheLoaiBUS();
            listSach = new List <SachDTO>();
            List <PhieuMuonDTO> ls = new PhieuMuonBUS().select();

            listSach = sachBUS.select(ls);
            loadData_Vao_GridView(listSach);
            loadData_Vao_Combobox();
            AddDataToCmbTimKiem();
            this.dateTimePicker_NgayNhap.Value = DateTime.Now;
        }
예제 #21
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            if (numericQD11.Text.Equals("") == true || numericQD12.Text.Equals("") == true ||
                numericQD21.Text.Equals("") == true || numericQD22.Text.Equals("") == true)
            {
                MessageBox.Show("Quy định không được bỏ trống", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DialogResult dialogResult = MessageBox.Show("Bạn có chắc chắn muốn cập nhật các quy định",
                                                        "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.Yes)
            {
                QuyDinhBUS quyDinhBUS = new QuyDinhBUS();
                QuyDinh    qd11       = quyDinhBUS.getByID(1);
                QuyDinh    qd12       = quyDinhBUS.getByID(2);
                QuyDinh    qd21       = quyDinhBUS.getByID(3);
                QuyDinh    qd22       = quyDinhBUS.getByID(4);
                QuyDinh    qd4        = quyDinhBUS.getByID(5);

                qd11.GiaTri = Convert.ToInt32(numericQD11.Value);
                qd12.GiaTri = Convert.ToInt32(numericQD12.Value);
                qd21.GiaTri = Convert.ToInt32(numericQD21.Value);
                qd22.GiaTri = Convert.ToInt32(numericQD22.Value);
                if (checkBoxQD4.Checked == true)
                {
                    qd4.GiaTri = Convert.ToInt32(1);
                }
                else
                {
                    qd4.GiaTri = Convert.ToInt32(-1);
                }

                if (quyDinhBUS.update(qd11) == true && quyDinhBUS.update(qd12) == true && quyDinhBUS.update(qd21) == true &&
                    quyDinhBUS.update(qd22) == true && quyDinhBUS.update(qd4) == true)
                {
                    MessageBox.Show("Cập nhật thành công", "Thành công", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("Cập nhật thất bại", "Thất bại", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #22
0
        void InsertHoaDon()
        {
            if (txtMaKH2.Text == "" || txtMaMoi.Text == "" || txtMaSach.Text == "" || txtSoLuong.Text == "")
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin");
                return;
            }
            if (IsNumber(txtSoLuong.Text) == false)
            {
                MessageBox.Show("Số lượng phải là số và không được âm", "Thông báo");
                return;
            }
            string mahd = txtMaMoi.Text;

            string masach  = txtMaSach.Text;
            int    soluong = Int32.Parse(txtSoLuong.Text);

            Sach    s     = TimSachBUS.getThongTinSach(masach);
            QuyDinh qd    = QuyDinhBUS.GetQD();
            int     check = s.TonCuoi - soluong;

            if (check < Int32.Parse(qd.TonBanToiThieu))
            {
                MessageBox.Show("Số lượng tồn của sách này sau khi bán đã nhỏ hơn quy định");
                return;
            }
            KhachHang kh = KhachHangBUS.GetTenKH(txtMaKH2.Text);

            if (Int32.Parse(kh.TongNo) > qd.KHNoToiThieu)
            {
                MessageBox.Show("Tiền nợ của khách hàng đã vượt quá quy định");
                return;
            }
            if (BanSachBUS.checkTrung(txtMaMoi.Text, txtMaSach.Text) == false)
            {
                MessageBox.Show("Sách này đã có trong hoá đơn");
                return;
            }
            BanSachBUS.InsertHoaDon(mahd, masach, soluong);
            UpdateSoLuongTon();
            UpdateTongTien();
            MessageBox.Show("Thêm hoá đơn thành công!");
        }
예제 #23
0
 private void btnCapNhat_Click(object sender, EventArgs e)
 {
     try
     {
         dgvQuyDinh.Update();
         DataTable dataTableUpdate = new DataTable();
         dataTableUpdate = dsQuyDinh.GetChanges();
         if (dataTableUpdate != null)
         {
             QuyDinhBUS QuyDinhBUS = new QuyDinhBUS();
             QuyDinhBUS.CapNhatQuyDinh(dataTableUpdate);
             Tai_Thong_Tin();
         }
         MessageBox.Show("Cập nhật thành công");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Cập nhật thất bại - Lỗi: " + ex.ToString());
     }
 }
 public frmQuyDinhToanTruong()
 {
     InitializeComponent();
     _quyDinhBUS = new QuyDinhBUS();
 }
예제 #25
0
 public ThayDoiQuyDinh()
 {
     InitializeComponent();
     quydinhBUS = new QuyDinhBUS();
     QuyDinh    = quydinhBUS.LayDanhSachQuyDinh();
 }
예제 #26
0
 private void QuanLyQuiDinh_Load(object sender, EventArgs e)
 {
     qdBUS = new QuyDinhBUS();
     LayduLieu();
 }
 public FrmQuyDinhDauNam()
 {
     InitializeComponent();
     _namHocBUS  = new NamHocBUS();
     _quyDinhBUS = new QuyDinhBUS();
 }