public frmXuatTamVatTuChoNhanVien()
        {
            InitializeComponent();

            _ID_nv = "";

            XuatVTChoNV = new clsXuatVatTuChoNhanVien();

            gbGrid.Text = "Danh sách nhân viên còn giữ vật tư";

            gridNhanVienNoVatTu.Visible = true;
            gridNhanVienNoVatTu.Dock = System.Windows.Forms.DockStyle.Fill;

            //Init cls Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);

            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);
            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            PanelButton.setButtonClickEvent(enumButton2.Dong);
            PanelButton.setButtonClickEvent(enumButton2.LamMoi);

            PanelButton.setButtonStatus(enumButton2.Them, false);
            PanelButton.setButtonStatus(enumButton2.Sua, false);
            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.Luu, false);
            PanelButton.setButtonStatus(enumButton2.Huy, false);
            btnThem.Enabled = false;
            btnSua.Enabled = false;
            btnXoa.Enabled = false;
            btnLuu.Enabled = false;
            btnHuy.Enabled = false;

            PanelButton.ResetButton();

            LoadData();

            init_cbMaNhanVien();
            init_cbTenNhanVien();
        }
        public frmDanhSachPhieuXuatTamVatTu(string maphieu)
        {
            InitializeComponent();
             this.maphieu =maphieu;
            PhieuXuatTam = new clsPhieuXuatTamVatTu();

            //Init cls Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);

            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);
            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            PanelButton.setButtonClickEvent(enumButton2.Dong);
            PanelButton.setButtonClickEvent(enumButton2.LamMoi);

            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.Luu, false);
            PanelButton.setButtonStatus(enumButton2.Huy, false);
            btnXoa.Enabled = false;
            btnLuu.Enabled = false;
            btnHuy.Enabled = false;

            PanelButton.ResetButton();

            LoadData();
            InitCombo();
        }
Пример #3
0
        /// <summary>
        /// Initializes the form component.
        /// Enable/Disable
        /// 
        /// * Nhóm top panel -> Chức năng cho toàn bộ phiếu
        /// BtnThem --> reset status frm --> chuẩn bị nhập mới.
        /// btnSua --> tùy theo mã phiếu --> Load data vào form
        /// btnLamMoi --> Có cần thiết --> disable
        /// btnHuy --> nếu đang thêm|sửa --> reset lại form
        /// btnDong --> Close
        /// *btnXoa --> Setup sau --> xóa chi tiết trước --> xóa phiếu
        /// btnLuu --> Apply action Them, sua
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbKhoNhap --> init tên kho
        /// txtMaPhieuNhap --> Mã Phiếu --> auto complete --> btn [...] --> chọn từ Danh Sách Mã Phiếu
        /// dtNgayNhap --> Chọn ngày (Format dd/mm/yyyy)
        /// txtLyDo
        /// txtCongTrinh
        /// txtDiaChi
        /// 
        /// *Nhóm panel cho grid - Chi tiết phiếu
        /// btnGridAdd --> Add to row
        /// btnGridDel
        /// btnGridEdit
        /// btnGridSave
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbMaVatTu -->
        /// cbTenVatTu -->
        /// txtDVT
        /// txtSLYC
        /// txtSLTX
        /// txtDonGia
        /// txtChatLuong
        /// 
        /// </summary>
        private void InitFormComponent()
        {
            //Init cls Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);

            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);
            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            //PanelButton.setButtonClickEvent(enumButton2.Them);
            //PanelButton.setButtonClickEvent(enumButton2.Xoa);
            //PanelButton.setButtonClickEvent(enumButton2.Sua);
            //PanelButton.setButtonClickEvent(enumButton2.LamMoi);
            //PanelButton.setButtonClickEvent(enumButton2.Luu);

            PanelButton.setButtonClickEvent(enumButton2.Huy);
            PanelButton.setButtonClickEvent(enumButton2.Dong);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            //Ko dùng nút xóa
            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.LamMoi, false);
            btnXoa.Enabled = false;
            btnLamMoi.Enabled = false;

            //Init cho combobox Kho Nhập
            initKhoNhap();
               // var temp = new clsDMVatTu().GetAll();

            //Init cho combobox Ma vat tu, Ten vat tu
              //  Dic = GetDict(new clsDMVatTu().GetAll());

            initMaVatTu();
            initTenVatTu();
            initChatLuong();
            ///
            //clsGiaoDienChung.initCombobox(cbLoaiPhieuNhan, new clsLoaiPhieuNhap(), "ma_loai_phieu_nhap", "ID_loai_phieu_nhap", "ma_loai_phieu_nhap");
            //cbLoaiPhieuNhan.DataSource = clsLoaiPhieuNhap.getAll();
            //cbLoaiPhieuNhan.ValueMember = "ID_loai_phieu_nhap";
            //cbLoaiPhieuNhan.DisplayMember= "ma_loai_phieu_nhap";

            clsGiaoDienChung.initCombobox(cbKhoNgoai, new clsDMKhoNgoai(), "Ten_kho_muon", "ID", "Ten_kho_muon");

            PanelButton.ResetClickStatus();
            PanelButton.ResetButton();
        }
        /// <summary>
        /// Initializes the form component.
        /// Enable/Disable
        /// 
        /// * Nhóm top panel -> Chức năng cho toàn bộ phiếu
        /// BtnThem --> reset status frm --> chuẩn bị nhập mới.
        /// btnSua --> tùy theo mã phiếu --> Load data vào form
        /// btnLamMoi --> Có cần thiết --> disable
        /// btnHuy --> nếu đang thêm|sửa --> reset lại form
        /// btnDong --> Close
        /// *btnXoa --> Setup sau --> xóa chi tiết trước --> xóa phiếu
        /// btnLuu --> Apply action Them, sua
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbKhoNhap --> init tên kho
        /// txtMaPhieuNhap --> Mã Phiếu --> auto complete --> btn [...] --> chọn từ Danh Sách Mã Phiếu
        /// dtNgayNhap --> Chọn ngày (Format dd/mm/yyyy)
        /// txtLyDo
        /// txtCongTrinh
        /// txtDiaChi
        /// 
        /// *Nhóm panel cho grid - Chi tiết phiếu
        /// btnGridAdd --> Add to row
        /// btnGridDel
        /// btnGridEdit
        /// btnGridSave
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbMaVatTu -->
        /// cbTenVatTu -->
        /// txtDVT
        /// txtSLYC
        /// txtSLTX
        /// txtDonGia
        /// txtChatLuong
        /// 
        /// </summary>
        private void InitFormComponent()
        {
            //Init cls Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);

            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);
            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            //PanelButton.setButtonClickEvent(enumButton2.Them);
            //PanelButton.setButtonClickEvent(enumButton2.Xoa);
            //PanelButton.setButtonClickEvent(enumButton2.Sua);
            //PanelButton.setButtonClickEvent(enumButton2.LamMoi);
            //PanelButton.setButtonClickEvent(enumButton2.Luu);

            PanelButton.setButtonClickEvent(enumButton2.Huy);
            PanelButton.setButtonClickEvent(enumButton2.Dong);

            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            //Ko dùng nút xóa
            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.LamMoi, false);
            btnXoa.Enabled = false;
            btnLamMoi.Enabled = false;

            //Init cho combobox Kho Nhập
            initKhoNhap();

            initMaVatTu();
            initTenVatTu();
            initChatLuong();

            PanelButton.ResetClickStatus();
            PanelButton.ResetButton();
        }
 public void setDelegateFormAction(FormActionDelegate2 frmAct)
 {
     this.frmAct = frmAct;
 }
Пример #6
0
        /// <summary>
        /// Initializes the form component.
        /// Enable/Disable
        /// 
        /// * Nhóm top panel -> Chức năng cho toàn bộ phiếu
        /// BtnThem --> reset status frm --> chuẩn bị nhập mới.
        /// btnSua --> tùy theo mã phiếu --> Load data vào form
        /// btnLamMoi --> Có cần thiết --> disable
        /// btnHuy --> nếu đang thêm|sửa --> reset lại form
        /// btnDong --> Close
        /// *btnXoa --> Setup sau --> xóa chi tiết trước --> xóa phiếu
        /// btnLuu --> Apply action Them, sua
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbKhoNhap --> init tên kho
        /// txtMaPhieuNhap --> Mã Phiếu --> auto complete --> btn [...] --> chọn từ Danh Sách Mã Phiếu
        /// dtNgayNhap --> Chọn ngày (Format dd/mm/yyyy)
        /// txtLyDo
        /// txtCongTrinh
        /// txtDiaChi
        /// 
        /// *Nhóm panel cho grid - Chi tiết phiếu
        /// btnGridAdd --> Add to row
        /// btnGridDel
        /// btnGridEdit
        /// btnGridSave
        /// 
        /// * Nhóm Component thông tin phiếu
        /// cbMaVatTu -->
        /// cbTenVatTu -->
        /// txtDVT
        /// txtSLYC
        /// txtSLTX
        /// txtDonGia
        /// txtChatLuong
        /// 
        /// </summary>
        private void InitFormComponent()
        {
            //Init cls Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);
            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);
            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);
            PanelButton.AddButton(enumButton2.Dong, ref btnDong);
            PanelButton.setButtonClickEvent(enumButton2.Huy);
            PanelButton.setButtonClickEvent(enumButton2.Dong);
            PanelButton.AddButton(enumButton2.Dong, ref btnDong);
            //Ko dùng nút xóa
            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.LamMoi, false);
            btnXoa.Enabled = false;
            btnLamMoi.Enabled = false;
            //Init cho combobox Kho Nhập
            initKhoNhap();
            initMaVatTu();
            initTenVatTu();
            initChatLuong();
            if (loaiphieu.Equals("HN"))
                clsGiaoDienChung.initCombobox(cbLoaiPhieuNhan, new clsLoaiPhieuD(), "ma_loai_phieu_nhap", "ID_loai_phieu_nhap", "ma_loai_phieu_nhap");
            else
                clsGiaoDienChung.initCombobox(cbLoaiPhieuNhan, new clsLoaiPhieuX(), "ma_loai_phieu_nhap", "ID_loai_phieu_nhap", "ma_loai_phieu_nhap");

            clsGiaoDienChung.initCombobox(cbKhoNhan, new clsDM_Kho(), "Ten_kho", "ID_kho", "Ten_kho");
            PanelButton.ResetClickStatus();
            PanelButton.ResetButton();
            if (this.loaiphieu.Equals("HN"))
            {
                lbSLHN.Text = "Số lượng hoàn nhập";
                //rdoBuTruPhieu.Enabled = false;
                rdoNhapGoiDau.Enabled = false;

            }
        }
        /// <summary>
        /// Demo tính năng thêm, tắt tạm tính năng sửa.
        /// </summary>
        private void initPanelButton()
        {
            //Init cls Panel Button
            PanelButton = new clsPanelButton2();

            frmAction = new FormActionDelegate2(FormAction);
            PanelButton.setDelegateFormAction(frmAction);

            PanelButton.AddButton(enumButton2.Them, ref btnThem);
            PanelButton.AddButton(enumButton2.Xoa, ref btnXoa);
            PanelButton.AddButton(enumButton2.Sua, ref btnSua);
            PanelButton.AddButton(enumButton2.LamMoi, ref btnLamMoi);
            PanelButton.AddButton(enumButton2.Luu, ref btnLuu);

            PanelButton.AddButton(enumButton2.Huy, ref btnHuy);
            PanelButton.AddButton(enumButton2.Dong, ref btnDong);

            PanelButton.AddButton(enumButton2.ThemLuoi, ref btnAddToGrid);
            PanelButton.AddButton(enumButton2.XoaLuoi, ref btnDelRowInGrid);
            PanelButton.AddButton(enumButton2.SuaLuoi, ref btnEditRowInGrid);
            PanelButton.AddButton(enumButton2.LuuThayDoiVaoLuoi, ref btnSaveGrid);
            PanelButton.AddButton(enumButton2.HuySuaLuoi, ref btnCancel);

            PanelButton.setButtonStatus(enumButton2.ThemLuoi, true);
            PanelButton.setButtonStatus(enumButton2.XoaLuoi, true);
            PanelButton.setButtonStatus(enumButton2.SuaLuoi, true);
            PanelButton.setButtonStatus(enumButton2.LuuThayDoiVaoLuoi, true);
            PanelButton.setButtonStatus(enumButton2.HuySuaLuoi, true);

            PanelButton.setButtonClickEvent(enumButton2.Dong);
            PanelButton.setButtonClickEvent(enumButton2.Huy);
            PanelButton.setButtonClickEvent(enumButton2.HuySuaLuoi);

            PanelButton.setButtonStatus(enumButton2.Xoa, false);
            PanelButton.setButtonStatus(enumButton2.Sua, true);
            PanelButton.setButtonStatus(enumButton2.LamMoi, false);

            btnXoa.Enabled = false;
            //btnSua.Enabled = false;
            btnLamMoi.Enabled = false;

            PanelButton.ResetButton();
        }