public ActionResult Home(ServiceAllocate lstServiceAllocate) { try { if (lstServiceAllocate.AllocateId != null && lstServiceAllocate.AllocateId.Count > 0) { BusinessAccessLayer.BALAllocateCounterService.BALAllocateCounterService bALAllocateCounterService = new BusinessAccessLayer.BALAllocateCounterService.BALAllocateCounterService(); BusinessObjects.Models.ResultsEnum insertedCheck = bALAllocateCounterService.insertAllocateCounterService(lstServiceAllocate.AllocateId, lstServiceAllocate.counterId, ((BusinessObjects.Models.User)Session["UserObj"]).bankId); if (insertedCheck != BusinessObjects.Models.ResultsEnum.inserted) { TempData["errorMsg"] = LangText.somethingWentWrongAlert; } } return(RedirectToAction("Home", new { counterId = lstServiceAllocate.counterId })); } catch (Exception ex) { ExceptionsWriter.saveExceptionToLogFile(ex); return(View("Error")); } }
public ActionResult Home(ServiceAllocate lstServiceAllocate) { try { if (lstServiceAllocate.AllocateId != null && lstServiceAllocate.AllocateId.Count > 0) { BusinessAccessLayer.BALAllocateCounterService.BALAllocateCounterService bALAllocateCounterService = new BusinessAccessLayer.BALAllocateCounterService.BALAllocateCounterService(); ClaimsPrincipal principal = HttpContext.User as ClaimsPrincipal; var bankId = Convert.ToInt32(principal.FindFirst("BankId").Value); BusinessObjects.Models.ResultsEnum insertedCheck = bALAllocateCounterService.insertAllocateCounterService(lstServiceAllocate.AllocateId, lstServiceAllocate.counterId, bankId); if (insertedCheck != BusinessObjects.Models.ResultsEnum.inserted) { TempData["errorMsg"] = LangText.somethingWentWrongAlert; } } return(RedirectToAction("Home", new { counterId = lstServiceAllocate.counterId })); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(View("Error")); } }