示例#1
0
        private void BindItemMovement()
        {
            item_inventory item_inventory = null;
            app_location   app_location   = null;

            item_inventory = (item_inventory)item_inventoryViewSource.View.CurrentItem;
            app_location   = app_branchapp_locationViewSource.View.CurrentItem as app_location;

            if (app_location != null && item_inventory != null)
            {
                if (item_inventory.item_inventory_detail.Where(x => x.id_location == app_location.id_location).Count() == 0)
                {
                    if (app_location != null)
                    {
                        List <item_product>     item_productLIST = InventoryDB.item_product.Where(x => x.id_company == CurrentSession.Id_Company && x.item.is_active).ToList();
                        Class.StockCalculations Stock            = new Class.StockCalculations();
                        List <Class.StockList>  StockList        = Stock.ByBranchLocation(app_location.id_location, DateTime.Now);

                        foreach (item_product i in item_productLIST)
                        {
                            item_inventory_detail item_inventory_detail = new item_inventory_detail();
                            item_inventory_detail.State           = EntityState.Added;
                            item_inventory_detail.item_product    = i;
                            item_inventory_detail.id_item_product = i.id_item_product;

                            item_inventory_detail.app_location = app_location;
                            item_inventory_detail.id_location  = app_location.id_location;
                            item_inventory_detail.timestamp    = DateTime.Now;

                            if (StockList.Where(x => x.ProductID == i.id_item_product).FirstOrDefault() != null)
                            {
                                item_inventory_detail.value_system = StockList.Where(x => x.ProductID == i.id_item_product).FirstOrDefault().Quantity;
                                item_inventory_detail.unit_value   = StockList.Where(x => x.ProductID == i.id_item_product).FirstOrDefault().Cost;
                            }
                            else
                            {
                                item_inventory_detail.value_system = 0;
                            }

                            if (CurrencyID > 0)
                            {
                                item_inventory_detail.id_currencyfx = CurrencyID;
                            }

                            item_inventory.item_inventory_detail.Add(item_inventory_detail);
                        }
                    }
                }

                item_inventoryitem_inventory_detailViewSource.View.Refresh();
                filetr_detail();
            }
        }
示例#2
0
        public void Fill(object sender, EventArgs e)
        {
            this.reportViewer.Reset();

            Class.StockCalculations Stock = new Class.StockCalculations();
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();

            reportDataSource1.Name  = "TransferSummary"; //Name of the report dataset in our .RDLC file
            reportDataSource1.Value = Stock.TransferSummary(ReportPanel.StartDate, ReportPanel.EndDate, 0, null, null, ReportPanel.ProductID);
            this.reportViewer.LocalReport.DataSources.Add(reportDataSource1);
            this.reportViewer.LocalReport.ReportEmbeddedResource = "Cognitivo.Reporting.Reports.TransferSummary.rdlc";

            this.reportViewer.RefreshReport();
        }
示例#3
0
        private void calc_Inventory()
        {
            app_branch app_branch = (app_branch)dgvBranch.SelectedItem;

            if (app_branch != null && app_branch.id_branch > 0)
            {
                int BranchID = app_branch.id_branch;

                Class.StockCalculations StockCalculations = new Class.StockCalculations();

                inventoryViewSource        = ((CollectionViewSource)(FindResource("inventoryViewSource")));
                inventoryViewSource.Source = StockCalculations.ByBranch(BranchID, InventoryDate);

                TextBox_TextChanged(null, null);
            }
        }