Guest User

Untitled

a guest
Mar 30th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. public ActionResult Post(CpjsProcessFormViewModel viewModel)
  2. {
  3. if (ModelState.IsValid)
  4. {
  5. try
  6. {
  7. if (!string.IsNullOrEmpty(viewModel.UserName) && !string.IsNullOrEmpty(viewModel.Password))
  8. {
  9. _sysproCredentials.UserName = viewModel.UserName;
  10. _sysproCredentials.Password = viewModel.Password;
  11. }
  12.  
  13. var serviceController = new ServiceController(_unitOfWork,
  14. new ControlPlanJobProcessor(_sysproService, _sysproCredentials));
  15. serviceController.ProcessControlPlan(viewModel.ControlPlanId, viewModel.CloseJob, true,
  16. User.Identity.GetUserId()); // <---- ERROR THROWN HERE
  17. }
  18. catch (Exception e)
  19. {
  20. ModelState.AddModelError("", e.Message);
  21. return View(viewModel);
  22. }
  23.  
  24. return RedirectToAction("Index");
  25. }
  26.  
  27. return View(viewModel);
  28. }
Add Comment
Please, Sign In to add comment