private void button1_Click(object sender, EventArgs e) { MydatabaseDataContext sr = new MydatabaseDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\lenovo\Documents\Visual Studio 2012\Projects\car\car\login.mdf;Integrated Security=True"); Sales_Report s = new Sales_Report(); s.Date = Convert.ToDateTime(textBox1.Text); s.Type_of_Vehicle = textBox2.Text; s.Model = textBox3.Text; s.Custoer_Name = textBox4.Text; s.Customer_Address = richTextBox1.Text; s.Customer_Phone_Number = int.Parse(textBox5.Text); s.Sales_Vlue = int.Parse(textBox6.Text); s.Money_Receipt_Number = textBox7.Text; s.Delivery_Number = textBox8.Text; s.Body_Number = textBox9.Text; s.Engine_Number = textBox10.Text; s.Employee_Id = int.Parse(textBox11.Text); sr.Sales_Reports.InsertOnSubmit(s); sr.SubmitChanges(); dataGridView1.DataSource = sr.Sales_Reports; }
partial void UpdateSales_Report(Sales_Report instance);
partial void DeleteSales_Report(Sales_Report instance);
partial void InsertSales_Report(Sales_Report instance);