private void btnUpdateLineItem_Click(object sender, EventArgs e) { ReceivingManager _receivingManger = new ReceivingManager(); int productId = Int32.Parse(txtLineItemProductID.Text); int vendorOrderId = Int32.Parse(txtLineItemVendorOrderID.Text); //int quantityDamaged = VendorOrderLineItem oldLineItem = new VendorOrderLineItem(vendorOrderId, productId); oldLineItem.QtyReceived = item.QtyReceived; oldLineItem.QtyOrdered = item.QtyOrdered; oldLineItem.QtyDamaged = item.QtyDamaged; updateItem = new VendorOrderLineItem(vendorOrderId, productId); updateItem.Name = txtLineItemProductName.Text; updateItem.QtyDamaged = Int32.Parse(upDownQuantityDamaged.Value.ToString()); updateItem.QtyOrdered = Int32.Parse(txtLineItemQuantityOrdered.Text); updateItem.QtyReceived = Int32.Parse(upDownQuantityReceived.Value.ToString()); _receivingManager = new ReceivingManager(); //_receivingManager.UpdateQtyDamaged(oldLineItem, updateItem); _receivingManager.UpdateQtyReceived(updateItem, oldLineItem); //_receivingManager.UpdateQtyDamaged(updateItem, oldLineItem); MessageBox.Show("Quantity Fields Updated"); this.Close(); }
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(); }