public IActionResult Register(TaskRegisterViewModel model, string returnUrl = null) { try { if (!ModelState.IsValid) { GetMerchants(); return(View(model)); } _taskCampaignBusiness.Save(model, ApplicationUserCurrent.AccountId); if (!string.IsNullOrEmpty(model.ReturnUrl)) { return(Redirect(model.ReturnUrl)); } return(RedirectToAction("Index")); } catch (Exception e) { _logger.LogError(new EventId(0, "Error Index"), e.Message); return(RedirectToAction("Index", "StatusCode", new { statusCode = 1 })); } }