예제 #1
0
        public IActionResult MyTasks(string filterValues, bool deleteFilter, string view, int pageIndex = 1, int pageSize = 15)
        {
            try
            {
                var filters = GetFilters(filterValues, deleteFilter);

                if (!string.IsNullOrEmpty(view))
                {
                    SetSessionVariable("view", view);
                }
                else
                {
                    view = GetSessionVariable("view");
                }

                if (ApplicationUserCurrent.UserId == null)
                {
                    ApplicationUserCurrent.UserId    = Convert.ToString(Global.UserID);
                    ApplicationUserCurrent.AccountId = Global.AccountId;
                    ApplicationUserCurrent.ProfileId = Global.ProfileId;
                    ApplicationUserCurrent.PersonId  = Global.PersonId;
                }
                var model = _taskCampaignBusiness.GetTasksPerCampaign(Guid.Parse(ApplicationUserCurrent.UserId), pageIndex, pageSize, filters, ApplicationUserCurrent.AccountId);

                if (view == "list")
                {
                    return(View("~/Views/Task/TaskList.cshtml", model));
                }

                return(View(model));
            }
            catch (Exception e)
            {
                _logger.LogError(new EventId(0, "Error Index"), e.Message);
                return(RedirectToAction("Index", "StatusCode", new { statusCode = e.Message }));
            }
        }