Beispiel #1
0
 public ActionResult Edit(Company company, string picture)
 {
     if (ModelState.IsValid)
     {
         var result = _companiesService.Edit(company, picture);
         return(RedirectToAction("Index", "UserPanel"));
     }
     return(View(company));
 }
        public ActionResult Edit([Bind("ixCompany,sCompany")] CompaniesPost companies)
        {
            if (ModelState.IsValid)
            {
                companies.UserName = User.Identity.Name;
                _companiesService.Edit(companies);
                return(RedirectToAction("Index"));
            }

            return(View(companies));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(Guid id, CreateCompanyViewModel createCompanyViewModel)
        {
            if (ModelState.IsValid)
            {
                if (await _companiesService.Edit(id, createCompanyViewModel) != null)
                {
                    return(RedirectToAction(nameof(Index)));
                }
                ModelState.AddModelError("System", "Failed to edit");
            }

            return(View(createCompanyViewModel));
        }