예제 #1
0
        public ActionResult GetMasjidLandRequestDetails(int Id)
        {
            var userDetails = new UserRegistrationBs().UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault();
            var useerTypeId = Convert.ToInt32(userDetails.UserTypeId);

            List <int> _listUserHeads = new List <int> {
                11, 13, 14, 15
            };

            bool IsPanelHeadUser = _listUserHeads.Contains(useerTypeId);
            var  userId          = Convert.ToInt32(userDetails.Id);
            var  headUserTypeId  = Convert.ToInt32(userDetails.MainUserType);
            var  res             = new MasjidLandRequestBs().GetByRequestId(Id, useerTypeId, userId);
            int  IsPanelHead;
            bool checkForPanel = new PanelInvolveBs().PanelMemberInvolveList(Id, useerTypeId).ToList().Any();

            if (checkForPanel)
            {
                IsPanelHead = new PanelInvolveBs().PanelMemberInvolveList(Id, useerTypeId).FirstOrDefault().UserTypeId;
            }
            else
            {
                IsPanelHead = 0;
            }

            int IsPanelMember;

            if ((new PanelInvolveBs().PanelMemberInvolveList(Id, useerTypeId).ToList().Count != 0))
            {
                IsPanelMember = new PanelInvolveBs().PanelMemberInvolveList(Id, useerTypeId).FirstOrDefault().UserTypeId;
            }
            else
            {
                IsPanelMember = 0;
            }
            //Check is user involved in any of the panels
            List <int> _listUser = _UserRegistrationBs.GetUserTypesByMainUserType(headUserTypeId).Select(m => (Int32)m.UserTypeId).ToList();

            //bool IsPanelInvolved = new PanelInvolveBs().IsPanelInvoled(_listUser);
            int IsPanelLiked = new RequestApproveRejectBs().IsPannelMemberLiked(_listUser);


            // List<int> PanelHeadUsers = new List<int> {6,7,8, 11,12, 13, 14, 15 };



            res.IsPanelInvolved = checkForPanel;
            res.IsPanelHeadUser = IsPanelHeadUser;
            res.IsPanelHead     = IsPanelHead;
            res.IsPanelMember   = IsPanelMember;

            return(View(res));
        }
예제 #2
0
        public ActionResult GetMasjidLandRequestDetails(int Id)
        {
            if (TempData["AlreadyExistsInPanel"] != null)
            {
                TempData["message"] = TempData["AlreadyExistsInPanel"];
            }

            else
            {
                if (TempData["agree"] != null)
                {
                    ViewBag.AlertMessage = TempData["agree"];
                }
            }
            var userId = new UserRegistrationBs().UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().UserTypeId;
            var res    = new MasjidLandRequestBs().GetByRequestSubmitIdBoard(Id, Convert.ToInt32(userId));

            res.ApprovedList = res.ApprovedList.Where(x => x.UserTypeId == 2 || x.UserTypeId == 3 || x.UserTypeId == 4 || x.UserTypeId == 5).ToList();
            return(View(res));
        }
예제 #3
0
        public ActionResult GetMasjidLandRequestDetails(int Id)
        {
            if (TempData["AlreadyExistsInPanel"] != null)
            {
                TempData["message"] = TempData["AlreadyExistsInPanel"];
            }

            else
            {
                if (TempData["agree"] != null)
                {
                    ViewBag.AlertMessage = TempData["agree"];
                }
            }
            var userId = new UserRegistrationBs().UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().UserTypeId;
            var res    = new MasjidLandRequestBs().GetByRequestSubmitIdAmeer(Id);

            res.ApprovedList = res.ApprovedList.Where(x => x.UserTypeId == 2 || x.UserTypeId == 3 || x.UserTypeId == 4 || x.UserTypeId == 5).ToList();

            var isapproved = new RequestSubmitBs().RequestSubmitList().Where(x => x.Id == Id).FirstOrDefault();


            res.PanelCommentList = res.PanelCommentList.Where(x => x.UserTypeId == 6 || x.UserTypeId == 7 || x.UserTypeId == 8 || x.UserTypeId == 12).ToList();
            if (isapproved != null)
            {
                if (isapproved.IsApproved == true)
                {
                    res.IsAmeerApproved = true;
                }
                else if (isapproved.IsApproved == false)
                {
                    res.IsAmeerApproved = false;
                }
            }

            return(View(res));
        }