示例#1
0
 // GET: ClientUsers/Delete/5
 public ActionResult Delete(int id, bool?saveChangesError)
 {
     if (saveChangesError.GetValueOrDefault())
     {
         ViewBag.ErrorMessage = "Unable to save changes. Try again, and if the problem persists see your system administrator.";
     }
     return(View(CompanyCustomerMethods.GetItem(id)));
 }
示例#2
0
        // GET: CompanyCustomers/Edit/5
        public ActionResult Edit(int id)
        {
            CompanyCustomer companyCustomer = CompanyCustomerMethods.GetItem(id);

            if (companyCustomer == null)
            {
                return(HttpNotFound());
            }
            return(View(companyCustomer));
        }
示例#3
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         CompanyCustomerMethods.DeleteItem(id);
     }
     catch (DataException)
     {
         return(RedirectToAction("Delete",
                                 new System.Web.Routing.RouteValueDictionary {
             { "id", id },
             { "saveChangesError", true }
         }));
     }
     return(RedirectToAction("Index"));
 }
示例#4
0
 public ActionResult Edit(CompanyCustomer company)
 {
     try
     {
         if (ModelState.IsValid)
         {
             CompanyCustomerMethods.ChangeItem(company);
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException)
     {
         //Log the error (add a variable name after DataException)
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     return(View(company));
 }
示例#5
0
 // GET: CompanyCustomers
 public ActionResult Index()
 {
     return(View(CompanyCustomerMethods.Outpoot().ToList()));
 }