public ActionResult UpdatePartPrice(Part part, int supplierId)
 {
     if (ModelState.IsValid)
     {
         db.Entry(part).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { supplierId = supplierId }));
     }
     return(View(part));
 }
 public ActionResult Edit(Part part)
 {
     if (ModelState.IsValid)
     {
         db.Entry(part).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(part));
 }
 public ActionResult Edit(Catalog catalog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(catalog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { catalogName = catalog.catalogName }));
     }
     ViewBag.parentCatalog = new SelectList(db.Catalogs.Where(c => c.catalogName != catalog.catalogName), "catalogId", "catalogValue", catalog.parentCatalog);
     return(View(catalog));
 }
Exemple #4
0
 public ActionResult Edit(Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplier).State = System.Data.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idRepresentative = new SelectList(db.Employees, "employeeId", "employeeName", supplier.idRepresentative);
     return(View(supplier));
 }
 public ActionResult Edit(ReplacedPiece replacedpiece)
 {
     if (ModelState.IsValid)
     {
         db.Entry(replacedpiece).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.servicePartId   = new SelectList(db.ServiceParts, "servicePartId", "servicePartDescription", replacedpiece.servicePartId);
     ViewBag.supplierPieceId = new SelectList(db.SupplierPieces, "supplierPieceId", "supplierPieceId", replacedpiece.supplierPieceId);
     ViewBag.statusId        = new SelectList(db.Catalogs, "catalogId", "catalogValue", replacedpiece.statusId);
     return(View(replacedpiece));
 }
 public ActionResult Edit(Service service)
 {
     if (ModelState.IsValid)
     {
         db.Entry(service).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.statusId   = new SelectList(db.Catalogs.Where(cat => cat.catalogName == "Reconstruction Status"), "catalogId", "catalogValue", service.statusId);
     ViewBag.customerId = new SelectList(db.Customers, "customerId", "customerName", service.customerId);
     ViewBag.employeeId = new SelectList(db.Employees, "employeeId", "employeeName", service.employeeId);
     return(View(service));
 }
 public ActionResult Edit(ServicePart servicepart)
 {
     if (ModelState.IsValid)
     {
         db.Entry(servicepart).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.partId    = new SelectList(db.Parts, "partId", "partName", servicepart.partId);
     ViewBag.statusId  = new SelectList(db.Catalogs, "catalogId", "catalogValue", servicepart.statusId);
     ViewBag.serviceId = new SelectList(db.Services, "serviceId", "serviceDescription", servicepart.serviceId);
     return(View(servicepart));
 }
Exemple #8
0
 public ActionResult Edit(ServiceCar servicecar)
 {
     if (ModelState.IsValid)
     {
         db.Entry(servicecar).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.carBrandId = new SelectList(db.Catalogs, "catalogId", "catalogValue", servicecar.carBrandId);
     ViewBag.carModelId = new SelectList(db.Catalogs, "catalogId", "catalogValue", servicecar.carModelId);
     ViewBag.statusId   = new SelectList(db.Catalogs, "catalogId", "catalogValue", servicecar.statusId);
     ViewBag.serviceId  = new SelectList(db.Services, "serviceId", "serviceDescription", servicecar.serviceId);
     return(View(servicecar));
 }
Exemple #9
0
        public ActionResult Edit(Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Entry(customer).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.userLogin = new SelectList(db.UserProfiles.
                                               Where(us => (us.UserName == customer.userLogin) || (!db.Employees.Any(em => em.userLogin == us.UserName) && !db.Customers.Any(cu => cu.userLogin == us.UserName))).
                                               Select(u => u.UserName).Distinct().OrderBy(name => name).ToList(), customer.userLogin);
            return(View(customer));
        }
Exemple #10
0
 public ActionResult Edit(Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.positionId = new SelectList(db.Catalogs.Where(c => c.catalogName == "Employee Position"), "catalogId", "catalogValue", employee.positionId);
     ViewBag.userLogin  = new SelectList(db.UserProfiles.
                                         Where(us => (us.UserName == employee.userLogin) || (!db.Employees.Any(em => em.userLogin == us.UserName) && !db.Customers.Any(cu => cu.userLogin == us.UserName))).
                                         Select(u => u.UserName).Distinct().OrderBy(name => name).ToList(), employee.userLogin);
     return(View(employee));
 }