Example #1
0
        public ActionResult CreateConfirmed(Employee emp)
        {
            if (ModelState.IsValid)
            {
                db.Employees.Add(emp);
                db.SaveChanges();
                return(RedirectToAction("Details", new { id = emp.PersonnelNumber }));
            }

            return(RedirectToAction("Table"));
        }
Example #2
0
 public ActionResult CreateConfirmed(MoneyReceipt receipt)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.MoneyReceipts.Add(receipt);
             db.SaveChanges();
             return(RedirectToAction("Details", new { id = receipt.ReceiptID }));
         }
         return(View("Error"));
     }
     catch (Exception)
     { return(View("Error")); }
 }
Example #3
0
 public ActionResult CreateConfirmed(CustomerEnt customer)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.CustomerEnts.Add(customer);
             db.SaveChanges();
             return(RedirectToAction("Details", new { id = customer.ClientID }));
         }
         return(View("Error"));
     }
     catch (Exception)
     { return(View("Error")); }
 }
Example #4
0
 public ActionResult Create(Order order)
 {
     try
     {
         //if (ModelState.IsValid)
         //{
         db.Orders.Add(order);
         db.SaveChanges();
         return(RedirectToAction("Details", new { id = order.OrderID }));
         //}
         //return View("Error");
     }
     catch (Exception)
     { return(View("Error")); }
 }
Example #5
0
        public ActionResult CreateConfirmed(Product product)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Products.Add(product);
                    db.SaveChanges();
                    return(RedirectToAction("Details", new { id = product.ProductID }));
                }
                return(View("Error"));
            }
            catch (Exception)

            { return(View("Error")); }
        }
Example #6
0
        public ActionResult CreateConfirmed(Supplier supplier)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    supplier.AddtoTable(db, supplier);

                    db.SaveChanges();
                    return(RedirectToAction("Details", new { id = supplier.SupplierPAN }));
                }
                return(View("Error"));
            }
            catch (Exception)
            { return(View("Error")); }
        }