Exemplo n.º 1
0
        private void btnUpdatedNote_Click(object sender, EventArgs e)
        {
            var note = txtNotes.Text;

            _receivingManager = new ReceivingManager();
            VendorOrderManager _vendorOrderManager = new VendorOrderManager();

            vendorOrder = new VendorOrder(Int32.Parse(txtVendorOrderID.Text.ToString()),Int32.Parse(txtVendorID.Text.ToString()));

            VendorOrderLineItem vendorOrderLineItem = new VendorOrderLineItem(Int32.Parse(txtVendorOrderID.Text), Int32.Parse(txtProductID.Text));

            vendorOrderLineItem.Note = note;
            _receivingManager.UpdateLineItemNote(vendorOrderLineItem, note);
            MessageBox.Show("Note added to Order");

            this.Close();
        }
        private void btnAddLineItem_Click(object sender, EventArgs e)
        {
            ReceivingManager _receivingManager = new ReceivingManager();
            VendorOrderManager _vendorOrderManager = new VendorOrderManager();
            VendorOrder vendorOrder;
            Product product;
            Int32 qtyReceived;
            Int32 qtyDamaged;

            Int32 vendorID = Int32.Parse(txtVendorID.Text);
            vendorOrder = new VendorOrder(Int32.Parse(txtVendorOrderID.Text), vendorID);
            int index = cbProductName.SelectedItem.ToString().IndexOf(" ");
            var productID = Int32.Parse(cbProductName.SelectedItem.ToString().Substring(0, index));
            product = new Product(productID);
            qtyReceived = Int32.Parse(upQuantityReceived.Value.ToString());
            qtyDamaged = Int32.Parse(upQtyDamaged.Value.ToString());
            string note = txtNotes.Text;
            _receivingManager.AddNewLineItemToVendorOrder(vendorOrder, product, qtyReceived, note, qtyDamaged);
            MessageBox.Show("Line Item Added");

            this.Close();
        }