private InventoryOrderItem buildItem() { InventoryOrderItem Item = new InventoryOrderItem(); Item.description = descriptiontxt.Text; Item.quantity = quantitytxt.Text; Item.unit = (string)unittxt.SelectedItem; Item.unit_price = ParseFloat(unitpricetxt.Text); Item.total = ParseFloat(itemtotaltxt.Text); Item.designation = designationcmb.Text; Item.category = "Flat Sheets"; Item.status = statuscmb.Text; Item.material = materialcmb.Text; Item.gauge = gaugecmb.Text; Item.color = colorcmb.Text; Item.width = ParseFloat(widthtxt.Text); Item.height = ParseFloat(heighttxt.Text); Item.size_unit = sizeunitcmb.Text; Item.isMaterial = true; return(Item); }
public PurchaseOrderItem() { for (int i = 0; i < 16; i++) { orderItem[i] = new InventoryOrderItem(); } }
private InventoryOrderItem buildItem() { InventoryOrderItem Item = new InventoryOrderItem(); Item.description = descriptiontxt.Text; Item.quantity = quantitytxt.Text; Item.unit = unittxt.Text; Item.unit_price = ParseFloat(unitpricetxt.Text); Item.total = ParseFloat(itemtotaltxt.Text); Item.designation = designationcmb.Text; Item.category = categorycmb.Text; Item.status = statuscmb.Text; Item.material = "-"; Item.gauge = "-"; Item.color = "-"; Item.width = 0; Item.height = 0; Item.size_unit = "-"; Item.isMaterial = false; return(Item); }
public void SetParent(Form_Main p, int i, InventoryOrderItem ioi) { this.mParentForm = p; this.mIndex = i; this.mParentForm.Hide(); descriptiontxt.Text = ioi.description; quantitytxt.Text = ioi.quantity; //unittxt.Text = item.unit; unitpricetxt.Text = ioi.unit_price.ToString(); itemtotaltxt.Text = ioi.total.ToString(); designationcmb.SelectedItem = ioi.designation; categorycmb.SelectedItem = ioi.category; statuscmb.SelectedItem = ioi.status; }
public void SetParent(Form_Main p, int i, InventoryOrderItem ioi) { this.mParentForm = p; this.mIndex = i; this.mParentForm.Hide(); descriptiontxt.Text = ioi.description; quantitytxt.Text = ioi.quantity; unittxt.Text = ioi.unit; unitpricetxt.Text = ioi.unit_price.ToString(); itemtotaltxt.Text = ioi.total.ToString(); designationcmb.SelectedItem = ioi.designation; statuscmb.SelectedItem = ioi.status; materialcmb.SelectedText = ioi.material; gaugecmb.SelectedItem = ioi.gauge; colorcmb.SelectedItem = ioi.color; widthtxt.Text = ioi.width.ToString(); heighttxt.Text = ioi.height.ToString(); sizeunitcmb.SelectedItem = ioi.size_unit; }
public void ReturnItem(InventoryOrderItem ioi, int index) { if (index < 0) { // item is new mOrderItems.Add(ioi); } else { // item is existing mOrderItems[index] = ioi; } orderitemlist.Items.Clear(); for (int i = 0; i < mOrderItems.Count; i++) { string price = "$" + mOrderItems[i].total; int steps = 15 - price.Length; string str = price; for (int j = 0; j < steps; j++) { str += " "; } string qty = mOrderItems[i].quantity; steps = 10 - qty.Length; str += qty; for (int k = 0; k < steps; k++) { str += " "; } str += mOrderItems[i].description; orderitemlist.Items.Add(str); // orderitemlist.Items.Add(mOrderItems[i].description); } calctotal(); }
private void SubmitMaterialItem(InventoryOrderItem ioi, POInformation p) { string queue = BuildQueue.buildQueueMaterial(ioi, p); mPurchasers = new List <Purchaser>(); try { var command = new OleDbCommand(); command.Connection = connection; command.CommandText = queue; connection.Open(); command.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Error Submitting Material Item. " + ex); } finally { connection.Close(); } }
public static string buildQueueMaterial(InventoryOrderItem i, POInformation p) { string QA, QB; QA = "INSERT INTO MaterialInventory ("; QB = "VALUES('"; QA = QA + "PO_NUMBER,"; QB = QB + p.OrderNumber + "','"; QA = QA + "ORDER_BY,"; QB = QB + p.Purchaser + "','"; QA = QA + "DATE_ORDERED,"; QB = QB + p.OrderDate + "','"; QA = QA + "PROJECT,"; QB = QB + p.ProjectName + "','"; QA = QA + "JOB_NUMBER,"; QB = QB + p.JobNumber + "','"; QA = QA + "VENDOR,"; QB = QB + p.Vendor + "','"; QA = QA + "GAUGE,"; QB = QB + i.gauge + "','"; QA = QA + "DESCRIPTION,"; QB = QB + i.description + "','"; QA = QA + "SHEET_SIZE,"; QB = QB + i.width.ToString() + " x " + i.height.ToString() + " " + i.size_unit + "','"; QA = QA + "MATERIAL,"; QB = QB + i.material + "','"; QA = QA + "ETA,"; QB = QB + p.DeliveryDate + "','"; QA = QA + "ATA,"; QB = QB + "1900-01-01" + "','"; //------------------------------------------------------------ QA = QA + "QUANTITY,"; QB = QB + i.quantity + "','"; QA = QA + "INVENTORY_QUANTITY,"; QB = QB + "-" + "','"; QA = QA + "UNIT_COST,"; QB = QB + i.unit_price + "','"; QA = QA + "UNIT,"; QB = QB + "-" + "','"; //ioi.unit + "','"; QA = QA + "TOTAL,"; QB = QB + i.total + "','"; QA = QA + "COLOR,"; QB = QB + i.color + "','"; QA = QA + "MATERIAL_ITEM,"; //category; QB = QB + i.category + "','"; QA = QA + "STOCK_ITEM,"; //designation; QB = QB + i.designation + "','"; QA = QA + "STATUS"; QB = QB + i.status; QA = QA + ")"; QB = QB + "')"; //QB.Replace("''", "'-'"); return(QA + " " + QB); }
public List <InventoryOrderItem> GetMaterialItems(string p) { List <InventoryOrderItem> ioi = new List <InventoryOrderItem>(); connection.Open(); var command = new OleDbCommand(); command.Connection = connection; command.CommandText = "select * from MaterialInventory"; var reader = command.ExecuteReader(); try { while (reader.Read()) { var ponum = reader.GetString(1); if (ponum == p) { InventoryOrderItem i = new InventoryOrderItem(); // ID // PO NUMBER // PURCHASER // DATE // PROJECT // JOB NUMBER // VENDOR i.gauge = reader.GetString(7); // GAUGE i.description = reader.GetString(8); // DESCRIPTION i.sheetsize = reader.GetString(9); // SHEET SIZE i.material = reader.GetString(10); // MATERIAL i.deliveryDate = reader.GetDateTime(11).ToShortDateString(); // ETA // ATA i.quantity = reader.GetString(13); // QUANTITY // INVENTORY QUANTITY var decunit = reader.GetDecimal(15); // -> i.unit_price = reader.GetFloat(15); // UNIT COST i.unit_price = (float)decunit; i.unit = reader.GetString(16); // UNIT var dectotal = reader.GetDecimal(17); // -> i.total = reader.GetFloat(17); // TOTAL i.total = (float)dectotal; i.color = reader.GetString(18); // COLOR i.category = reader.GetString(19); // MATERIAL ITEM i.designation = reader.GetString(20); // STOCK ITEM i.status = reader.GetString(21); // STATUS if (i.category == "Flat Sheets") { i.isMaterial = true; } else { i.isMaterial = false; } ioi.Add(i); } } } catch (Exception e) { Console.WriteLine("error" + e); } finally { reader.Close(); connection.Close(); } return(ioi); }