public bool AddItem(string ShipName) { if (ShipperExist(ShipName)) { return false; } else { Shippers s = new Shippers(ShipName); sList.Add(s); return true; } }
public static Shippers PopulateShippersFromSqlDataReader(SqlDataReader dr) { Shippers shippers = new Shippers(); shippers.ID = Convert.ToInt32(dr["ID"]); shippers.Shipper = Convert.ToString(dr["Shipper"]); shippers.Phone = Convert.ToString(dr["Phone"]); shippers.Fax = Convert.ToString(dr["Fax"]); shippers.Comments = Convert.ToString(dr["Comments"]); shippers.Cell = Convert.ToString(dr["Cell"]); shippers.Other = Convert.ToString(dr["Other"]); return shippers; }
public void AddShippers(Shippers Shippers) { // Initialize SPROC SqlConnection conn = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand("SPShippersInsert", conn); cmd.CommandType = CommandType.StoredProcedure; // Add Parameters cmd.Parameters.AddWithValue("@ID", 0); cmd.Parameters.AddWithValue("@Shipper", Shippers.Shipper); cmd.Parameters.AddWithValue("@Phone", Shippers.Phone); cmd.Parameters.AddWithValue("@Fax", Shippers.Fax); cmd.Parameters.AddWithValue("@Comments", Shippers.Comments); cmd.Parameters.AddWithValue("@Cell", Shippers.Cell); cmd.Parameters.AddWithValue("@Other", Shippers.Other); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); reload(); }
private void Object2Form(Shippers s) { int Index = comboBox1.FindString(s.Shipper); comboBox1.SelectedIndex = Index; textBox1.Text = s.Comments; textBox2.Text = s.Phone; textBox3.Text = s.Fax; textBox4.Text = s.Cell; textBox5.Text = s.Other; }
private Shippers Form2Object() { Shippers tship = new Shippers(0, comboBox1.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text); return tship; }
public Shippers SearchShipper(string ShipperName) { foreach (Shippers Ship in sList) { if (Ship.Shipper == ShipperName) { return Ship; } } Shippers s = new Shippers(ShipperName); return (s); }
private void UpdatePOShip(int QTS,int ONH) { string DataGrid_PO = ""; string DataGrid_POStat; int DataGrid_Inv = 0; int DataGrid_OnHand = 0; int DataGrid_ShipQuan = 0; int totalavqty = 0; int POID = 0; Shippers shipr = new Shippers(); CustBillShip bill = new CustBillShip(); CustBillShip ship = new CustBillShip(); /* item.Cells[0].Value = po.PoNumber; item.Cells[1].Value = po.ReceiveDate; item.Cells[2].Value = po.InitialQty; item.Cells[3].Value = po.FabRejectQty; item.Cells[4].Value = po.PaintRejectQty; item.Cells[5].Value = po.InventoryQty; item.Cells[6].Value = po.ShippedQty; item.Cells[7].Value = po.Status; item.Cells[8].Value = po.Id; */ int j = 0; while (j < InvPOGrid.RowCount) { if (QTS != 0) { POID = int.Parse(InvPOGrid.Rows[j].Cells[8].Value.ToString()); DataGrid_POStat = InvPOGrid.Rows[j].Cells[7].Value.ToString(); DataGrid_PO = InvPOGrid.Rows[j].Cells[0].Value.ToString(); DataGrid_Inv = int.Parse(InvPOGrid.Rows[j].Cells[5].Value.ToString()); DataGrid_OnHand = int.Parse(InvPOGrid.Rows[j].Cells[9].Value.ToString()); DataGrid_ShipQuan = int.Parse(InvPOGrid.Rows[j].Cells[6].Value.ToString()); if (DataGrid_Inv <= QTS) { DataGrid_ShipQuan = DataGrid_ShipQuan + DataGrid_Inv; QTS = QTS - DataGrid_Inv; DataGrid_Inv = 0; DataGrid_OnHand = DataGrid_OnHand - DataGrid_ShipQuan; if (DataGrid_POStat != "OPEN_INV") { DataGrid_POStat = "SHIPPED"; } } else { DataGrid_ShipQuan = DataGrid_ShipQuan + QTS; DataGrid_Inv = DataGrid_Inv - QTS; DataGrid_OnHand = DataGrid_OnHand - QTS; QTS = 0; } int CustID; Customer TCust = CustList.SearchCustomer(CustCombo.Text); CustID = TCust.ID; BillShipList BSList; BSList = new BillShipList(TCust.ID); InvPOGrid.Rows[j].Cells[6].Value = DataGrid_ShipQuan.ToString(); InvPOGrid.Rows[j].Cells[5].Value = DataGrid_Inv.ToString(); string RcvDate = InvPOGrid.Rows[j].Cells[1].Value.ToString(); shipr = Shippers.SearchShipper(ShipViaCombo.Text); bill = BSList.SearchBillShip(BillToCombo.Text, "Billing"); ship = BSList.SearchBillShip(BillToCombo.Text, "Shipping"); if (bill.AddressName == "") { bill.ID = 0; } if (ship.AddressName == "") { ship.ID = 0; } if (bill.ID == 0) { bill.ID = ship.ID; } if (ship.ID == 0) { ship.ID = bill.ID; } shipList.ShipPO(DataGrid_PO, CustID, PartCombo.Text, RcvDate, TrackingTB.Text, shipComment, DataGrid_ShipQuan, ship.ID, DataGrid_Inv, DataGrid_OnHand, DataGrid_POStat,bill.ID); shipList.CreateShipmentRecord(CustID, PartCombo.Text, DataGrid_ShipQuan, POID, TrackingTB.Text, ship.ID, bill.ID, shipr.ID); //Update Database } j++; totalavqty = totalavqty + DataGrid_Inv; } }