Exemplo n.º 1
0
        //Get: UtilityCompany/Delete
        public ActionResult Delete(int id)
        {
            var service        = new UtilityCompanyService();
            var utilityCompany = service.GetUtilityCompany(id);

            return(View(utilityCompany));
        }
Exemplo n.º 2
0
        //Get: Company/Detail/{id}
        public ActionResult Details(int id)
        {
            var service     = new UtilityCompanyService();
            var utilityName = service.GetUtilityCompany(id);

            return(View(utilityName));
        }
Exemplo n.º 3
0
        public ActionResult DeletePost(int id)
        {
            var service = new UtilityCompanyService();

            if (service.DeleteUtilityCompany(id))
            {
                TempData["SaveResult"] = "Utility Company Deleted";
                return(RedirectToAction("Index"));
            }
            ModelState.AddModelError("", "Utility Company could not be updated");
            var model = service.GetUtilityCompany(id);

            return(View(model));
        }
Exemplo n.º 4
0
        //Get: Company/Edit/{id}
        public ActionResult Edit(int id)
        {
            var service = new UtilityCompanyService();
            var detail  = service.GetUtilityCompany(id);
            var model   =
                new UtilityCompanyEdit
            {
                UtilityCompanyId = detail.UtilityCompanyId,
                UtilityName      = detail.UtilityName,
                Website          = detail.Website,
                UserLogin        = detail.UserLogin,
                UserPassword     = detail.UserPassword,
                PhoneNumber      = detail.PhoneNumber
            };

            return(View(model));
        }