private void btn_AlterContractFrm_Click(object sender, EventArgs e) { if (dgv_HomeIsContracts) { string str_connection = "Data Source = ZEO-PC; Initial Catalog = CarRental; Integrated Security = True"; //string str_connection = "Data Source = MSSQL002; Initial Catalog = CarRental; Integrated Security = True"; SqlConnection con = new SqlConnection(str_connection); string MySelect = "SELECT * " + "FROM [CarRental].[dbo].[Contracts] " + "WHERE contractNo = " + txt_AlterContractContractNo.Text; SqlDataAdapter ada = new SqlDataAdapter(MySelect, con); DataSet ds = new DataSet(); DataTable dt = new DataTable(); ada.Fill(ds, "Contracts"); dt = ds.Tables["Contracts"]; string a = dt.Rows[0]["contractNo"].ToString(); string b = dt.Rows[0]["empNo"].ToString();; string c = dt.Rows[0]["customerNo"].ToString();; string d = dt.Rows[0]["VIN"].ToString();; string ee = dt.Rows[0]["pickupDate"].ToString();; string f = dt.Rows[0]["pickupTime"].ToString();; string g = dt.Rows[0]["returnDate"].ToString();; string h = dt.Rows[0]["returnTime"].ToString();; string i = dt.Rows[0]["discount"].ToString();; string j = dt.Rows[0]["cost"].ToString();; string k = dt.Rows[0]["odoReadingOutbound"].ToString();; string l = dt.Rows[0]["odoReadingInbound"].ToString();; string m = dt.Rows[0]["observationsOut"].ToString();; string n = dt.Rows[0]["observationsIn"].ToString();; Form frm_AlterContract = new frm_AlterContract(a, b, c, d, ee, f, g, h, i, j, k, l, m, n); frm_AlterContract.ShowDialog(); } }
private void btn_alterContract_Click(object sender, EventArgs e) { frm_AlterContract newAlterCustomer = new frm_AlterContract(DGVContract); newAlterCustomer.Show(); }
private void btn_alterAppointment_Click(object sender, EventArgs e) { frm_AlterContract frm_newAlterContract = new frm_AlterContract(currAppointment); frm_newAlterContract.Show(); }