コード例 #1
0
        //load
        private void Load_KhoCoSan_GridView(DateTime FromDate, DateTime ToDate)
        {
            WareHouseController controller = new WareHouseController();

            KhoCoSanData = controller.KhoCoSanSelect(FromDate, ToDate, CommonInfo.CompanyInfo.CompanyID);
            KhoCoSan_gridControl.DataSource = new BindingList <WareHouse>(KhoCoSanData);
        }
コード例 #2
0
        private void LuuSapXepChungTu()
        {
            WareHouseController controller = new WareHouseController();

            if (!controller.SapXepWarehouseFinal(Nam_bsDateEdit.DateTime.Date.Year.ToString()))
            {
                //Sắp xếp thất bại
                MessageBox.Show("Lưu sắp xếp kho thất bại!", "Sắp xếp kho", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MessageBox.Show("Lưu dữ liệu thành công!", "Sắp xếp kho", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #3
0
        private void SapXepKho()
        {
            WareHouseController controller = new WareHouseController();

            if (!controller.SapXepWarehouse(Nam_bsDateEdit.DateTime.Date.Year.ToString()))
            {
                //Sắp xếp thất bại
                MessageBox.Show("Sắp xếp kho thất bại!", "Sắp xếp kho", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                //Sắp xếp thành công thì load data lên
                List <WarehouseSapXepLaiNo> WarehouseData = controller.GetWarehouseSapXep(Nam_bsDateEdit.DateTime.Date.Year.ToString());
                WarehouseSapXepgridControl.DataSource = WarehouseData;
            }
        }
コード例 #4
0
        private void LoadGridData()
        {
            //Chưa load dữ liệu xong thì không được vào focused Row changed
            IsWarehouseSourceChanged = false;

            using (WareHouseController controller = new WareHouseController())
            {
                WareHouseDetailData = new List <WareHouseInOut>(controller.WareHouseSelectFullView(Date_FromToDateEdit.FromDate.Date, Date_FromToDateEdit.ToDate.Date));

                ExcelWareHouse_gridControl.DataSource = WareHouseDetailData;

                WareHouseData = WareHouseDetailData
                                //.GroupBy(x => new { x.VouchersTypeID, x.VoucherNo, x.WarehouseType, x.VoucherDate, x.WarehouseID, x.WarehouseNo })
                                //.GroupBy(x => new { x.WarehouseListID, x.VoucherDate.Year, x.WarehouseType, x.WarehouseNo})
                                .GroupBy(x => new { x.WarehouseID })
                                .Select(x => new WareHouseInOut()
                {
                    WarehouseID          = x.First().WarehouseID,
                    WarehouseType        = x.First().WarehouseType,
                    WarehouseNo          = x.First().WarehouseNo,
                    WarehouseListID      = x.First().WarehouseListID,
                    VoucherDate          = x.First().VoucherDate,
                    VouchersTypeID       = x.First().VouchersTypeID,
                    VoucherNo            = x.First().VoucherNo,
                    DebitAccountID       = x.First().DebitAccountID,
                    CreditAccountID      = x.First().CreditAccountID,
                    WarehouseDescription = x.First().WarehouseDescription,
                    WarehouseListName    = x.First().WarehouseListName
                })
                                .OrderBy(o => o.WarehouseListID)
                                .ThenBy(o => o.VoucherDate.Year)
                                .ThenBy(o => o.WarehouseType)
                                .ThenBy(o => o.WarehouseNo)
                                .ToList();

                WareHouse_GridControl.DataSource       = WareHouseData;
                WareHouseDetail_GridControl.DataSource = WareHouseDetailData;
                IsWarehouseSourceChanged = true;

                WareHouse_GridView.OptionsSelection.CheckBoxSelectorField = "IsSelected";

                //Load dữ liệu xong thì vào focused Row changed
                WareHouseFull_gridView_FocusedRowChanged(null, null);
            };
        }
コード例 #5
0
        // the incoming prouct is use i wareHouse Controller as a description of what the customor wants,
        public List <List <Product> > GetProdukts(List <Product> Wantedproducts)
        {
            List <List <Product> > ProduktsList = new List <List <Product> >();

            if (Wantedproducts.Count != 0)
            {
                Product             newProduct  = new Product();
                List <Product>      ProduktList = new List <Product>();
                WareHouseController WHC         = GetWarhousecontroller();
                //this is for testing
                if (Wantedproducts[0].Name == "This is a Test a Test")
                {
                    for (int i = 0; i < 5; i++)
                    {
                        ProduktList = new List <Product>();
                        for (int e = 0; e < 5; e++)
                        {
                            newProduct          = new Product();
                            newProduct.ID       = e;
                            newProduct.Name     = "Name" + i;
                            newProduct.Quantity = (i + 1) * (1 + e);
                            ProduktList.Add(newProduct);
                        }
                        ProduktsList.Add(ProduktList);
                    }
                }
                else
                {
                    foreach (var wantedproduct in Wantedproducts)
                    {
                        //  WHC´'
                        //here we send the wantedproduct, and gets a return from the warehouse, with is a list<Product>,
                        //these are from the difrent warehouse. there combiende quantaty == wantedproduct, if not there were not enouth on shells
                    }
                    //Get WareHouse Controller and use FindProduct(product)
                }
            }
            return(ProduktsList);
        }
コード例 #6
0
        private WareHouseController GetWarhousecontroller()
        {
            WareHouseController WHC = new WareHouseController();

            return(WHC);
        }