public PanelRequestListController()
 {
     _RequestApproveModel         = new RequestApproveModel();
     _RequestSubmitModel          = new RequestSubmitModel();
     _RequestSubmitBs             = new RequestSubmitBs();
     _MasjidConstructionRequestBs = new MasjidConstructionRequestBs();
     _RequestApproveBs            = new RequestApproveRejectBs();
     _UserRegistrationBs          = new UserRegistrationBs();
 }
Example #2
0
 public PanelAgreeDisagreeController()
 {
     _RequestApproveModel         = new RequestApproveModel();
     _RequestSubmitModel          = new RequestSubmitModel();
     _RequestSubmitBs             = new RequestSubmitBs();
     _MasjidConstructionRequestBs = new MasjidConstructionRequestBs();
     _RequestApproveBs            = new RequestApproveRejectBs();
     _PanelInvolvementModel       = new PanelInvolvementModel();
     _PanelInvolveBs = new PanelInvolveBs();
 }
        public ActionResult GetMasjidConstructionDetails(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 MasjidConstructionRequestBs().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));
        }
Example #4
0
        public ActionResult GetMasjidConstructionDetails(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 MasjidConstructionRequestBs().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));
        }
Example #5
0
        public ActionResult GetMasjidConstructionDetails(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 MasjidConstructionRequestBs().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));
        }
Example #6
0
 public RequestListController()
 {
     _RequestSubmitModel          = new RequestSubmitModel();
     _RequestSubmitBs             = new RequestSubmitBs();
     _MasjidConstructionRequestBs = new MasjidConstructionRequestBs();
 }
Example #7
0
        public ActionResult RequestForApproval(int id)
        {
            var res = new MasjidConstructionRequestBs().GetById(id);

            return(View(res));
        }