Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach (GridViewRow row in GridView1.Rows)
- {
- SqlCommand comm = new SqlCommand("DevStoreProc", conn);
- comm.CommandType = CommandType.StoredProcedure;
- float TotCost = float.Parse(row.Cells[0].Text);
- long invLineId = Convert.ToInt64(row.Cells[2].Text);
- string InvoiceNum = (ddlInvNum.SelectedItem.Text);
- int StockCode = Convert.ToInt32(row.Cells[4].Text);
- float qty = float.Parse(row.Cells[5].Text);
- float QtyOnHand = float.Parse(row.Cells[6].Text);
- DateTime DateSelected = Convert.ToDateTime(row.Cells[7].Text);
- float CurrCost = float.Parse(row.Cells[1].Text);
- float Value = float.Parse(txtValue.Text);
- float Sum = CurrCost + Value;
- comm.Parameters.Add(new SqlParameter("@SupplierName", ddlSupplier.SelectedItem.Text));
- comm.Parameters.Add(new SqlParameter("@SupplierInvoice", ddlInvNum.SelectedItem.Text));
- comm.Parameters.AddWithValue("@StockCode", StockCode);
- comm.Parameters.AddWithValue("@Quantity", qty);
- comm.Parameters.AddWithValue("@QtyOnHand", QtyOnHand);
- comm.Parameters.AddWithValue("@InvoiceNumber", InvoiceNum);
- comm.Parameters.AddWithValue("@InvoiceLines", CurrCost);
- comm.Parameters.AddWithValue("@InvoiceTotal", TotCost);
- comm.Parameters.AddWithValue("@DateSelected", DateSelected);
- comm.Parameters.AddWithValue("@invLineId", invLineId);
- comm.Parameters.AddWithValue("@Value", Value);
- comm.Parameters.AddWithValue("@Sum", Sum);
- comm.ExecuteNonQuery();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement