public MasjidExtensionRequest(MasjidExtensionRequestModel _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 int Save(MasjidExtensionRequestModel model) { MasjidExtensionRequest _tbl_mer = new MasjidExtensionRequest(model); _RequestSubmitModel.ShortDesc = model.ShortDescription; _RequestSubmitModel.UserId = model.UserId; _RequestSubmitModel.RequestTypeId = model.RequestTypeId; _RequestSubmitModel.CreatedDate = Convert.ToDateTime(System.DateTime.Now); RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel); if (_tbl_mer.Id != null && _tbl_mer.Id != 0) { _tbl_mer.CreatedDate = Convert.ToDateTime(System.DateTime.Now); //_tblList.CreatedBy = 1; _tbl_MER.Update(_tbl_mer); } else { _requestSubmit = _RequestSubmit.Insert(_requestSubmit); _tbl_mer.RequestSubmitId = _requestSubmit.Id; _tbl_mer.CreatedDate = Convert.ToDateTime(System.DateTime.Now); //_tblList.CreatedBy = 1; _tbl_mer = _tbl_MER.Insert(_tbl_mer); } return(_tbl_mer.Id); }
public ActionResult ARMasjidExten(MasjidExtensionRequestModel 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("GetMasjidExtensionDetails", "RequestList", new { Id = _RequestApproveModel.RequestSubmitId })); }
public MasjidExtensionRequestModel GetByRequestSubmitIdBoard(int id, int userid) { MasjidExtensionRequestModel varList = new MasjidExtensionRequestModel(); var MERbyId = _tbl_MER.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault(); MERbyId = MERbyId ?? new MasjidExtensionRequest(); varList = new MasjidExtensionRequestModel { Id = MERbyId.Id, ShortDescription = MERbyId.ShortDescription, UserId = MERbyId.UserId, UserName = (MERbyId.User != null) ? MERbyId.User.UserName : string.Empty, Location = MERbyId.Location, Area = MERbyId.Area, MasjidId = MERbyId.MasjidId, MasjidName = (MERbyId.Masjid != null) ? MERbyId.Masjid.Name : string.Empty, ConstructionCost = MERbyId.ConstructionCost, ExistingFloors = MERbyId.ExistingFloors, AmountNeeded = MERbyId.AmountNeeded, Engineer = MERbyId.Engineer, Elevation = MERbyId.Elevation, Paln = MERbyId.Paln, Doc1 = MERbyId.Doc1, Doc2 = MERbyId.Doc2, Doc3 = MERbyId.Doc3, Pic1 = MERbyId.Pic1, Pic2 = MERbyId.Pic2, Pic3 = MERbyId.Pic3, RequestSubmitId = MERbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MERbyId.Status, CreatedDate = MERbyId.CreatedDate, RequestTypeId = MERbyId.RequestTypeId, RequestTypeName = (MERbyId.RequestType != null) ? MERbyId.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 == MERbyId.RequestSubmitId).Any(); if (varList.AlreadyExistsInMemberOpinion) { varList.MemberOpinionId = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MERbyId.RequestSubmitId).FirstOrDefault().Id; varList.IsAgreed = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MERbyId.RequestSubmitId).FirstOrDefault().IsApproved; varList.LikeStatus = varList.ApprovedList.Where(m => m.UserTypeId == userid && m.RequestSubmitId == MERbyId.RequestSubmitId).FirstOrDefault().LikeStatus; } PanelInvolveBs panelobject = new PanelInvolveBs(); varList.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); return(varList); }
public MasjidExtensionRequestBs() { _tbl_MER = new GenericPattern <MasjidExtensionRequest>(); _MasjidExtensionRequestModel = new MasjidExtensionRequestModel(); _RequestSubmit = new GenericPattern <RequestSubmit>(); _RequestSubmitModel = new RequestSubmitModel(); }
public MasjidExtensionRequestModel GetMasjidExtensionById(int id) { MasjidExtensionRequestModel _MasjidExtensionRequestModel = new MasjidExtensionRequestModel(); var MERbyId = _tbl_MER.GetAll().Where(x => x.RequestSubmitId == id).FirstOrDefault(); MERbyId = MERbyId ?? new MasjidExtensionRequest(); _MasjidExtensionRequestModel = new MasjidExtensionRequestModel { Id = MERbyId.Id, ShortDescription = MERbyId.ShortDescription, UserId = MERbyId.UserId, UserName = (MERbyId.User != null) ? MERbyId.User.UserName : string.Empty, Location = MERbyId.Location, Area = MERbyId.Area, MasjidId = MERbyId.MasjidId, MasjidName = (MERbyId.Masjid != null) ? MERbyId.Masjid.Name : string.Empty, ConstructionCost = MERbyId.ConstructionCost, ExistingFloors = MERbyId.ExistingFloors, AmountNeeded = MERbyId.AmountNeeded, Engineer = MERbyId.Engineer, Elevation = MERbyId.Elevation, Paln = MERbyId.Paln, Doc1 = MERbyId.Doc1, Doc2 = MERbyId.Doc2, Doc3 = MERbyId.Doc3, Pic1 = MERbyId.Pic1, Pic2 = MERbyId.Pic2, Pic3 = MERbyId.Pic3, RequestSubmitId = MERbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MERbyId.Status, CreatedDate = MERbyId.CreatedDate, RequestTypeId = MERbyId.RequestTypeId, RequestTypeName = (MERbyId.RequestType != null) ? MERbyId.RequestType.Name : string.Empty, }; RequestCommentBs obj = new RequestCommentBs(); var BoardComments = obj.BoardCommentList(id).ToList(); _MasjidExtensionRequestModel.BoardCommentList = BoardComments; var PannelComments = obj.PanelCommentList(id).ToList(); _MasjidExtensionRequestModel.PanelCommentList = PannelComments; RequestApproveRejectBs obj1 = new RequestApproveRejectBs(); _MasjidExtensionRequestModel.ApprovedList = obj1.ApproveRejectDisplay(id).ToList(); PanelInvolveBs panelobject = new PanelInvolveBs(); _MasjidExtensionRequestModel.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); return(_MasjidExtensionRequestModel); }
public MasjidExtensionRequestModel GetDetails(MasjidExtensionRequestModel model) { model = model ?? new MasjidExtensionRequestModel(); if (model.Id != 0) { model.MasjidLists = MasjidList(); model.RequestTypeLists = RequestTypeList(); model.UserLists = UserList(); model.MasjidExtensionRequestLists = MasjidExtensionRequestList(); } model.MasjidExtensionRequestLists = MasjidExtensionRequestList(); return(model); }
public ActionResult CommentOnMasjidExtension(MasjidExtensionRequestModel 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) { _MERModel = _MERBs.GetById(Convert.ToInt32(id)); _MERModel.UserLists = _MERBs.UserList().ToList(); _MERModel.MasjidLists = _MERBs.MasjidList().ToList(); _MERModel.RequestTypeLists = _MERBs.RequestTypeList().ToList(); } else { _MERModel.MasjidLists = _MERBs.MasjidList().ToList(); _MERModel.UserLists = _MERBs.UserList().ToList(); _MERModel.RequestTypeLists = _MERBs.RequestTypeList().ToList(); } return(View(_MERModel)); }
public MasjidExtensionRequestModel GetById(int id) { MasjidExtensionRequestModel _MasjidExtensionRequestModel = new MasjidExtensionRequestModel(); var MERbyId = _tbl_MER.GetById(id); MERbyId = MERbyId ?? new MasjidExtensionRequest(); _MasjidExtensionRequestModel = new MasjidExtensionRequestModel { Id = MERbyId.Id, ShortDescription = MERbyId.ShortDescription, UserId = MERbyId.UserId, UserName = (MERbyId.User != null) ? MERbyId.User.UserName : string.Empty, Location = MERbyId.Location, Area = MERbyId.Area, MasjidId = MERbyId.MasjidId, MasjidName = (MERbyId.Masjid != null) ? MERbyId.Masjid.Name : string.Empty, ConstructionCost = MERbyId.ConstructionCost, ExistingFloors = MERbyId.ExistingFloors, AmountNeeded = MERbyId.AmountNeeded, Engineer = MERbyId.Engineer, Elevation = MERbyId.Elevation, Paln = MERbyId.Paln, Doc1 = MERbyId.Doc1, Doc2 = MERbyId.Doc2, Doc3 = MERbyId.Doc3, Pic1 = MERbyId.Pic1, Pic2 = MERbyId.Pic2, Pic3 = MERbyId.Pic3, RequestSubmitId = MERbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MERbyId.Status, CreatedDate = MERbyId.CreatedDate, RequestTypeId = MERbyId.RequestTypeId, RequestTypeName = (MERbyId.RequestType != null) ? MERbyId.RequestType.Name : string.Empty, }; _MasjidExtensionRequestModel.RequestCommentList = new RequestCommentBs().BoardCommentList(id); _MasjidExtensionRequestModel.ApprovedList = new RequestApproveRejectBs().ApproveRejectDisplay(id); return(_MasjidExtensionRequestModel); }
public MasjidExtensionRequestModel GetByRequestId(int id, int UserTypeId, int userId) { MasjidExtensionRequestModel _MasjidExtensionRequestModel = new MasjidExtensionRequestModel(); var MERbyId = _tbl_MER.GetAll().Where(m => m.RequestSubmitId == id).FirstOrDefault(); MERbyId = MERbyId ?? new MasjidExtensionRequest(); _MasjidExtensionRequestModel = new MasjidExtensionRequestModel { Id = MERbyId.Id, ShortDescription = MERbyId.ShortDescription, UserId = MERbyId.UserId, UserName = (MERbyId.User != null) ? MERbyId.User.UserName : string.Empty, Location = MERbyId.Location, Area = MERbyId.Area, MasjidId = MERbyId.MasjidId, MasjidName = (MERbyId.Masjid != null) ? MERbyId.Masjid.Name : string.Empty, ExistingFloors = MERbyId.ExistingFloors, AmountNeeded = MERbyId.AmountNeeded, Engineer = MERbyId.Engineer, Elevation = MERbyId.Elevation, Paln = MERbyId.Paln, Doc1 = MERbyId.Doc1, Doc2 = MERbyId.Doc2, Doc3 = MERbyId.Doc3, Pic1 = MERbyId.Pic1, Pic2 = MERbyId.Pic2, Pic3 = MERbyId.Pic3, RequestSubmitId = MERbyId.RequestSubmitId, //RequestSubmitName= (item.RequestSubmit != null) ? item.RequestSubmit.Name : string.Empty, Status = MERbyId.Status, CreatedDate = MERbyId.CreatedDate, RequestTypeId = MERbyId.RequestTypeId, RequestTypeName = (MERbyId.RequestType != null) ? MERbyId.RequestType.Name : string.Empty, }; RequestCommentBs obj = new RequestCommentBs(); var BoardComments = obj.BoardCommentList(id).ToList(); _MasjidExtensionRequestModel.BoardCommentList = BoardComments; var PannelComments = obj.PanelCommentList(id).ToList(); _MasjidExtensionRequestModel.PanelCommentList = PannelComments; if (UserTypeId == 6 || UserTypeId == 15) { _MasjidExtensionRequestModel.PanelCommentList = _MasjidExtensionRequestModel.PanelCommentList.Where(x => x.UserTypeId == 6 || x.UserTypeId == 15).ToList(); } else if (UserTypeId == 7 || UserTypeId == 13) { _MasjidExtensionRequestModel.PanelCommentList = _MasjidExtensionRequestModel.PanelCommentList.Where(x => x.UserTypeId == 7 || x.UserTypeId == 13).ToList(); } else if (UserTypeId == 8 || UserTypeId == 11) { _MasjidExtensionRequestModel.PanelCommentList = _MasjidExtensionRequestModel.PanelCommentList.Where(x => x.UserTypeId == 8 || x.UserTypeId == 11).ToList(); } else if (UserTypeId == 12 || UserTypeId == 14) { _MasjidExtensionRequestModel.PanelCommentList = _MasjidExtensionRequestModel.PanelCommentList.Where(x => x.UserTypeId == 12 || x.UserTypeId == 14).ToList(); } RequestApproveRejectBs obj1 = new RequestApproveRejectBs(); _MasjidExtensionRequestModel.ApprovedList = obj1.ApproveRejectDisplay(id).ToList(); _MasjidExtensionRequestModel.AlreadyExistsInMemberOpinion = _MasjidExtensionRequestModel.ApprovedList == null ? false : _MasjidExtensionRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MERbyId.RequestSubmitId && m.UserId == userId).Any(); if (_MasjidExtensionRequestModel.AlreadyExistsInMemberOpinion) { _MasjidExtensionRequestModel.MemberOpinionId = _MasjidExtensionRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MERbyId.RequestSubmitId).FirstOrDefault().Id; _MasjidExtensionRequestModel.IsAgreed = _MasjidExtensionRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MERbyId.RequestSubmitId && m.UserId == userId).FirstOrDefault().IsApproved; _MasjidExtensionRequestModel.LikeStatus = _MasjidExtensionRequestModel.ApprovedList.Where(m => m.UserTypeId == UserTypeId && m.RequestSubmitId == MERbyId.RequestSubmitId && m.UserId == userId).FirstOrDefault().LikeStatus; } PanelInvolveBs panelobject = new PanelInvolveBs(); _MasjidExtensionRequestModel.PannelMemberInvolved = panelobject.InvolveList(id).ToList(); _MasjidExtensionRequestModel.PaannelMemberLikeDisLike = obj1.ApproveRejectDisplay(id).ToList(); if (UserTypeId == 6 || UserTypeId == 15) { _MasjidExtensionRequestModel.PaannelMemberLikeDisLike = _MasjidExtensionRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 6 || x.UserTypeId == 15 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 7 || UserTypeId == 13) { _MasjidExtensionRequestModel.PaannelMemberLikeDisLike = _MasjidExtensionRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 7 || x.UserTypeId == 13 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 8 || UserTypeId == 11) { _MasjidExtensionRequestModel.PaannelMemberLikeDisLike = _MasjidExtensionRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 8 || x.UserTypeId == 11 && x.LikeStatus != null)).ToList(); } else if (UserTypeId == 12 || UserTypeId == 14) { _MasjidExtensionRequestModel.PaannelMemberLikeDisLike = _MasjidExtensionRequestModel.PaannelMemberLikeDisLike.Where((x => x.UserTypeId == 12 || x.UserTypeId == 14 && x.LikeStatus != null)).ToList(); } return(_MasjidExtensionRequestModel); }
public ActionResult ARMasjidExtension(MasjidExtensionRequestModel 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(MasjidExtensionRequestModel 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 = 2; 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 = _MERBs.Save(model); } if (result > 0) { _MERModel.MasjidLists = _MERBs.MasjidList().ToList(); _MERModel.UserLists = _MERBs.UserList().ToList(); _MERModel.RequestTypeLists = _MERBs.RequestTypeList().ToList(); TempData["message"] = "Request Submitted Successfully"; } return(RedirectToAction("Index", "UserRequest", new { area = "User" })); }
public MasjidExtensionRequestController() { _MERModel = new MasjidExtensionRequestModel(); _MERBs = new MasjidExtensionRequestBs(); }