Exemple #1
0
        //item to stock
        private void button5_Click(object sender, EventArgs e)
        {
            MovementForm move = new MovementForm();

            move.SetItems(bases[comboBox1.SelectedIndex].Items);

            move.AddedItemsToStock = (x, y) => {
                foreach (var item in y)
                {
                    Stock.GlobalStock.AddItem(item);
                    x.Where(k => k.ItemCode == item.ItemCode).First().Quantity -= item.Quantity;
                }

                dataGridView2.DataSource = new List <StockItem>();
                dataGridView2.Refresh();

                if (Stock.GlobalStock.AvailableItems.Count > 0)
                {
                    dataGridView2.DataSource = Stock.GlobalStock.AvailableItems;
                    dataGridView2.Refresh();
                }



                //MoveToStockDocument document = new MoveToStockDocument();

                //foreach(var item in y)
                //{
                //    document.AddItemMovement(item, bases[comboBox1.SelectedIndex].Name);
                //}
                //document.SaveDocument();
            };

            move.Show();
        }
Exemple #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            MovementForm move = new MovementForm();

            move.Text = "Move from Stock to " + comboBox2.SelectedValue;

            move.SetItems(Stock.GlobalStock.AvailableItems);

            move.AddedItemsToStock = (x, y) =>
            {
                foreach (var item in y)
                {
                    points[comboBox2.SelectedIndex].Items.Add(item);
                    x.Where(k => k.ItemCode == item.ItemCode).First().Quantity -= item.Quantity;
                }

                UpdatePoints();
            };

            move.Show();
        }