Exemple #1
0
 public MasjidConstructionRequest(MasjidConstructionRequestModel _obj)
 {
     Id = _obj.Id;
     ShortDescription = _obj.ShortDescription;
     UserId           = _obj.UserId;
     Location         = _obj.Location;
     Area             = _obj.Area;
     MasjidId         = _obj.MasjidId;
     ConstructionCost = _obj.ConstructionCost;
     ExistingFloors   = _obj.ExistingFloors;
     AmountNeeded     = _obj.AmountNeeded;
     Engineer         = _obj.Engineer;
     Elevation        = _obj.Elevation;
     Paln             = _obj.Paln;
     Doc1             = _obj.Doc1;
     Doc2             = _obj.Doc2;
     Doc3             = _obj.Doc3;
     Pic1             = _obj.Pic1;
     Pic2             = _obj.Pic2;
     Pic3             = _obj.Pic3;
     RequestSubmitId  = _obj.RequestSubmitId;
     Status           = _obj.Status;
     CreatedDate      = _obj.CreatedDate;
     RequestTypeId    = _obj.RequestTypeId;
 }
        public ActionResult ApproveMasjidConstruction(MasjidConstructionRequestModel 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);
                _RequestApproveModel.IsApproved      = model.Status ?? false;

                if (model.AlreadyExistsInMemberOpinion && model.MemberOpinionId != 0)
                {
                    _RequestApproveModel.Id = model.MemberOpinionId;
                }
                int i = _RequestApproveBs.Save(_RequestApproveModel);

                if (i > 0 && _RequestApproveModel.Id != 0)
                {
                    TempData["agree"] = "You have Disagreed on this request";
                }
                else
                {
                    TempData["agree"] = "You have agreed on this request";
                }
            }
            return(RedirectToAction("GetMasjidConstructionDetails", "RequestList", new { Id = _RequestApproveModel.RequestSubmitId }));
        }
Exemple #3
0
        public int Save(MasjidConstructionRequestModel model)
        {
            MasjidConstructionRequest _tbl_mcr = new MasjidConstructionRequest(model);

            _RequestSubmitModel.ShortDesc     = model.ShortDescription;
            _RequestSubmitModel.UserId        = model.UserId;
            _RequestSubmitModel.RequestTypeId = model.RequestTypeId;
            RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel);

            _RequestSubmitModel.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
            if (_tbl_mcr.Id != null && _tbl_mcr.Id != 0)
            {
                _tbl_mcr.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
                //_tblList.CreatedBy = 1;
                _tbl_MCR.Update(_tbl_mcr);
            }
            else
            {
                _requestSubmit           = _RequestSubmit.Insert(_requestSubmit);
                _tbl_mcr.RequestSubmitId = _requestSubmit.Id;
                _tbl_mcr.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);
                //_tblList.CreatedBy = 1;
                _tbl_mcr = _tbl_MCR.Insert(_tbl_mcr);
            }

            return(_tbl_mcr.Id);
        }
Exemple #4
0
        public MasjidConstructionRequestModel GetByRequestSubmitIdBoard(int id, int userid)
        {
            MasjidConstructionRequestModel varList = new MasjidConstructionRequestModel();
            var MCRbyId = _tbl_MCR.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault();

            MCRbyId = MCRbyId ?? new MasjidConstructionRequest();
            varList = new MasjidConstructionRequestModel
            {
                Id = MCRbyId.Id,
                ShortDescription = MCRbyId.ShortDescription,
                UserId           = MCRbyId.UserId,
                UserName         = (MCRbyId.User != null) ? MCRbyId.User.UserName : string.Empty,
                Location         = MCRbyId.Location,
                Area             = MCRbyId.Area,
                MasjidId         = MCRbyId.MasjidId,
                MasjidName       = (MCRbyId.Masjid != null) ? MCRbyId.Masjid.Name : string.Empty,
                ConstructionCost = Convert.ToInt32(MCRbyId.ConstructionCost),
                ExistingFloors   = MCRbyId.ExistingFloors,
                AmountNeeded     = MCRbyId.AmountNeeded,
                Engineer         = MCRbyId.Engineer,
                Elevation        = MCRbyId.Elevation,
                Paln             = MCRbyId.Paln,
                Doc1             = MCRbyId.Doc1,
                Doc2             = MCRbyId.Doc2,
                Doc3             = MCRbyId.Doc3,
                Pic1             = MCRbyId.Pic1,
                Pic2             = MCRbyId.Pic2,
                Pic3             = MCRbyId.Pic3,
                RequestSubmitId  = MCRbyId.RequestSubmitId,
                //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty,
                Status          = MCRbyId.Status,
                CreatedDate     = MCRbyId.CreatedDate,
                RequestTypeId   = MCRbyId.RequestTypeId,
                RequestTypeName = (MCRbyId.RequestType != null) ? MCRbyId.RequestType.Name : string.Empty,
            };
            RequestCommentBs obj = new RequestCommentBs();
            var BoardComments    = obj.BoardCommentList(id).ToList();

            varList.BoardCommentList = BoardComments;

            var PannelComments = obj.PanelCommentList(id).ToList();

            varList.PanelCommentList = PannelComments;

            RequestApproveRejectBs obj1 = new RequestApproveRejectBs();

            varList.ApprovedList = obj1.ApproveRejectDisplay(id).ToList();
            varList.AlreadyExistsInMemberOpinion = varList.ApprovedList == null ? false : varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MCRbyId.RequestSubmitId).Any();
            if (varList.AlreadyExistsInMemberOpinion)
            {
                varList.MemberOpinionId = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MCRbyId.RequestSubmitId).FirstOrDefault().Id;
                varList.IsAgreed        = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MCRbyId.RequestSubmitId).FirstOrDefault().IsApproved;
                varList.LikeStatus      = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MCRbyId.RequestSubmitId).FirstOrDefault().LikeStatus;
            }
            PanelInvolveBs panelobject = new PanelInvolveBs();

            varList.PannelMemberInvolved = panelobject.InvolveList(id).ToList();
            return(varList);
        }
Exemple #5
0
        public MasjidConstructionRequestBs()
        {
            _tbl_MCR = new GenericPattern <MasjidConstructionRequest>();
            _MasjidConstructionRequestModel = new MasjidConstructionRequestModel();

            _RequestSubmit      = new GenericPattern <RequestSubmit>();
            _RequestSubmitModel = new RequestSubmitModel();
        }
Exemple #6
0
        public ActionResult LikeDisLike(MasjidConstructionRequestModel model)
        {
            if (model != null)
            {
                _RequestLikeModel.UserId          = Convert.ToInt32(model.UserId);
                _RequestLikeModel.RequestSubmitId = Convert.ToInt32(model.RequestSubmitId);
                _RequestLikeModel.IsLike          = false;
                _RequestLikeModel.UserTypeId      = 2;

                _RequestLikeDisLikeBs.Save(_RequestLikeModel);
            }
            return(RedirectToAction("Index"));
        }
Exemple #7
0
        public MasjidConstructionRequestModel GetDetails(MasjidConstructionRequestModel model)
        {
            model = model ?? new MasjidConstructionRequestModel();
            if (model.Id != 0)
            {
                model.MasjidLists      = MasjidList();
                model.RequestTypeLists = RequestTypeList();
                model.UserLists        = UserList();
                model.MasjidConstructionRequestLists = MasjidConstructionRequestList();
            }
            model.MasjidConstructionRequestLists = MasjidConstructionRequestList();

            return(model);
        }
Exemple #8
0
        public JsonResult CommentOnMasjidConstruction(MasjidConstructionRequestModel model)
        {
            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;

            if (model != null)
            {
                _RequestCommentModel.UserId          = Convert.ToInt32(UserId);
                _RequestCommentModel.RequestSubmitId = Convert.ToInt32(model.RequestSubmitId);
                _RequestCommentModel.Comment         = model.Comment;
                _RequestCommentModel.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);
                _RequestCommentModel.UserTypeId      = Convert.ToInt32(UserTypeId);
                _RequestCommentBs.Save(_RequestCommentModel);
            }
            return(Json("_RequestComentModel", JsonRequestBehavior.AllowGet));
        }
        public ActionResult Create(int?id)

        {
            if (id != null)
            {
                _MCRModel                  = _MCRBs.GetById(Convert.ToInt32(id));
                _MCRModel.UserLists        = _MCRBs.UserList().ToList();
                _MCRModel.MasjidLists      = _MCRBs.MasjidList().ToList();
                _MCRModel.RequestTypeLists = _MCRBs.RequestTypeList().ToList();
            }
            else
            {
                _MCRModel.MasjidLists      = _MCRBs.MasjidList().ToList();
                _MCRModel.UserLists        = _MCRBs.UserList().ToList();
                _MCRModel.RequestTypeLists = _MCRBs.RequestTypeList().ToList();
            }

            return(View(_MCRModel));
        }
Exemple #10
0
        public MasjidConstructionRequestModel GetById(int id)
        {
            MasjidConstructionRequestModel _MasjidConstructionRequest = new MasjidConstructionRequestModel();
            var MCRbyId = _tbl_MCR.GetById(id);

            MCRbyId = MCRbyId ?? new MasjidConstructionRequest();
            _MasjidConstructionRequestModel = new MasjidConstructionRequestModel
            {
                Id = MCRbyId.Id,
                ShortDescription = MCRbyId.ShortDescription,
                UserId           = MCRbyId.UserId,
                UserName         = (MCRbyId.User != null) ? MCRbyId.User.UserName : string.Empty,
                Location         = MCRbyId.Location,
                Area             = MCRbyId.Area,
                MasjidId         = MCRbyId.MasjidId,
                MasjidName       = (MCRbyId.Masjid != null) ? MCRbyId.Masjid.Name : string.Empty,
                ConstructionCost = Convert.ToInt32(MCRbyId.ConstructionCost),
                ExistingFloors   = MCRbyId.ExistingFloors,
                AmountNeeded     = MCRbyId.AmountNeeded,
                Engineer         = MCRbyId.Engineer,
                Elevation        = MCRbyId.Elevation,
                Paln             = MCRbyId.Paln,
                Doc1             = MCRbyId.Doc1,
                Doc2             = MCRbyId.Doc2,
                Doc3             = MCRbyId.Doc3,
                Pic1             = MCRbyId.Pic1,
                Pic2             = MCRbyId.Pic2,
                Pic3             = MCRbyId.Pic3,
                RequestSubmitId  = MCRbyId.RequestSubmitId,
                //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty,
                Status          = MCRbyId.Status,
                CreatedDate     = MCRbyId.CreatedDate,
                RequestTypeId   = MCRbyId.RequestTypeId,
                RequestTypeName = (MCRbyId.RequestType != null) ? MCRbyId.RequestType.Name : string.Empty,
            };

            _MasjidConstructionRequestModel.RequestCommentList = new RequestCommentBs().BoardCommentList(id);
            _MasjidConstructionRequestModel.ApprovedList       = new RequestApproveRejectBs().ApproveRejectDisplay(id);

            return(_MasjidConstructionRequestModel);
        }
Exemple #11
0
        public ActionResult ARMasjidConstruction(MasjidConstructionRequestModel 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));
        }
        public ActionResult Create(MasjidConstructionRequestModel model, HttpPostedFileBase[] Files)
        {
            int result = 0;

            if (model != null)
            {
                UserRegistrationBs obj = new UserRegistrationBs();
                var id = obj.UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().Id;
                model.RequestTypeId = 1;
                if (Files != null)
                {
                    model.Paln = new byte[Files[0].ContentLength];
                    Files[0].InputStream.Read(model.Paln, 0, Files[0].ContentLength);
                }
                if (Files[1] != null)
                {
                    model.Elevation = new byte[Files[1].ContentLength];
                    Files[1].InputStream.Read(model.Elevation, 0, Files[1].ContentLength);
                }

                if (Files[2] != null)
                {
                    model.Doc1 = new byte[Files[2].ContentLength];
                    Files[2].InputStream.Read(model.Doc1, 0, Files[2].ContentLength);
                }
                if (Files[3] != null)
                {
                    model.Doc2 = new byte[Files[3].ContentLength];
                    Files[3].InputStream.Read(model.Doc2, 0, Files[3].ContentLength);
                }
                if (Files[4] != null)
                {
                    model.Doc3 = new byte[Files[4].ContentLength];
                    Files[4].InputStream.Read(model.Doc3, 0, Files[4].ContentLength);
                }
                if (Files[5] != null)
                {
                    model.Pic1 = new byte[Files[5].ContentLength];
                    Files[5].InputStream.Read(model.Pic1, 0, Files[5].ContentLength);
                }

                if (Files[6] != null)
                {
                    model.Pic2 = new byte[Files[6].ContentLength];
                    Files[6].InputStream.Read(model.Pic2, 0, Files[6].ContentLength);
                }
                if (Files[7] != null)
                {
                    model.Pic3 = new byte[Files[7].ContentLength];
                    Files[7].InputStream.Read(model.Pic3, 0, Files[7].ContentLength);
                }

                model.UserId = id;
                result       = _MCRBs.Save(model);
            }
            if (result > 0)
            {
                _MCRModel.UserLists        = _MCRBs.UserList().ToList();
                _MCRModel.RequestTypeLists = _MCRBs.RequestTypeList().ToList();
                _MCRModel.MasjidLists      = _MCRBs.MasjidList().ToList();

                TempData["message"] = "Request Submitted Successfully";
            }
            return(RedirectToAction("Index", "UserRequest", new { area = "User" }));
        }
 public MasjidConstructionRequestController()
 {
     _MCRModel = new MasjidConstructionRequestModel();
     _MCRBs    = new MasjidConstructionRequestBs();
 }