private void AddRow(int i) { cap = new CommandAndParams("ADD_Deal"); cap.AddParam("@ContractorID", dealInterrop.ContrID); cap.AddParam("@DealOID", dealInterrop.DealNumber); cap.AddParam("@DealDate", dealInterrop.DealDate); cap.AddParam("@DealName", dealInterrop.DealName); cap.AddParam("@DealDueDay", dealInterrop.DueDate); gridMain.Rows[i].Cells[0].Value = cap.ExecuteScalar(); cap.CloseConnection(); cap = null; }
private void RemoveRow() { cap = new CommandAndParams("DEL_Deal"); cap.AddParam("@DealID", gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[0].Value); var result = cap.ExecuteNonQuery(); cap.CloseConnection(); cap = null; }
private void RemoveRowMain(int i) { cap = new CommandAndParams("DEL_Sales_Main"); cap.AddParam("@SalesID", gridMain.Rows[i].Cells[0].Value); var result = cap.ExecuteNonQuery(); cap.CloseConnection(); cap = null; }
private void AddRowMain(int i) { cap = new CommandAndParams("ADD_Sales_Main"); cap.AddParam("@ContractorID", sales.ContrID); cap.AddParam("@DealID", sales.DealID); cap.AddParam("@SalesNum", sales.SalesNum); cap.AddParam("@SalesDate", sales.SalesDate); cap.AddParam("@VAT", sales.VAT); cap.AddParam("@SalesSum", sales.SalesSum); cap.AddParam("@SalesBaseSum", sales.SalesBaseSum); cap.AddParam("@SalesTrialSum", sales.SalesTrialSum); gridMain.Rows[i].Cells[0].Value = cap.ExecuteScalar(); cap.CloseConnection(); cap = null; }
private void UpdateRowMain() { cap = new CommandAndParams("UPD_Sales_Main"); cap.AddParam("@SalesID", sales.SalesID); cap.AddParam("@SalesNum", sales.SalesNum); cap.AddParam("@SalesDate", sales.SalesDate); cap.AddParam("@VAT", sales.VAT); cap.AddParam("@SalesSum", sales.SalesSum); cap.AddParam("@SalesBaseSum", sales.SalesBaseSum); cap.AddParam("@SalesTrialSum", sales.SalesTrialSum); var result = cap.ExecuteNonQuery(); cap.CloseConnection(); cap = null; }
private void UpdateRow() { cap = new CommandAndParams("UPD_Deal"); cap.AddParam("@ContractorID", dealInterrop.ContrID); cap.AddParam("@DealOID", dealInterrop.DealNumber); cap.AddParam("@DealDate", dealInterrop.DealDate); cap.AddParam("@DealName", dealInterrop.DealName); cap.AddParam("@DealDueDay", dealInterrop.DueDate); cap.AddParam("@DealID", Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[0].Value)); var result = cap.ExecuteNonQuery(); cap.CloseConnection(); cap = null; }
public void GetRowsMainByID(int DealID) { // выбирает акты только по ид договора cap = new CommandAndParams("SEL_Sales_Main_Check"); cap.AddParam("@DealID", DealID); var reader = cap.ExecuteReader(); if (reader.HasRows) { int i = 0; while (reader.Read()) { gridMain.Rows.Add(); gridMain.Rows[i].Cells[0].Value = Convert.ToInt32(reader.GetValue(0)); gridMain.Rows[i].Cells[1].Value = Convert.ToInt32(reader.GetValue(1)); gridMain.Rows[i].Cells[2].Value = Convert.ToInt32(reader.GetValue(2)); gridMain.Rows[i].Cells[3].Value = Convert.ToInt32(reader.GetValue(3)); gridMain.Rows[i].Cells[4].Value = Convert.ToString(reader.GetValue(4)); gridMain.Rows[i].Cells[5].Value = Convert.ToString(reader.GetValue(5)); gridMain.Rows[i].Cells[6].Value = Convert.ToDateTime(reader.GetValue(6)); gridMain.Rows[i].Cells[7].Value = Convert.ToString(reader.GetValue(7)); gridMain.Rows[i].Cells[8].Value = Convert.ToDateTime(reader.GetValue(8)); gridMain.Rows[i].Cells[9].Value = Convert.ToDecimal(reader.GetValue(9)); gridMain.Rows[i].Cells[10].Value = Convert.ToDecimal(reader.GetValue(10)); gridMain.Rows[i].Cells[11].Value = Convert.ToDecimal(reader.GetValue(11)); i += 1; } } reader.Close(); cap.CloseConnection(); cap = null; }