Beispiel #1
0
 public ActionResult Edit([Bind(Include = "ReplacementPartID,Name,Price")] ReplacementPart replacementPart)
 {
     if (ModelState.IsValid)
     {
         db.Entry(replacementPart).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(replacementPart));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "PaymentMethodID,Name,Description")] PaymentMethod paymentMethod)
 {
     if (ModelState.IsValid)
     {
         db.Entry(paymentMethod).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(paymentMethod));
 }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "PositionID,Name,Salary")] Position position)
 {
     if (ModelState.IsValid)
     {
         db.Entry(position).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(position));
 }
 public ActionResult Edit([Bind(Include = "RepairID,Name,Description,Price")] Repair repair)
 {
     if (ModelState.IsValid)
     {
         db.Entry(repair).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(repair));
 }
 public ActionResult Edit([Bind(Include = "CustomerID,Name,Address,Phone")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Beispiel #6
0
 public ActionResult Edit([Bind(Include = "EmployeeID,PositionID,Name,AppointmentDate,Address,Phone")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PositionID = new SelectList(db.Positions, "PositionID", "Name", employee.PositionID);
     return(View(employee));
 }
Beispiel #7
0
 public ActionResult Edit([Bind(Include = "ServiceID,RepairID,EmployeeID")] Service service)
 {
     if (ModelState.IsValid)
     {
         db.Entry(service).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.Employees, "EmployeeID", "Name", service.EmployeeID);
     ViewBag.RepairID   = new SelectList(db.Repairs, "RepairID", "Name", service.RepairID);
     return(View(service));
 }
Beispiel #8
0
 public ActionResult Edit([Bind(Include = "InvoiceID,CustomerID,PaymentMethodsID,Date")] Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID       = new SelectList(db.Customers, "CustomerID", "Name", invoice.CustomerID);
     ViewBag.PaymentMethodsID = new SelectList(db.PaymentMethods, "PaymentMethodID", "Name", invoice.PaymentMethodsID);
     return(View(invoice));
 }