/// <summary> /// Assigns the selected project ids. /// </summary> /// <param name="presenter">The team leaves presenter.</param> private static void AssignSelectedProjectIds(TeamLeavesPresenter presenter) { IList<int> projectIds = new List<int>(); if (string.IsNullOrEmpty(presenter.SelectedProjectIds)) { projectIds = presenter.MasterProjects.Select(item => item.ProjectID).ToList(); } else { projectIds = presenter.SelectedProjectIds.Split(',') .Select(id => Convert.ToInt32(id, CultureInfo.CurrentCulture)) .ToList(); } presenter.AssignSelectedProjectList(projectIds); }
/// <summary> /// Gets the Team Leaves project list. /// </summary> /// <param name="presenter">The team leaves presenter.</param> /// <returns>Project List</returns> public ActionResult GetTeamLeavesProjectList(TeamLeavesPresenter presenter) { if (presenter != null && presenter.MasterProjects != null) { IList<int> projectIds = new List<int>(); projectIds = presenter.MasterProjects.Select(item => item.ProjectID).ToList(); presenter.AssignSelectedProjectList(projectIds); presenter.SelectedProjectIds = string.Join(",", projectIds); } return this.Json(presenter); }