Beispiel #1
0
        public AnnouncementController(IConstantRepository ConstantParam, IMinistryRepository MinistryParam, IAnnouncementRepository AnnouncementParam)
        {
            ConstantRepository     = ConstantParam;
            MinistryRepository     = MinistryParam;
            AnnouncementRepository = AnnouncementParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #2
0
        public PledgeController(IConstantRepository ConstantParam, IMemberRepository MemberParam, IPledgeRepository PledgeParam, IContributionRepository ContributributionParam)
        {
            ConstantRepository     = ConstantParam;
            MemberRepository       = MemberParam;
            PledgeRepository       = PledgeParam;
            ContributionRepository = ContributributionParam;

            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 == "FinanceLead")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if ((user.role.Name == "FinanceStaff") || (user.role.Name == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #3
0
        public ContributionController(IConstantRepository ConstantParam, IMemberRepository MemberParam, IFamilyRepository FamilyParam,
            IContributionRepository ContributionParam, ISubCategoryRepository SubCategoryParam, IPictureRepository PictureParam, 
            ISpouseRepository SpouseParam, IMinistryRepository MinistryParam)
        {
            ConstantRepository = ConstantParam;
            MemberRepository = MemberParam;
            FamilyRepository = FamilyParam;
            ContributionRepository = ContributionParam;
            SubCategoryRepository = SubCategoryParam;
            PictureRepository = PictureParam;
            SpouseRepository = SpouseParam;
            MinistryRepository = MinistryParam;

            ViewBag.Supervisor = false;
            int memberID = Convert.ToInt16(System.Web.HttpContext.Current.Session["personID"]);
            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 == "FinanceLead")) //creator access
                {
                    ViewBag.Supervisor = true;
                }
                if (user.role.Name == "WebMaster") //creator access
                {
                    ViewBag.WebMaster = true;
                }

                if ((user.role.Name == "FinanceStaff") || (user.role.Name == "Admin2")) //creator access
                {
                    ViewBag.Supervisor2 = true;
                }
            }
        }
Beispiel #4
0
        public IncomeController(IBankAccountRepository BankaccountParam, IConstantRepository ConstantParam, ICategoryRepository CategoryParam,
                                ISubCategoryRepository SubCategoryParam, IPayeeRepository PayeeParam, IIncomeRepository IncomeParam)
        {
            BankAccountRepository = BankaccountParam;
            ConstantRepository    = ConstantParam;
            CategoryRepository    = CategoryParam;
            SubCategoryRepository = SubCategoryParam;
            PayeeRepository       = PayeeParam;
            IncomeRepository      = IncomeParam;

            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 == "FinanceLead")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "FinanceStaff") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #5
0
        public MinistryController(IConstantRepository ConstantParam, IMinistryRepository MinistryParam, IGoalRepository GoalParam, IMeetingRepository MeetingParam,
                                  IAnnouncementRepository AnnouncementParam, ICalendarRepository CalendarParam, IMinistryMemberRepository MinistryMemberParam, IMemberRepository MemberParam,
                                  IChildParentRepository ChildParentParam, IStoryRepository StoryParam, IPictureRepository PictureParam, IListtableRepository ListTableParam, IMinistryGroupRepository MinistryGroupParam,
                                  IDocumentRepository DocumentParam, IVideoRepository VideoParam)
        {
            ConstantRepository       = ConstantParam;
            MinistryRepository       = MinistryParam;
            GoalRepository           = GoalParam;
            MeetingRepository        = MeetingParam;
            AnnouncementRepository   = AnnouncementParam;
            CalendarRepository       = CalendarParam;
            MinistryMemberRepository = MinistryMemberParam;
            MemberRepository         = MemberParam;
            ChildParentRepository    = ChildParentParam;
            StoryRepository          = StoryParam;
            PictureRepository        = PictureParam;
            ListTableRepository      = ListTableParam;
            MinistryGroupRepository  = MinistryGroupParam;
            DocumentRepository       = DocumentParam;
            VideoRepository          = VideoParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if ((user.role.Name == "Officer")) //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }

                    if ((user.role.Name == "FinanceLead")) //creator access
                    {
                        ViewBag.Supervisor3 = true;
                    }
                }
            }
        }
Beispiel #6
0
        //
        // GET: /Member/

        public CategoryController(ICategoryRepository categoryParam)
        {
            CategoryRepository = categoryParam;

            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")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }

                    if ((user.role.Name == "Officer") || (user.role.Name == "FinanceLead")) //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }

                    if ((user.role.Name == "FinanceStaff") || (user.role.Name == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor3 = true;
                    }
                }
            }
        }
Beispiel #7
0
        public PropertyInventoryController(IConstantRepository ConstantParam, IMemberRepository MemberParam,
                                           IPropertyInventoryRepository PropertyInventoryParam, IPictureRepository PictureParam, IDocumentRepository DocumentParam)
        {
            ConstantRepository          = ConstantParam;
            MemberRepository            = MemberParam;
            PropertyInventoryRepository = PropertyInventoryParam;
            PictureRepository           = PictureParam;
            DocumentRepository          = DocumentParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #8
0
        public ListHeaderController(IConstantRepository ConstantParam, IListtableRepository ListTableParam,
                                    IListHeaderRepository ListHeaderParam)
        {
            ConstantRepository   = ConstantParam;
            ListTableRepository  = ListTableParam;
            ListTableRepository  = ListTableParam;
            ListHeaderRepository = ListHeaderParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #9
0
        public ResponsibilityController(IConstantRepository ConstantParam, IResponsibilityRepository ResponsibilityParam, IStaffRepository StaffParam)
        {
            ConstantRepository       = ConstantParam;
            ResponsibilityRepository = ResponsibilityParam;
            StaffRepository          = StaffParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #10
0
        //
        // GET: /Member/

        public BillController(IBillRepository billParam, IConstantRepository constantParam, IPayeeCategoryRepository PayeeCategoryParam, IPayeeRepository payeeParam)
        {
            billRepository          = billParam;
            ConstantRepository      = constantParam;
            PayeeCategoryRepository = PayeeCategoryParam;
            PayeeRepository         = payeeParam;

            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 == "FinanceLead")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "FinanceStaff") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #11
0
        //
        // GET: /Member/

        public ConstantController(IConstantRepository constantParam, ISubCategoryRepository SubCategoryParam)
        {
            ConstantRepository    = constantParam;
            SubCategoryRepository = SubCategoryParam;

            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")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                }
            }
        }
Beispiel #12
0
        public MeetingController(IConstantRepository ConstantParam, IMinistryRepository MinistryParam, IMeetingRepository MeetingParam,
                                 IMinistryMemberRepository MinistryMemberParam, ICalendarRepository CalendarParam, IMeetingAgendaRepository MeetingAgendaRepoistory,
                                 IAttendanceRepository AttendanceParam, IMeetingNotesRepository MeetingNoteParam, IMemberRepository MemberParam, ITaskRepository TaskParam,
                                 IDocumentRepository DocumentParam)
        {
            ConstantRepository       = ConstantParam;
            MinistryRepository       = MinistryParam;
            MeetingRepository        = MeetingParam;
            MinistryMemberRepository = MinistryMemberParam;
            CalendarRepository       = CalendarParam;
            MeetingAgendaRepository  = MeetingAgendaRepoistory;
            AttendanceRepository     = AttendanceParam;
            MeetingNotesRepository   = MeetingNoteParam;
            MemberRepository         = MemberParam;
            TaskRepository           = TaskParam;
            DocumentRepository       = DocumentParam;

            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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #13
0
        public TaskController(IConstantRepository ConstantParam, IMinistryRepository MinistryParam, IGoalRepository GoalParam, ITaskRepository TaskParam,
                              IMinistryMemberRepository MinistryMemberParam, IMemberRepository MemberParam, IActionItemRepository ActionItemParam, IMeetingAgendaRepository MeetingAgendaParam,
                              IMeetingRepository MeetingParam)
        {
            ConstantRepository       = ConstantParam;
            MinistryRepository       = MinistryParam;
            GoalRepository           = GoalParam;
            TaskRepository           = TaskParam;
            MinistryMemberRepository = MinistryMemberParam;
            MemberRepository         = MemberParam;
            ActionItemRepository     = ActionItemParam;
            MeetingAgendaRepository  = MeetingAgendaParam;
            MeetingRepository        = MeetingParam;

            //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 == "Admin2")) //creator access
                    {
                        ViewBag.Supervisor = true;
                    }
                    if (user.role.Name == "WebMaster") //creator access
                    {
                        ViewBag.WebMaster = true;
                    }

                    if (user.role.Name == "Officer") //creator access
                    {
                        ViewBag.Supervisor2 = true;
                    }
                }
            }
        }
Beispiel #14
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (!httpContext.Request.IsAuthenticated)  //return if user is not logged in
            {
                return(false);
            }

            int memberID = Convert.ToInt16(System.Web.HttpContext.Current.Session["personID"]);

            if (MembershipRepositroy.IsUser(memberID))
            {
                user user = MembershipRepositroy.GetUserByID(memberID);

                foreach (string defineRole in this.Roles.Split(','))
                {
                    if (defineRole.Equals(user.role.Name))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }