public frm_cust_add() { InitializeComponent(); label4.Visible = false; txt_custid.Visible = false; db = new BookSellingContext(); }
public frm_order_add() { InitializeComponent(); db = new BookSellingContext(); label4.Visible = false; txt_orderid.Visible = false; }
private void btn_add_Click(object sender, EventArgs e) { try { using (BookSellingContext db = new BookSellingContext()) { Employee emp = new Employee(); emp.FirstName = txt_empname.Text.Trim(); emp.LastName = txt_empsurname.Text.Trim(); emp.Email = txt_empemail.Text.Trim(); emp.Password = txt_empass.Text.Trim(); db.Employee.Add(emp); db.SaveChanges(); MessageBox.Show("Employee Added"); txt_empid.Text = " "; txt_empname.Text = " "; txt_empsurname.Text = " "; txt_empemail.Text = " "; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public frm_emp_add() { InitializeComponent(); label1.Visible = false; txt_empid.Visible = false; db = new BookSellingContext(); }
private void btn_add_Click(object sender, EventArgs e) { try { using (BookSellingContext db = new BookSellingContext()) { Orders ordss = new Orders(); ordss.CustId = Convert.ToInt32(txt_custid.Text); ordss.InvoiceCreationDate = dt_inv.Value; ordss.DeliveryDueDate = dt_delivery.Value; ordss.PaymentDueDate = dt_payment.Value; db.Orders.Add(ordss); db.SaveChanges(); MessageBox.Show("Order Added"); txt_custid.Text = " "; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_add_Click(object sender, EventArgs e) { try { using (BookSellingContext db = new BookSellingContext()) { Customers custs = new Customers(); custs.FirstName = txt_custname.Text.Trim(); custs.LastName = txt_surname.Text.Trim(); custs.Email = txt_custemail.Text.Trim(); db.Customers.Add(custs); db.SaveChanges(); MessageBox.Show("Customer Added"); txt_custname.Text = " "; txt_surname.Text = " "; txt_custemail.Text = " "; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public Frm_login() { InitializeComponent(); db = new BookSellingContext(); }
public Form1() { InitializeComponent(); db = new BookSellingContext(); }