public ActionResult ARExistingMadarsaOperation(ExistingMadarsaOperationsRequestModel 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("ExistingMadarasaOeprationDetails", "RequestList", new { Id = _RequestApproveModel.RequestSubmitId }));
        }
        public int Save(ExistingMadarsaOperationsRequestModel model)
        {
            ExistingMadarsaOperationsRequest _tblList = new ExistingMadarsaOperationsRequest(model);

            _RequestSubmitModel.ShortDesc     = model.ShortDescription;
            _RequestSubmitModel.UserId        = model.UserId;
            _RequestSubmitModel.CreatedDate   = Convert.ToDateTime(System.DateTime.Now);
            _RequestSubmitModel.RequestTypeId = model.RequestTypeId;
            RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel);

            if (_tblList.Id != null && _tblList.Id != 0)
            {
                _tblList.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
                tbl_ExistingMadarsaOperationsRequestModel.Update(_tblList);
            }
            else
            {
                _requestSubmit           = _RequestSubmit.Insert(_requestSubmit);
                _tblList.RequestSubmitId = _requestSubmit.Id;
                _tblList.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);
                _tblList = tbl_ExistingMadarsaOperationsRequestModel.Insert(_tblList);
            }


            return(_tblList.Id);
        }
 public ActionResult Details(int id)
 {
     if (id != null && id != 0)
     {
         _ExistingMadarsaModel = _ExistingMadarsaOperationsRequestModelBs.GetById(id);
     }
     return(View(_ExistingMadarsaModel));
 }
        public ActionResult Create(ExistingMadarsaOperationsRequestModel 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 = 5;
                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       = _ExistingMadarsaOperationsRequestModelBs.Save(model);
            }
            if (result > 0)
            {
                _ExistingMadarsaModel.UserModelList        = _ExistingMadarsaOperationsRequestModelBs.UserList().ToList();
                _ExistingMadarsaModel.RequestTypeModelList = _ExistingMadarsaOperationsRequestModelBs.RequestTypeList().ToList();
                _ExistingMadarsaModel.MadarsaModelList     = _ExistingMadarsaOperationsRequestModelBs.MadarsaList().ToList();
                TempData["message"] = "Request Submitted Successfully!";
            }
            return(RedirectToAction("Index", "UserRequest", new { area = "User" }));
        }
        public ExistingMadarsaOperationsRequestModel GetDetails(ExistingMadarsaOperationsRequestModel model)
        {
            model = model ?? new ExistingMadarsaOperationsRequestModel();
            if (model.Id != 0)
            {
                model.ExistingMadarsaOperationRequestModelList = ExistingMadarsaOperationRequestList();
                model.UserModelList          = UserList();
                model.MadarsaModelList       = MadarsaList();
                model.RequestSubmitModelList = RequestSubmitList();
                model.RequestTypeModelList   = RequestTypeList();
            }
            model.ExistingMadarsaOperationRequestModelList = ExistingMadarsaOperationRequestList();

            return(model);
        }
        public ExistingMadarsaOperationsRequestModel GetById(int id)
        {
            ExistingMadarsaOperationsRequestModel varList = new ExistingMadarsaOperationsRequestModel();
            var item = tbl_ExistingMadarsaOperationsRequestModel.GetById(id);

            item    = item ?? new ExistingMadarsaOperationsRequest();
            varList = new ExistingMadarsaOperationsRequestModel
            {
                Id = item.Id,
                ShortDescription  = item.ShortDescription,
                Location          = item.Location,
                Area              = item.Area,
                ExpectedStudents  = item.ExpectedStudents,
                Girls             = item.Girls,
                Boys              = item.Boys,
                Teachers          = item.Teachers,
                IsResidential     = item.IsResidential,
                MonthlyConst      = item.MonthlyConst,
                CostPerStudent    = item.CostPerStudent,
                RevenueSource     = item.RevenueSource,
                TotalLandArea     = item.TotalLandArea,
                ConstructedArea   = item.ConstructedArea,
                IsRented          = item.IsRented,
                ChargingStudent   = item.ChargingStudent,
                IfChargingHowmuch = item.IfChargingHowmuch,

                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.BoardCommentList = new RequestCommentBs().BoardCommentList(id);
            varList.ApprovedList     = new RequestApproveRejectBs().ApproveRejectDisplay(id);

            return(varList);
        }
Exemple #7
0
        public ActionResult CommentOnExistingMadarsaOperations(ExistingMadarsaOperationsRequestModel 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)
     {
         _ExistingMadarsaModel = _ExistingMadarsaOperationsRequestModelBs.GetById(Convert.ToInt32(id));
         _ExistingMadarsaModel.UserModelList        = _ExistingMadarsaOperationsRequestModelBs.UserList().ToList();
         _ExistingMadarsaModel.RequestTypeModelList = _ExistingMadarsaOperationsRequestModelBs.RequestTypeList().ToList();
         _ExistingMadarsaModel.MadarsaModelList     = _ExistingMadarsaOperationsRequestModelBs.MadarsaList().ToList();
         return(View(_ExistingMadarsaModel));
     }
     else
     {
         _ExistingMadarsaModel.UserModelList        = _ExistingMadarsaOperationsRequestModelBs.UserList().ToList();
         _ExistingMadarsaModel.RequestTypeModelList = _ExistingMadarsaOperationsRequestModelBs.RequestTypeList().ToList();
         _ExistingMadarsaModel.MadarsaModelList     = _ExistingMadarsaOperationsRequestModelBs.MadarsaList().ToList();
         return(View(_ExistingMadarsaModel));
     }
 }
Exemple #9
0
        public ExistingMadarsaOperationsRequest(ExistingMadarsaOperationsRequestModel item)
        {
            Id = item.Id;
            ShortDescription  = item.ShortDescription;
            Location          = item.Location;
            Area              = item.Area;
            ExpectedStudents  = item.ExpectedStudents;
            IfChargingHowmuch = item.IfChargingHowmuch;
            Girls             = item.Girls;
            Boys              = item.Boys;
            Teachers          = item.Teachers;
            IsResidential     = item.IsResidential;
            MonthlyConst      = item.MonthlyConst;
            CostPerStudent    = item.CostPerStudent;
            RevenueSource     = item.RevenueSource;
            TotalLandArea     = item.TotalLandArea;
            ConstructedArea   = item.ConstructedArea;
            IsRented          = item.IsRented;
            ChargingStudent   = item.ChargingStudent;
            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;


            MadarsaId = item.MadarsaId;

            RequestTypeId = item.RequestTypeId;

            RequestSubmitId = item.RequestSubmitId;
        }
        public ExistingMadarsaOperationsRequestModel GetByRequestSubmitIdAmeer(int id)
        {
            ExistingMadarsaOperationsRequestModel varList = new ExistingMadarsaOperationsRequestModel();
            var item = tbl_ExistingMadarsaOperationsRequestModel.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault();

            item    = item ?? new ExistingMadarsaOperationsRequest();
            varList = new ExistingMadarsaOperationsRequestModel
            {
                Id = item.Id,
                ShortDescription = item.ShortDescription,
                Location         = item.Location,
                Area             = item.Area,
                //ExpectedStudents = item.ExpectedStudents,
                Girls             = item.Girls,
                Boys              = item.Boys,
                Teachers          = item.Teachers,
                IsResidential     = item.IsResidential,
                MonthlyConst      = item.MonthlyConst,
                CostPerStudent    = item.CostPerStudent,
                RevenueSource     = item.RevenueSource,
                TotalLandArea     = item.TotalLandArea,
                ConstructedArea   = item.ConstructedArea,
                IsRented          = item.IsRented,
                ChargingStudent   = item.ChargingStudent,
                IfChargingHowmuch = item.IfChargingHowmuch,

                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.UserId,

                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,
                //  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);
        }
        public ExistingMadarsaOperationsRequestModel GetByRequestSubmitId(int id, int UserTypeId, int UserId)
        {
            ExistingMadarsaOperationsRequestModel varList = new ExistingMadarsaOperationsRequestModel();
            var item = tbl_ExistingMadarsaOperationsRequestModel.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault();

            item    = item ?? new ExistingMadarsaOperationsRequest();
            varList = new ExistingMadarsaOperationsRequestModel
            {
                Id = item.Id,
                ShortDescription  = item.ShortDescription,
                Location          = item.Location,
                Area              = item.Area,
                ExpectedStudents  = item.ExpectedStudents,
                Girls             = item.Girls,
                Boys              = item.Boys,
                Teachers          = item.Teachers,
                IfChargingHowmuch = item.IfChargingHowmuch,
                IsResidential     = item.IsResidential,
                MonthlyConst      = item.MonthlyConst,
                CostPerStudent    = item.CostPerStudent,
                RevenueSource     = item.RevenueSource,
                TotalLandArea     = item.TotalLandArea,
                ConstructedArea   = item.ConstructedArea,
                IsRented          = item.IsRented,
                ChargingStudent   = item.ChargingStudent,
                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,
            };
            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);
        }
Exemple #12
0
        public ActionResult ARExistingMadarsaOperation(ExistingMadarsaOperationsRequestModel 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 ExistingMadarsaOperationsRequestController()
 {
     _ExistingMadarsaModel = new ExistingMadarsaOperationsRequestModel();
     _ExistingMadarsaOperationsRequestModelBs = new ExistingMadarsaOperationsRequestBs();
 }