Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Post(CpjsProcessFormViewModel viewModel)
- {
- if (ModelState.IsValid)
- {
- try
- {
- if (!string.IsNullOrEmpty(viewModel.UserName) && !string.IsNullOrEmpty(viewModel.Password))
- {
- _sysproCredentials.UserName = viewModel.UserName;
- _sysproCredentials.Password = viewModel.Password;
- }
- var serviceController = new ServiceController(_unitOfWork,
- new ControlPlanJobProcessor(_sysproService, _sysproCredentials));
- serviceController.ProcessControlPlan(viewModel.ControlPlanId, viewModel.CloseJob, true,
- User.Identity.GetUserId()); // <---- ERROR THROWN HERE
- }
- catch (Exception e)
- {
- ModelState.AddModelError("", e.Message);
- return View(viewModel);
- }
- return RedirectToAction("Index");
- }
- return View(viewModel);
- }
Add Comment
Please, Sign In to add comment