public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string codeName = "", string codeName2 = "") { IEnumerable <goal> GoalList; ViewBag.BeginDate = bDate; ViewBag.EndDate = eDate; if (SearchType == "MinistrySearch") { GoalList = GoalRepository.GetGoalByMinistry(codeID); } else if (SearchType == "StatusSearch") { GoalList = GoalRepository.GetGoalByStatus(codeName); } else if (SearchType == "Begin Date Search") { GoalList = GoalRepository.GetGoalBeginning(bDate, eDate); } else if (SearchType == "End Date Search") { GoalList = GoalRepository.GetGoalEnding(bDate, eDate); } else if (SearchType == "CompletionRatioSearch") { GoalList = GoalRepository.GetGoalByCompletionRatio(codeName); } else { GoalList = GoalRepository.GetGoalByDateRange(bDate, eDate); } ViewBag.RecordCount = GoalList.Count(); foreach (goal g in GoalList) { g.ministry = MinistryRepository.GetMinistryByID(g.ministryID); } //security ViewBag.Supervisor = false; int memberID = Convert.ToInt16(System.Web.HttpContext.Current.Session["personID"]); if (memberID > 0) { if (MembershipRepositroy.IsUser(memberID)) { user user = MembershipRepositroy.GetUserByID(memberID); if ((user.role.Name == "WebMaster") || (user.role.Name == "Pastor") || (user.role.Name == "Admin") || (user.role.Name == "Officer")) //creator access { ViewBag.Supervisor = true; } } } return(PartialView(GoalList)); }
public ActionResult ListMinistry(DateTime bDate, DateTime eDate, string SearchType = "", int codeID = 0, string codeName = "", string codeName2 = "") { IEnumerable <goal> GoalList; if (SearchType == "MinistrySearch") { GoalList = GoalRepository.GetGoalByMinistry(codeID); } else if (SearchType == "StatusSearch") { GoalList = GoalRepository.GetGoalByStatus(codeName); } else if (SearchType == "Begin Date Search") { GoalList = GoalRepository.GetGoalBeginning(bDate, eDate); } else if (SearchType == "End Date Search") { GoalList = GoalRepository.GetGoalEnding(bDate, eDate); } else if (SearchType == "CompletionRatioSearch") { GoalList = GoalRepository.GetGoalByCompletionRatio(codeName); } else { GoalList = GoalRepository.GetGoalByDateRange(bDate.Date, eDate.Date); } foreach (goal g in GoalList) { g.ministry = MinistryRepository.GetMinistryByID(g.ministryID); if (g.AssignedTo > 0) { g.PersonAssignedTo.member = MemberRepository.GetMemberByID((int)g.AssignedTo); } } ministry ministry = MinistryRepository.GetMinistryByID(codeID); ViewBag.Ministry = ministry; ViewBag.RecordCount = GoalList.Count(); ViewBag.Heading = string.Format("List of Goals for {0}", ministry.MinistryName); ViewBag.MinistryName = ministry.MinistryName; return(PartialView(GoalList)); }