Пример #1
0
        public ActionResult ARMadarsaland(MadarsaLandRequestModel 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("MadarsaLandRequestDetails", "RequestList", new { Id = _RequestApproveModel.RequestSubmitId }));
        }
Пример #2
0
        public int Save(MadarsaLandRequestModel model)
        {
            MadarsaLandRequest _tblList = new MadarsaLandRequest(model);

            _RequestSubmitModel.ShortDesc = model.ShortDescription;
            _RequestSubmitModel.UserId    = model.UserId;

            _RequestSubmitModel.RequestTypeId = model.RequestTypeId;
            RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel);

            if (_tblList.Id != null && _tblList.Id != 0)
            {
                _tblList.CreatedDate = Convert.ToDateTime(System.DateTime.Now);

                tbl_MadarsaLandRequest.Update(_tblList);
            }
            else
            {
                _requestSubmit           = _RequestSubmit.Insert(_requestSubmit);
                _tblList.RequestSubmitId = _requestSubmit.Id;
                _tblList.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);

                _tblList = tbl_MadarsaLandRequest.Insert(_tblList);
            }

            return(_tblList.Id);
        }
Пример #3
0
        public MadarsaLandRequestModel GetByRequestSubmitIdAmeer(int id)
        {
            MadarsaLandRequestModel varList = new MadarsaLandRequestModel();
            var item = tbl_MadarsaLandRequest.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault();

            item    = item ?? new MadarsaLandRequest();
            varList = new MadarsaLandRequestModel
            {
                Id = item.Id,
                ShortDescription = item.ShortDescription,
                Location         = item.Location,
                Area             = item.Area,
                TimePeriod       = item.TimePeriod,
                AmountPaid       = item.AmountPaid,
                AmountNeeded     = item.AmountNeeded,
                LandArea         = item.LandArea,
                LandPrice        = item.LandPrice,
                PurchasingFrom   = item.PurchasingFrom,

                Doc1        = item.Doc1,
                Doc2        = item.Doc2,
                Doc3        = item.Doc3,
                Pic1        = item.Pic1,
                Pic2        = item.Pic2,
                Pic3        = item.Pic3,
                Status      = item.Status,
                CreatedDate = item.CreatedDate,
                // CreatedBy = item.CreatedBy,

                UserId   = item.UserId,
                UserName = (item.User != null) ? item.User.Name : string.Empty,

                MadarsaId   = item.MadarsaId,
                MadarsaName = (item.Madarsa != null) ? item.Madarsa.Name : string.Empty,

                RequestTypeId   = item.RequestTypeId,
                RequestTypeName = (item.RequestType != null) ? item.RequestType.Name : string.Empty,

                RequestSubmitId = item.RequestSubmitId,
            };
            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();

            PanelInvolveBs panelobject = new PanelInvolveBs();

            varList.PannelMemberInvolved = panelobject.InvolveList(id).ToList();

            varList.PaannelMemberLikeDisLike = obj1.ApproveRejectDisplay(id).ToList();
            return(varList);
        }
Пример #4
0
        public MadarsaLandRequest(MadarsaLandRequestModel _obj)
        {
            Id = _obj.Id;
            ShortDescription = _obj.ShortDescription;
            Location         = _obj.Location;
            Area             = _obj.Area;
            TimePeriod       = _obj.TimePeriod;
            AmountPaid       = _obj.AmountPaid;
            AmountNeeded     = _obj.AmountNeeded;
            LandArea         = _obj.LandArea;
            LandPrice        = _obj.LandPrice;
            PurchasingFrom   = _obj.PurchasingFrom;

            Doc1        = _obj.Doc1;
            Doc2        = _obj.Doc2;
            Doc3        = _obj.Doc3;
            Pic1        = _obj.Pic1;
            Pic2        = _obj.Pic2;
            Pic3        = _obj.Pic3;
            Status      = _obj.Status;
            CreatedDate = _obj.CreatedDate;
            //  CreatedBy = _obj.CreatedBy;

            UserId = _obj.UserId;

            MadarsaId = _obj.MadarsaId;

            RequestTypeId = _obj.RequestTypeId;

            RequestSubmitId = _obj.RequestSubmitId;
            //  RequestSubmitId
        }
 public ActionResult Details(int id)
 {
     if (id != null && id != 0)
     {
         _MadarsaLandModel = _MadarsaLandRequestModelBs.GetById(id);
     }
     return(View(_MadarsaLandModel));
 }
        public ActionResult Create(MadarsaLandRequestModel 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 = 6;
                if (Files != null)
                {
                    model.Doc1 = new byte[Files[0].ContentLength];
                    Files[0].InputStream.Read(model.Doc1, 0, Files[0].ContentLength);
                }
                if (Files[1] != null)
                {
                    model.Doc2 = new byte[Files[1].ContentLength];
                    Files[1].InputStream.Read(model.Doc2, 0, Files[1].ContentLength);
                }

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

                model.UserId = id;
                result       = _MadarsaLandRequestModelBs.Save(model);
            }
            if (result > 0)
            {
                _MadarsaLandModel.UserModelList        = _MadarsaLandRequestModelBs.UserList().ToList();
                _MadarsaLandModel.RequestTypeModelList = _MadarsaLandRequestModelBs.RequestTypeList().ToList();
                _MadarsaLandModel.MadarsaModelList     = _MadarsaLandRequestModelBs.MadarsaList().ToList();

                TempData["message"] = "Request Submitted Successfully";
            }
            return(RedirectToAction("Index", "UserRequest", new { area = "User" }));
        }
Пример #7
0
        public MadarsaLandRequestModel GetDetails(MadarsaLandRequestModel model)
        {
            model = model ?? new MadarsaLandRequestModel();
            if (model.Id != 0)
            {
                model.MadarsaLandRequestModelList = MadarsaLandRequestList();
                model.UserModelList          = UserList();
                model.MadarsaModelList       = MadarsaList();
                model.RequestSubmitModelList = RequestSubmitList();
                model.RequestTypeModelList   = RequestTypeList();
            }
            model.MadarsaLandRequestModelList = MadarsaLandRequestList();

            return(model);
        }
Пример #8
0
        public ActionResult CommentOnMadarsaLand(MadarsaLandRequestModel 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));
        }
Пример #9
0
        public MadarsaLandRequestModel GetById(int id)
        {
            MadarsaLandRequestModel varList = new MadarsaLandRequestModel();
            var item = tbl_MadarsaLandRequest.GetById(id);

            item    = item ?? new MadarsaLandRequest();
            varList = new MadarsaLandRequestModel
            {
                Id = item.Id,
                ShortDescription = item.ShortDescription,
                Location         = item.Location,
                Area             = item.Area,
                TimePeriod       = item.TimePeriod,
                AmountPaid       = item.AmountPaid,
                AmountNeeded     = item.AmountNeeded,
                LandArea         = item.LandArea,
                LandPrice        = item.LandPrice,
                PurchasingFrom   = item.PurchasingFrom,

                Doc1        = item.Doc1,
                Doc2        = item.Doc2,
                Doc3        = item.Doc3,
                Pic1        = item.Pic1,
                Pic2        = item.Pic2,
                Pic3        = item.Pic3,
                Status      = item.Status,
                CreatedDate = item.CreatedDate,


                UserId   = item.UserId,
                UserName = (item.User != null) ? item.User.Name : string.Empty,

                MadarsaId   = item.MadarsaId,
                MadarsaName = (item.Madarsa != null) ? item.Madarsa.Name : string.Empty,

                RequestTypeId   = item.RequestTypeId,
                RequestTypeName = (item.RequestType != null) ? item.RequestType.Name : string.Empty,

                RequestSubmitId = item.RequestSubmitId,
            };
            varList.RequestCommentList = new RequestCommentBs().BoardCommentList(id);
            varList.ApprovedList       = new RequestApproveRejectBs().ApproveRejectDisplay(id);

            return(varList);
        }
Пример #10
0
        public ActionResult Create(int?id)
        {
            if (id != null)
            {
                _MadarsaLandModel = _MadarsaLandRequestModelBs.GetById(Convert.ToInt32(id));

                _MadarsaLandModel.UserModelList        = _MadarsaLandRequestModelBs.UserList().ToList();
                _MadarsaLandModel.RequestTypeModelList = _MadarsaLandRequestModelBs.RequestTypeList().ToList();
                _MadarsaLandModel.MadarsaModelList     = _MadarsaLandRequestModelBs.MadarsaList().ToList();

                return(View(_MadarsaLandModel));
            }
            else
            {
                _MadarsaLandModel.UserModelList        = _MadarsaLandRequestModelBs.UserList().ToList();
                _MadarsaLandModel.RequestTypeModelList = _MadarsaLandRequestModelBs.RequestTypeList().ToList();
                _MadarsaLandModel.MadarsaModelList     = _MadarsaLandRequestModelBs.MadarsaList().ToList();



                return(View(_MadarsaLandModel));
            }
        }
Пример #11
0
        public MadarsaLandRequestModel GetByRequestSubmitId(int id, int UserTypeId, int UserId)
        {
            MadarsaLandRequestModel varList = new MadarsaLandRequestModel();
            var item = tbl_MadarsaLandRequest.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault();

            item    = item ?? new MadarsaLandRequest();
            varList = new MadarsaLandRequestModel
            {
                Id = item.Id,
                ShortDescription = item.ShortDescription,
                Location         = item.Location,
                Area             = item.Area,
                TimePeriod       = item.TimePeriod,
                AmountPaid       = item.AmountPaid,
                AmountNeeded     = item.AmountNeeded,
                LandArea         = item.LandArea,
                LandPrice        = item.LandPrice,
                PurchasingFrom   = item.PurchasingFrom,

                Doc1        = item.Doc1,
                Doc2        = item.Doc2,
                Doc3        = item.Doc3,
                Pic1        = item.Pic1,
                Pic2        = item.Pic2,
                Pic3        = item.Pic3,
                Status      = item.Status,
                CreatedDate = item.CreatedDate,
                // CreatedBy = item.CreatedBy,

                UserId   = item.UserId,
                UserName = (item.User != null) ? item.User.Name : string.Empty,

                MadarsaId   = item.MadarsaId,
                MadarsaName = (item.Madarsa != null) ? item.Madarsa.Name : string.Empty,

                RequestTypeId   = item.RequestTypeId,
                RequestTypeName = (item.RequestType != null) ? item.RequestType.Name : string.Empty,

                RequestSubmitId = item.RequestSubmitId,
            };
            RequestCommentBs obj = new RequestCommentBs();
            var BoardComments    = obj.BoardCommentList(id).ToList();

            varList.BoardCommentList = BoardComments;



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

            varList.PanelCommentList = PannelComments;
            if (UserTypeId == 6 || UserTypeId == 15)
            {
                varList.PanelCommentList = varList.PanelCommentList.Where(x => x.UserTypeId == 6 || x.UserTypeId == 15).ToList();
            }
            else if (UserTypeId == 7 || UserTypeId == 13)
            {
                varList.PanelCommentList = varList.PanelCommentList.Where(x => x.UserTypeId == 7 || x.UserTypeId == 13).ToList();
            }
            else if (UserTypeId == 8 || UserTypeId == 11)
            {
                varList.PanelCommentList = varList.PanelCommentList.Where(x => x.UserTypeId == 8 || x.UserTypeId == 11).ToList();
            }
            else if (UserTypeId == 12 || UserTypeId == 14)
            {
                varList.PanelCommentList = varList.PanelCommentList.Where(x => x.UserTypeId == 12 || x.UserTypeId == 14).ToList();
            }

            RequestApproveRejectBs obj1 = new RequestApproveRejectBs();

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

            varList.PannelMemberInvolved     = panelobject.InvolveList(id).ToList();
            varList.PaannelMemberLikeDisLike = obj1.ApproveRejectDisplay(id).ToList();
            if (UserTypeId == 6 || UserTypeId == 15)
            {
                varList.PaannelMemberLikeDisLike = varList.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 6 || x.UserTypeId == 15 && x.LikeStatus != null)).ToList();
            }
            else if (UserTypeId == 7 || UserTypeId == 13)
            {
                varList.PaannelMemberLikeDisLike = varList.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 7 || x.UserTypeId == 13 && x.LikeStatus != null)).ToList();
            }
            else if (UserTypeId == 8 || UserTypeId == 11)
            {
                varList.PaannelMemberLikeDisLike = varList.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 8 || x.UserTypeId == 11 && x.LikeStatus != null)).ToList();
            }
            else if (UserTypeId == 12 || UserTypeId == 14)
            {
                varList.PaannelMemberLikeDisLike = varList.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 12 || x.UserTypeId == 14 && x.LikeStatus != null)).ToList();
            }
            return(varList);
        }
Пример #12
0
        public ActionResult ARMadarsaLand(MadarsaLandRequestModel 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));
        }
Пример #13
0
 public MadarsaLandRequestController()
 {
     _MadarsaLandModel          = new MadarsaLandRequestModel();
     _MadarsaLandRequestModelBs = new MadarsaLandRequestBs();
 }