예제 #1
0
 public PanelRequestListController()
 {
     _RequestApproveModel         = new RequestApproveModel();
     _RequestSubmitModel          = new RequestSubmitModel();
     _RequestSubmitBs             = new RequestSubmitBs();
     _MasjidConstructionRequestBs = new MasjidConstructionRequestBs();
     _RequestApproveBs            = new RequestApproveRejectBs();
     _UserRegistrationBs          = new UserRegistrationBs();
 }
예제 #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();
 }
예제 #3
0
        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));
        }
예제 #4
0
 public RequestApproveController()
 {
     _RequestApproveModel = new RequestApproveModel();
     _RequestApproveBs    = new RequestApproveRejectBs();
 }
예제 #5
0
        public ActionResult ARMasjidRenovation(MasjidRenovationRequestModel model)
        {
            if (model != null)
            {
                UserRegistrationBs obj = new UserRegistrationBs();
                var UserId             = obj.UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().Id;
                var UserTypeId         = obj.UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().UserTypeId;
                _RequestApproveModel.UserId          = Convert.ToInt32(UserId);
                _RequestApproveModel.RequestSubmitId = Convert.ToInt32(model.RequestSubmitId);
                _RequestApproveModel.UserTypeId      = Convert.ToInt32(UserTypeId);
                var IsAgreed = new RequestApproveRejectBs().ApproveRejectDisplay(_RequestApproveModel.RequestSubmitId).ToList();

                if (IsAgreed.Where(x => x.UserTypeId == UserTypeId && x.UserId == UserId).Count() != 0)
                {
                    _RequestApproveModel.Id = IsAgreed.Where(x => x.UserTypeId == UserTypeId && x.UserId == UserId).FirstOrDefault().Id;
                }
                if (model.Status != null)
                {
                    _RequestApproveModel.IsApproved = model.Status;
                }
                if (model.LikeStatus != null)
                {
                    _RequestApproveModel.LikeStatus = model.LikeStatus;
                }


                int InvolveUserTypId;

                if (model.IsObjectClicked == true)
                {
                    PanelInvolvementModel _PanelInvolvementModelObj = new PanelInvolvementModel();
                    switch (UserTypeId)
                    {
                    case 6:
                        InvolveUserTypId          = 15;
                        _PanelInvolvementModelObj = new PanelInvolvementModel(model, UserId, (Int32)InvolveUserTypId);
                        break;

                    case 7:
                        InvolveUserTypId          = 13;
                        _PanelInvolvementModelObj = new PanelInvolvementModel(model, UserId, (Int32)InvolveUserTypId);

                        break;

                    case 8:
                        InvolveUserTypId          = 11;
                        _PanelInvolvementModelObj = new PanelInvolvementModel(model, UserId, (Int32)InvolveUserTypId);

                        break;

                    case 12:
                        InvolveUserTypId          = 14;
                        _PanelInvolvementModelObj = new PanelInvolvementModel(model, UserId, (Int32)InvolveUserTypId);

                        break;

                    default:
                        _PanelInvolvementModelObj = new PanelInvolvementModel(model, UserId, (Int32)UserTypeId);
                        break;
                    }


                    _PanelInvolvementModelObj.IsObject = model.IsObject;

                    _PanelInvolveBs.Save(_PanelInvolvementModelObj);
                }
                else
                {
                    _RequestApproveBs.Save(_RequestApproveModel);
                }
            }
            return(Json(true, JsonRequestBehavior.AllowGet));
        }