public async Task <IActionResult> Edit(Guid id, [Bind("CompanyId,CompanyName,CompanyLogo,CompanyDescription,CompanyPhone,CompanyEmail,CompanyAddress,CompanyIsDelete")] Company company) { if (id != company.CompanyId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(company); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(company.CompanyId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ServiceId,ServiceName,ServiceImage,ServicePrice,ServiceDescription,ServiceCharge,ServiceIsDelete,EmployeeEmployeeId,ServiceTypeServiceTypeId,CompanyCompanyId")] Service service) { if (id != service.ServiceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(service); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ServiceExists(service.ServiceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CompanyCompanyId"] = new SelectList(_context.Company, "CompanyId", "CompanyId", service.CompanyCompanyId); ViewData["EmployeeEmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "EmployeeId", service.EmployeeEmployeeId); ViewData["ServiceTypeServiceTypeId"] = new SelectList(_context.ServiceType, "ServiceTypeId", "ServiceTypeId", service.ServiceTypeServiceTypeId); return(View(service)); }
public async Task <IActionResult> Edit(Guid id, [Bind("EmployeeId,DepartmentId,EmployeeFirtName,EmployeeLastName,EmployeeGender,EmployeeDateOfBirth,EmployeeAddress,EmployeePhoneNumber,EmployeeEmail,EmployeeAvatar,EmployeeIsDelete")] Employee employee) { if (id != employee.EmployeeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(employee.EmployeeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(employee)); }