Beispiel #1
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 ExistingMadarasaOeprationDetails(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 ExistingMadarsaOperationsRequestBs().GetByRequestSubmitId(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));
        }
Beispiel #3
0
 public InvolveMemberController()
 {
     _PanelInvolvementModel = new PanelInvolvementModel();
     _PanelInvolveBs        = new PanelInvolveBs();
 }