public async Task <IActionResult> Edit(int id, [Bind("EmpId,UserId,SocialInsuranceId,Qualfication,Institute,AuthorityLevel,SupervisedBy")] Employee employee) { if (id != employee.EmpId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(employee.EmpId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AuthorityLevel"] = new SelectList(_context.AuthorityLevel, "Id", "Title", employee.AuthorityLevel); ViewData["SupervisedBy"] = new SelectList(_context.Employee, "EmpId", "Institute", employee.SupervisedBy); ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Email", employee.UserId); return(View(employee)); }
public async Task <IActionResult> Edit(int id, [Bind("Disputid,OrederId,ArbiterId,Result,StartDate,FinishDate,Status,TimeToFinish")] Dispute dispute) { if (id != dispute.Disputid) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dispute); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DisputeExists(dispute.Disputid)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ArbiterId"] = new SelectList(_context.Employee, "EmpId", "Institute", dispute.ArbiterId); ViewData["OrederId"] = new SelectList(_context.Order, "OrderId", "OrderId", dispute.OrederId); return(View(dispute)); }
public async Task <IActionResult> Edit(int id, [Bind("ServiceId,UserId,CatId,Desc,Physicalitems,DeliveryTime,Price")] 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["CatId"] = new SelectList(_context.ServiceCategory, "CatId", "CatId", service.CatId); ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Email", service.UserId); return(View(service)); }
public async Task <IActionResult> Edit(int id, [Bind("NatId,Fname,Fathername,Lname,BirthDate,UserType,Status,RatePoints,Phone,Email,GovId,City,Address,Homelocation,Gender")] UserInfo userInfo) { if (id != userInfo.NatId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserInfoExists(userInfo.NatId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GovId"] = new SelectList(_context.Governorate, "GovId", "GovId", userInfo.GovId); ViewData["UserType"] = new SelectList(_context.UserType, "UserTypeId", "UserTypeId", userInfo.UserType); return(View(userInfo)); }
public async Task <IActionResult> Edit(int id, [Bind("ReportId,UserId,Type,EmpId,Files")] Report report) { if (id != report.ReportId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(report); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportExists(report.ReportId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmpId"] = new SelectList(_context.Employee, "EmpId", "Institute", report.EmpId); ViewData["Type"] = new SelectList(_context.ReportTypes, "Id", "Id", report.Type); ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Address", report.UserId); return(View(report)); }
public async Task <IActionResult> Edit(int id, [Bind("OrderId,UserId,ServiceId,ShippmentId,Quantity,OrderStatus,StartDate,FinishDate,CloseCode,RatePoint")] Order order) { if (id != order.OrderId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(order); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(order.OrderId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ServiceId"] = new SelectList(_context.Service, "ServiceId", "Desc", order.ServiceId); ViewData["ShippmentId"] = new SelectList(_context.Shipment, "ShipmentId", "ShipmentId", order.ShippmentId); ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Address", order.UserId); return(View(order)); }