Ejemplo n.º 1
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(txt_orderid.Text);

            ords = db.Orders.First(p => p.OrderId == id);
            db.Orders.Remove(ords);
            db.SaveChanges();
            MessageBox.Show("Order Deleted");
        }
Ejemplo n.º 2
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(txt_custid.Text);

            custss = db.Customers.First(p => p.CustId == id);
            db.Customers.Remove(custss);
            db.SaveChanges();
            MessageBox.Show("Customer Deleted");
        }
Ejemplo n.º 3
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(txt_empid.Text);

            emps = db.Employee.First(p => p.EmpId == id);
            db.Employee.Remove(emps);
            db.SaveChanges();
            MessageBox.Show("Employee Deleted");
        }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 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);
     }
 }