public ActionResult ARMasjidLand(MasjidLandRequestModel 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("GetMasjidLandRequestDetails", "RequestList", new { Id = _RequestApproveModel.RequestSubmitId })); }
public int Save(MasjidLandRequestModel model) { MasjidLandRequest _tbl_mlr = new MasjidLandRequest(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 (_tbl_mlr.Id != null && _tbl_mlr.Id != 0) { _tbl_mlr.CreatedDate = Convert.ToDateTime(System.DateTime.Now); //_tblList.CreatedBy = 1; _tbl_MLR.Update(_tbl_mlr); } else { _requestSubmit = _RequestSubmit.Insert(_requestSubmit); _tbl_mlr.RequestSubmitId = _requestSubmit.Id; _tbl_mlr.CreatedDate = Convert.ToDateTime(System.DateTime.Now); //_tblList.CreatedBy = 1; _tbl_mlr = _tbl_MLR.Insert(_tbl_mlr); } return(_tbl_mlr.Id); }
public MasjidLandRequest(MasjidLandRequestModel _obj) { Id = _obj.Id; ShortDescription = _obj.ShortDescription; UserId = _obj.UserId; Location = _obj.Location; Area = _obj.Area; MasjidId = _obj.MasjidId; 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; RequestSubmitId = _obj.RequestSubmitId; Status = _obj.Status; CreatedDate = _obj.CreatedDate; RequestTypeId = _obj.RequestTypeId; }
public MasjidLandRequestModel GetByRequestSubmitIdBoard(int id, int userid) { MasjidLandRequestModel varList = new MasjidLandRequestModel(); var MLRbyId = _tbl_MLR.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault(); MLRbyId = MLRbyId ?? new MasjidLandRequest(); varList = new MasjidLandRequestModel { Id = MLRbyId.Id, ShortDescription = MLRbyId.ShortDescription, UserId = MLRbyId.UserId, UserName = (MLRbyId.User != null) ? MLRbyId.User.UserName : string.Empty, Location = MLRbyId.Location, Area = MLRbyId.Area, MasjidId = MLRbyId.MasjidId, MasjidName = (MLRbyId.Masjid != null) ? MLRbyId.Masjid.Name : string.Empty, TimePeriod = MLRbyId.TimePeriod, AmountPaid = MLRbyId.AmountPaid, AmountNeeded = MLRbyId.AmountNeeded, LandArea = MLRbyId.LandArea, LandPrice = MLRbyId.LandPrice, PurchasingFrom = MLRbyId.PurchasingFrom, Doc1 = MLRbyId.Doc1, Doc2 = MLRbyId.Doc2, Doc3 = MLRbyId.Doc3, Pic1 = MLRbyId.Pic1, Pic2 = MLRbyId.Pic2, Pic3 = MLRbyId.Pic3, RequestSubmitId = MLRbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MLRbyId.Status, CreatedDate = MLRbyId.CreatedDate, RequestTypeId = MLRbyId.RequestTypeId, RequestTypeName = (MLRbyId.RequestType != null) ? MLRbyId.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 == MLRbyId.RequestSubmitId).Any(); if (varList.AlreadyExistsInMemberOpinion) { varList.MemberOpinionId = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MLRbyId.RequestSubmitId).FirstOrDefault().Id; varList.IsAgreed = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MLRbyId.RequestSubmitId).FirstOrDefault().IsApproved; varList.LikeStatus = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MLRbyId.RequestSubmitId).FirstOrDefault().LikeStatus; } PanelInvolveBs panelobject = new PanelInvolveBs(); varList.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); return(varList); }
public MasjidLandRequestBs() { _tbl_MLR = new GenericPattern <MasjidLandRequest>(); _MasjidLandRequestModel = new MasjidLandRequestModel(); _RequestSubmit = new GenericPattern <RequestSubmit>(); _RequestSubmitModel = new RequestSubmitModel(); }
public MasjidLandRequestModel GetMasjidLandById(int id) { MasjidLandRequestModel _MasjidLandRequestModel = new MasjidLandRequestModel(); var MLRbyId = _tbl_MLR.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault(); MLRbyId = MLRbyId ?? new MasjidLandRequest(); _MasjidLandRequestModel = new MasjidLandRequestModel { Id = MLRbyId.Id, ShortDescription = MLRbyId.ShortDescription, UserId = MLRbyId.UserId, UserName = (MLRbyId.User != null) ? MLRbyId.User.UserName : string.Empty, Location = MLRbyId.Location, Area = MLRbyId.Area, MasjidId = MLRbyId.MasjidId, MasjidName = (MLRbyId.Masjid != null) ? MLRbyId.Masjid.Name : string.Empty, TimePeriod = MLRbyId.TimePeriod, AmountPaid = MLRbyId.AmountPaid, AmountNeeded = MLRbyId.AmountNeeded, LandArea = MLRbyId.LandArea, LandPrice = MLRbyId.LandPrice, PurchasingFrom = MLRbyId.PurchasingFrom, Doc1 = MLRbyId.Doc1, Doc2 = MLRbyId.Doc2, Doc3 = MLRbyId.Doc3, Pic1 = MLRbyId.Pic1, Pic2 = MLRbyId.Pic2, Pic3 = MLRbyId.Pic3, RequestSubmitId = MLRbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MLRbyId.Status, CreatedDate = MLRbyId.CreatedDate, RequestTypeId = MLRbyId.RequestTypeId, RequestTypeName = (MLRbyId.RequestType != null) ? MLRbyId.RequestType.Name : string.Empty, }; RequestCommentBs obj = new RequestCommentBs(); var GetCommentList = obj.BoardCommentList(id).ToList(); _MasjidLandRequestModel.RequestCommentList = GetCommentList; var PannelComments = obj.PanelCommentList(id).ToList(); _MasjidLandRequestModel.PanelCommentList = PannelComments; RequestApproveRejectBs obj1 = new RequestApproveRejectBs(); _MasjidLandRequestModel.ApprovedList = obj1.ApproveRejectDisplay(id).ToList(); PanelInvolveBs panelobject = new PanelInvolveBs(); _MasjidLandRequestModel.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); return(_MasjidLandRequestModel); }
public ActionResult Create(MasjidLandRequestModel 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 = 3; 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 = _MLRBs.Save(model); } if (result > 0) { _MLRModel.MasjidLists = _MLRBs.MasjidList().ToList(); _MLRModel.UserLists = _MLRBs.UserList().ToList(); _MLRModel.RequestTypeLists = _MLRBs.RequestTypeList().ToList(); TempData["message"] = "Request Submitted Successfully"; } return(RedirectToAction("Index", "UserRequest", new { area = "User" })); }
public MasjidLandRequestModel GetDetails(MasjidLandRequestModel model) { model = model ?? new MasjidLandRequestModel(); if (model.Id != 0) { model.MasjidLists = MasjidList(); model.RequestTypeLists = RequestTypeList(); model.UserLists = UserList(); model.MasjidLandRequestLists = MasjidLandRequestList(); } model.MasjidLandRequestLists = MasjidLandRequestList(); return(model); }
public ActionResult CommentOnMasjidLand(MasjidLandRequestModel 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) { _MLRModel = _MLRBs.GetById(Convert.ToInt32(id)); _MLRModel.UserLists = _MLRBs.UserList().ToList(); _MLRModel.MasjidLists = _MLRBs.MasjidList().ToList(); _MLRModel.RequestTypeLists = _MLRBs.RequestTypeList().ToList(); } else { _MLRModel.MasjidLists = _MLRBs.MasjidList().ToList(); _MLRModel.UserLists = _MLRBs.UserList().ToList(); _MLRModel.RequestTypeLists = _MLRBs.RequestTypeList().ToList(); } return(View(_MLRModel)); }
public MasjidLandRequestModel GetById(int id) { MasjidLandRequestModel _MasjidLandRequestModel = new MasjidLandRequestModel(); var MLRbyId = _tbl_MLR.GetById(id); MLRbyId = MLRbyId ?? new MasjidLandRequest(); _MasjidLandRequestModel = new MasjidLandRequestModel { Id = MLRbyId.Id, ShortDescription = MLRbyId.ShortDescription, UserId = MLRbyId.UserId, UserName = (MLRbyId.User != null) ? MLRbyId.User.UserName : string.Empty, Location = MLRbyId.Location, Area = MLRbyId.Area, MasjidId = MLRbyId.MasjidId, MasjidName = (MLRbyId.Masjid != null) ? MLRbyId.Masjid.Name : string.Empty, TimePeriod = MLRbyId.TimePeriod, AmountPaid = MLRbyId.AmountPaid, AmountNeeded = MLRbyId.AmountNeeded, LandArea = MLRbyId.LandArea, LandPrice = MLRbyId.LandPrice, PurchasingFrom = MLRbyId.PurchasingFrom, Doc1 = MLRbyId.Doc1, Doc2 = MLRbyId.Doc2, Doc3 = MLRbyId.Doc3, Pic1 = MLRbyId.Pic1, Pic2 = MLRbyId.Pic2, Pic3 = MLRbyId.Pic3, RequestSubmitId = MLRbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MLRbyId.Status, CreatedDate = MLRbyId.CreatedDate, RequestTypeId = MLRbyId.RequestTypeId, RequestTypeName = (MLRbyId.RequestType != null) ? MLRbyId.RequestType.Name : string.Empty, }; _MasjidLandRequestModel.RequestCommentList = new RequestCommentBs().BoardCommentList(id); _MasjidLandRequestModel.ApprovedList = new RequestApproveRejectBs().ApproveRejectDisplay(id); return(_MasjidLandRequestModel); }
public MasjidLandRequestModel GetByRequestId(int id, int UserTypeId, int userId) { MasjidLandRequestModel _MasjidLandRequestModel = new MasjidLandRequestModel(); var MLRbyId = _tbl_MLR.GetAll().Where(m => m.RequestSubmitId == id).FirstOrDefault(); MLRbyId = MLRbyId ?? new MasjidLandRequest(); _MasjidLandRequestModel = new MasjidLandRequestModel { Id = MLRbyId.Id, ShortDescription = MLRbyId.ShortDescription, UserId = MLRbyId.UserId, UserName = (MLRbyId.User != null) ? MLRbyId.User.UserName : string.Empty, Location = MLRbyId.Location, LandArea = MLRbyId.LandArea, LandPrice = MLRbyId.LandPrice, MasjidId = MLRbyId.MasjidId, MasjidName = (MLRbyId.Masjid != null) ? MLRbyId.Masjid.Name : string.Empty, TimePeriod = MLRbyId.TimePeriod, AmountPaid = MLRbyId.AmountPaid, AmountNeeded = MLRbyId.AmountNeeded, PurchasingFrom = MLRbyId.PurchasingFrom, Doc1 = MLRbyId.Doc1, Doc2 = MLRbyId.Doc2, Doc3 = MLRbyId.Doc3, Pic1 = MLRbyId.Pic1, Pic2 = MLRbyId.Pic2, Pic3 = MLRbyId.Pic3, RequestSubmitId = MLRbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MLRbyId.Status, CreatedDate = MLRbyId.CreatedDate, RequestTypeId = MLRbyId.RequestTypeId, RequestTypeName = (MLRbyId.RequestType != null) ? MLRbyId.RequestType.Name : string.Empty, }; RequestCommentBs obj = new RequestCommentBs(); var BoardComments = obj.BoardCommentList(id).ToList(); _MasjidLandRequestModel.BoardCommentList = BoardComments; var PannelComments = obj.PanelCommentList(id).ToList(); _MasjidLandRequestModel.PanelCommentList = PannelComments; if (UserTypeId == 6 || UserTypeId == 15) { _MasjidLandRequestModel.PanelCommentList = _MasjidLandRequestModel.PanelCommentList.Where(x => x.UserTypeId == 6 || x.UserTypeId == 15).ToList(); } else if (UserTypeId == 7 || UserTypeId == 13) { _MasjidLandRequestModel.PanelCommentList = _MasjidLandRequestModel.PanelCommentList.Where(x => x.UserTypeId == 7 || x.UserTypeId == 13).ToList(); } else if (UserTypeId == 8 || UserTypeId == 11) { _MasjidLandRequestModel.PanelCommentList = _MasjidLandRequestModel.PanelCommentList.Where(x => x.UserTypeId == 8 || x.UserTypeId == 11).ToList(); } else if (UserTypeId == 12 || UserTypeId == 14) { _MasjidLandRequestModel.PanelCommentList = _MasjidLandRequestModel.PanelCommentList.Where(x => x.UserTypeId == 12 || x.UserTypeId == 14).ToList(); } RequestApproveRejectBs obj1 = new RequestApproveRejectBs(); _MasjidLandRequestModel.ApprovedList = obj1.ApproveRejectDisplay(id).ToList(); _MasjidLandRequestModel.AlreadyExistsInMemberOpinion = _MasjidLandRequestModel.ApprovedList == null ? false : _MasjidLandRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MLRbyId.RequestSubmitId && m.UserId == userId).Any(); if (_MasjidLandRequestModel.AlreadyExistsInMemberOpinion) { _MasjidLandRequestModel.MemberOpinionId = _MasjidLandRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MLRbyId.RequestSubmitId).FirstOrDefault().Id; _MasjidLandRequestModel.IsAgreed = _MasjidLandRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MLRbyId.RequestSubmitId && m.UserId == userId).FirstOrDefault().IsApproved; _MasjidLandRequestModel.LikeStatus = _MasjidLandRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MLRbyId.RequestSubmitId && m.UserId == userId).FirstOrDefault().LikeStatus; } PanelInvolveBs panelobject = new PanelInvolveBs(); _MasjidLandRequestModel.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); _MasjidLandRequestModel.PaannelMemberLikeDisLike = obj1.ApproveRejectDisplay(id).ToList(); if (UserTypeId == 6 || UserTypeId == 15) { _MasjidLandRequestModel.PaannelMemberLikeDisLike = _MasjidLandRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 6 || x.UserTypeId == 15 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 7 || UserTypeId == 13) { _MasjidLandRequestModel.PaannelMemberLikeDisLike = _MasjidLandRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 7 || x.UserTypeId == 13 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 8 || UserTypeId == 11) { _MasjidLandRequestModel.PaannelMemberLikeDisLike = _MasjidLandRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 8 || x.UserTypeId == 11 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 12 || UserTypeId == 14) { _MasjidLandRequestModel.PaannelMemberLikeDisLike = _MasjidLandRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 12 || x.UserTypeId == 14 && x.LikeStatus != null)).ToList(); } return(_MasjidLandRequestModel); }
public MasjidLandRequestController() { _MLRModel = new MasjidLandRequestModel(); _MLRBs = new MasjidLandRequestBs(); }
public ActionResult ARMasjidLand(MasjidLandRequestModel 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)); }