//[NoCache] ////[SessionExpire] //public ActionResult Details(int? id) //{ // TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); // TempData["BidMessage"] = ""; // TempData["BidAmount"] = ""; // TempData["AXPRFeeAmt"] = "0.00"; // TempData["AXPRFeeTotAmt"] = ""; // TempData["BidAmountinDollar"] = ""; // TempData["JobBiddingId"] = ""; // Session["Expired"] = "N"; // Session["FromDetails"] = "Y"; // dynamic model = new ExpandoObject(); // int gigid = id.GetValueOrDefault(); // Session["GigId"] = gigid; // if (gigid != 0) // { // objGigList = MatchBxCommon.GenerateBadge(objGigMod.GetGigPost(gigid)); // if (objGigList.Count() > 0) // { // objGigList.FirstOrDefault().GigSkillsMappingList = objGigMod.GetSkillsByGigId(gigid); // objGigList.FirstOrDefault().GigTrendingTagsMappingList = objGigMod.GetTagsByGigId(gigid); // objGig = objGigList.FirstOrDefault(); // // Session["JobPoster"] = objGig.UserId; // Session["GigCategory"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(objGig..ToLower()); // Session["GigCategoryHeader"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(objGig.Category.ToLower()); // if (Session["GigCategoryId"].ToString() == "0") // { // Session["GigCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase("ALL JOBS".ToLower()); // } // else // { // Session["GigCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(objGig.Category.ToLower()); // } // } // } // return View("Details", objGig); //} public ActionResult Search() { TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); Gig _Gig = new Gig(); GigModel _GigModel = new GigModel(); TrendingTagsModel _TrendingTagsModel = new TrendingTagsModel(); TrendingTags _TrendingTags = new TrendingTags(); _Gig.TrendingTagsIdList = "0"; _Gig.SkillsList = "0"; List <Gig> _GigList = _GigModel.GetGigDetails(_Gig).OrderByDescending(x => x.GigId).ToList <Gig>(); _TotalRecord = _GigList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _GigList.ForEach(x => x.Isloadmore = _loadmore); _GigList = _GigList.Take(_RecordDisplay).ToList(); dynamic model = new ExpandoObject(); model.Gig = MatchBxCommon.GenerateBadgeForGig(_GigList).OrderByDescending(x => x.GigId).ToList <Gig>(); model.TopJobSeekers = _GigModel.GetTopJobSeekers(_Gig); model.VerifiedPartners = objJobMod.GetVerifiedPartners(objJob); model.TrendingTags = _TrendingTagsModel.GetTrendingTagsForGig(_TrendingTags); model.messageSender = 0; return(View("Search", model)); }
public ActionResult Search() { Gig _Gig = new Gig(); GigModel _GigModel = new GigModel(); TrendingTagsModel _TrendingTagsModel = new TrendingTagsModel(); TrendingTags _TrendingTags = new TrendingTags(); _Gig.TrendingTagsIdList = "0"; _Gig.SkillsList = "0"; List <Gig> _GigList = _GigModel.GetGigDetails(_Gig); _TotalRecord = _GigList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _GigList.ForEach(x => x.Isloadmore = _loadmore); _GigList = _GigList.Take(_RecordDisplay).ToList(); dynamic model = new ExpandoObject(); model.Gig = MatchBxCommon.GenerateBadgeForGig(_GigList); model.TopJobSeekers = _GigModel.GetTopJobSeekers(_Gig); model.TrendingTags = _TrendingTagsModel.GetTrendingTagsForGig(_TrendingTags); return(View("Search", model)); }
public JsonResult PurchasedGigsLoadMore(int id) { objPurchasedGig.UserId = Convert.ToInt32(Session["PublicProfileId"]); objPurchasedGigList = MatchBxCommon.GenerateBadgeForGig(objGigMod.GetPurchasedGig(objPurchasedGig)); model.PurchasedGig = objPurchasedGigList.Where(x => x.GigSubscriptionId > id).ToList().Take(_RecordDisplay); return(Json(model.PurchasedGig, JsonRequestBehavior.AllowGet)); }
public bool ResetUserPassword(string email, string password) { MatchBXNotification objNotification = new MatchBXNotification(); MatchBXNotificationModel objNotiMod = new MatchBXNotificationModel(); objUsersList = objUsersMod.GetList("*", " Email = '" + email + "' and IsActive=1"); if (objUsersList.Count() > 0) { objUsers = objUsersList[0]; objUsers.Password = password; objNotification.ReceiverId = objUsers.UserId; objNotification.SenderId = objUsers.UserId; objNotification.ReadStatus = 0; objNotification.Notification = "Your password has been reset "; objNotification.Header = "Reset Password"; int returnValue = objUsersMod.Save(objUsers); if (returnValue > 0) { MatchBxCommon.sendResetPasswordAckEmail(objUsers, false); int retstatus = objNotiMod.Save(objNotification); TempData["ErrorMessage"] = "Your password has been reset successfully."; return(true); } else { TempData["ErrorMessage"] = "Password Reset Failed"; return(false); } } else { TempData["ErrorMessage"] = "The email is not registered for a Matchbx Account. Please try again"; return(false); } }
public bool SaveUserType(string type) { int tempuserid = Convert.ToInt32(Session["TempUserId"]); objUsersList = objUsersMod.GetList("*", " UserId = '" + tempuserid + "'"); if (objUsersList.Count() > 0) { objUsers = objUsersList[0]; objUsers.UserType = type; objUsers.ModifiedDate = DateTime.Now; int returnValue = objUsersMod.Save(objUsers); if (returnValue > 0) { string fullname = objUsers.FullName != null ? objUsers.FullName : "@" + objUsers.UserName; MatchBxCommon.verificationmail(fullname, objUsers.VerificationCode, objUsers.Email, false); return(true); } else { TempData["ErrorMessage"] = "User preference not saved"; return(false); } } else { TempData["ErrorMessage"] = "No such user exists"; return(false); } }
public JsonResult GigOffer(int GigSubscriptionId, string Status) { GigSubscription _GigSubscription = new GigSubscription(); GigSubscriptionModel _GigSubscriptionModel = new GigSubscriptionModel(); Gig _Gig = new Gig(); GigModel _GigModel = new GigModel(); _GigSubscription = _GigSubscriptionModel.GetARecord(GigSubscriptionId); _GigSubscription.Status = Status; _Gig = _GigModel.GetARecord(_GigSubscription.GigId); int UserId = _Gig.UserId; string GigTitle = _Gig.GigTitle; if (_GigSubscriptionModel.GigOfferAcceptorDecline(_GigSubscription).FirstOrDefault().JobId > 0) { _GigSubscription.JobId = _GigSubscriptionModel.GigOfferAcceptorDecline(_GigSubscription).FirstOrDefault().JobId; //objNotification.ReceiverId = UserId; //objNotification.SenderId = Convert.ToInt32(Session["UserId"]); //objNotification.ReadStatus = 0; //if (Status == "A") //{ // objNotification.Notification = "@" + Session["UserName"] + " has accepted your bid for job: " + JobTitle; // objNotification.Header = "Bid accepted"; //} //else //{ // objNotification.Notification = "Your job has been cancelled as it went against the terms of this jobsite"; // objNotification.Header = "Bid cancelled"; //} //objNotiMod.Save(objNotification); if (MatchBxCommon.checkuseremailpreferences("2,4", UserId) == true) { Users objUser = new Users(); objUser = objUsersMod.GetList("*", " UserId = '" + UserId + "'").FirstOrDefault(); string seekeremail = objUser.Email; string posterusername = "******" + Session["UserName"].ToString(); string seekerfullname = objUser.FullName != null ? objUser.FullName : objUser.UserName; if (Status == "A") { //MatchBxCommon.sendBidAcceptanceEmail(fullname, username, JobTitle, JobId, email, objJobbidding.BidAmount, false); } else { MatchBxCommon.sendGigDeclineEmail(seekerfullname, posterusername, GigTitle, seekeremail, false); } } } else { _GigSubscription.JobId = 0; } return(Json(_GigSubscription, JsonRequestBehavior.AllowGet)); }
public JsonResult CompletedJobLoadMore(int id, string skillid) { objCompletedJob.TrendingTagsIdList = "0"; objCompletedJob.SkillsList = skillid; objCompletedJob.JobSeekerId = Convert.ToInt32(Session["PublicProfileId"]); objCompletedJobList = MatchBxCommon.GenerateBadge(objJobMod.GetJobDetails(objCompletedJob)); model.CompletedJob = objCompletedJobList.Where(x => x.JobId < id).ToList().Take(_RecordDisplay); return(Json(model.CompletedJob, JsonRequestBehavior.AllowGet)); }
public JsonResult PostedJobs(string _searchtext, string trendingtagsid) { dynamic model = new ExpandoObject(); objJob.TrendingTagsIdList = trendingtagsid; objJob.SkillsList = "0"; objJob.SortBy = "N"; //if (Session["UserId"] != null) //{ // objJob.FromPage = "J"; //} //else //{ // objJob.FromPage = "B"; //} GetCategory(); objTrending.FromPage = category; List <Job> _JobList = new List <Job>(); objJobList = MatchBxCommon.GenerateBadge(objJobMod.GetJobDetails(objJob).OrderByDescending(x => x.Rownumber).ToList()); _JobList = objJobList; if (string.IsNullOrWhiteSpace(_searchtext)) { _TotalRecord = _JobList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _JobList.ForEach(x => x.Isloadmore = _loadmore); model.Job = _JobList.Take(_RecordDisplay).ToList(); } else { _JobList = objJobList.Where(p => p.JobDescription != null && p.JobDescription.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobTitle != null && p.JobTitle.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobCompletionDateDisplay != null && p.JobCompletionDateDisplay.ToLower().Contains(_searchtext.ToLower()) || p.TrendingTagsIdList != null && p.TrendingTagsIdList.ToLower().Contains(_searchtext.ToLower())).ToList(); _TotalRecord = _JobList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _JobList = _JobList.Take(_RecordDisplay).ToList(); _JobList.ForEach(x => x.Isloadmore = _loadmore); model.Job = _JobList.Take(_RecordDisplay).ToList(); } Session["DynModel"] = model; return(Json(model.Job, JsonRequestBehavior.AllowGet)); }
public JsonResult LoadTaggedCompletedJobs(string skillid) { objCompletedJob.TrendingTagsIdList = "0"; objCompletedJob.SkillsList = skillid; objCompletedJob.JobSeekerId = 1; objCompletedJobList = objJobMod.GetJobDetails(objCompletedJob); model.CompletedJob = MatchBxCommon.GenerateBadge(objCompletedJobList.Take(_RecordDisplay).ToList()); model.CompletedJobCount = objCompletedJobList.Count(); return(Json(model, JsonRequestBehavior.AllowGet)); }
public JsonResult ListedGigsLoadMore(int id, string skillid) { //objGig.TrendingTagsIdList = "0"; //objGig.SkillsList = "0"; objGig.UserId = Convert.ToInt32(Session["PublicProfileId"]); objGig.LoginUserId = Convert.ToInt32(Session["UserId"]); objGigList = MatchBxCommon.GenerateBadgeForGig(objGigMod.GetGigDetailsProfile(objGig)); model.ListedGig = objGigList.Where(x => x.GigId < id).ToList().Take(_RecordDisplay); return(Json(model.ListedGig, JsonRequestBehavior.AllowGet)); }
public ActionResult ResetPassword(MatchBX.Models.ResetPasswordViewModel model) { string decryptemail = MatchBxCommon.Decrypt(model.Email); if (ModelState.IsValid) { ResetUserPassword(decryptemail, model.Password); } return(View(model)); }
public ActionResult GigReviewProcess(string GigId, string UserId, string Email, int RejectionReason, int AdminUserId, string GigTitle, string CreatedDateDisplay) { TempData["BlockReason"] = _objUsrBlockModel.GetList(); TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList(); string _Message = ""; Gig _objgig = new Gig(); List <Gig> _lstGigs = new List <Gig>(); _lstGigs = _ObjGigModel.GetList("*", "GigId = " + GigId); _objgig = _lstGigs[0]; List <Users> _lstUsers = new List <Users>(); _lstUsers = _objUserModel.GetList("*", "UserId = " + UserId); _objUsers = _lstUsers[0]; _objgig.GigId = Convert.ToInt32(GigId); _objgig.CancelReason = RejectionReason; if (RejectionReason == 0) { _objgig.IsActive = "Y"; _objgig.GigStatus = GigLevel.Posted.ToString(); } else { _objgig.IsActive = "N"; _objgig.GigStatus = GigLevel.Failed.ToString(); } int Success = _ObjGigModel.Save(_objgig); if (Convert.ToInt32(Success) > 0) { if (RejectionReason == 0) { MatchBxCommon.sendGigApproveRejectEmailToUser(1, GigTitle, CreatedDateDisplay, Email); } else { MatchBxCommon.sendGigApproveRejectEmailToUser(0, GigTitle, CreatedDateDisplay, Email); } _Message = "Success"; } else { _Message = "Failed"; } return(Json(_Message, JsonRequestBehavior.AllowGet)); }
public ActionResult CalculateBudgetinDollar(string budget) { try { decimal bidbudget = Convert.ToDecimal(budget); decimal exchangerate = MatchBxCommon.GetExchangeRate(); decimal budgetindollar = bidbudget / exchangerate; return(Json(budgetindollar, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json("Exception", JsonRequestBehavior.AllowGet)); } }
public JsonResult ResendMail(int id) { objUsersList = objUsersMod.GetList("*", " UserId = '" + id + "'"); if (objUsersList.Count() > 0) { objUsers = objUsersList.FirstOrDefault(); string fullname = objUsers.FullName != null ? objUsers.FullName : "@" + objUsers.UserName; MatchBxCommon.verificationmail(fullname, objUsers.VerificationCode, objUsers.Email, false); return(Json("success", JsonRequestBehavior.AllowGet)); } else { return(Json("failed", JsonRequestBehavior.AllowGet)); } }
public ActionResult GigFeedbackReviewProcess(string GigReviewid, string UserId, string Email, int RejectionReason, int AdminUserId, string GigTitle, string CreatedDateDisplay) { string _Message = ""; GigReview _GigReview = new GigReview(); GigReviewModel _GigReviewModel = new GigReviewModel(); List <GigReview> _GigReviewList = _GigReviewModel.GetList("*", "GigReviewid = " + GigReviewid); _GigReview = _GigReviewList[0]; List <Users> _lstUsers = new List <Users>(); _lstUsers = _objUserModel.GetList("*", "UserId = " + UserId); _objUsers = _lstUsers[0]; _GigReview.GigReviewId = Convert.ToInt32(GigReviewid); //_GigReview.CancelReason = RejectionReason; if (RejectionReason == 0) { _GigReview.GigReviewStatus = GigLevel.Posted.ToString(); } else { _GigReview.GigReviewStatus = GigLevel.Failed.ToString(); } int Success = _GigReviewModel.Save(_GigReview); if (Convert.ToInt32(Success) > 0) { if (RejectionReason == 0) { MatchBxCommon.sendGigReviewApproveRejectEmailToUser(1, GigTitle, CreatedDateDisplay, Email); } else { MatchBxCommon.sendGigReviewApproveRejectEmailToUser(0, GigTitle, CreatedDateDisplay, Email); } _Message = "Success"; } else { _Message = "Failed"; } return(Json(_Message, JsonRequestBehavior.AllowGet)); }
public JsonResult LoadMoreGigs(int id, string _searchtext, string trendingtagsid) { dynamic model = new ExpandoObject(); Gig _Gig = new Gig(); GigModel _GigModel = new GigModel(); _Gig.TrendingTagsIdList = trendingtagsid; _Gig.SkillsList = "0"; List <Gig> _GigList = new List <Gig>(); List <Gig> objGigList = new List <Gig>(); objGigList = MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigDetails(_Gig).OrderByDescending(x => x.GigId).Where(x => x.GigId < id).ToList()); if (!string.IsNullOrEmpty(_searchtext)) { _GigList = objGigList.Where(p => p.GigDescription != null && p.GigDescription.ToLower().Contains(_searchtext.ToLower().Trim()) || p.GigTitle != null && p.GigTitle.ToLower().Contains(_searchtext.ToLower().Trim()) || p.GigDurationString != null && p.GigDurationString.ToLower().Contains(_searchtext.ToLower()) || p.TrendingTagsIdList != null && p.TrendingTagsIdList.ToLower().Contains(_searchtext.ToLower())).ToList(); _TotalRecord = _GigList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _GigList.ForEach(x => x.Isloadmore = _loadmore); model.Gig = _GigList.Take(_RecordDisplay); } else { _GigList = objGigList; _TotalRecord = _GigList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } _GigList.ForEach(x => x.Isloadmore = _loadmore); model.Gig = _GigList.Take(_RecordDisplay); } return(Json(model.Gig, JsonRequestBehavior.AllowGet)); }
public ActionResult CryptoExchange(int?id, FormCollection form) { string fba = form["fba"]; string fbb = form["fbb"]; string fbc = form["fbc"]; var price = MatchBxCommon.CoinConverter(fba, fbc, Convert.ToDecimal(fbb)); ViewBag.fba = fba; ViewBag.fbb = fbb; ViewBag.fbc = fbc; ViewBag.fbd = price; var Coins = MatchBxCommon.GetOnlyUsefullCoins(); return(View("CryptoExchange", Coins)); }
public ActionResult CreateGig(int?id) { Session["ExRate"] = MatchBxCommon.GetExchangeRate(); dynamic model = new ExpandoObject(); int gigid = id.GetValueOrDefault(); TempData["Category"] = objCatMod.GetList(); TempData["Tags"] = new List <TrendingTags>(); TempData["Skills"] = new List <Skills>(); //GetTagsnSkills(0); if (gigid != 0) { objGigList = objGigMod.GetGigPost(gigid); if (objGigList.Count() > 0) { TrendingTagsModel _TrendingTagsModel = new TrendingTagsModel(); SkillsModel _SkillsModel = new SkillsModel(); //TempData["Tags"] = objJobMod.GetTrendingTags(objJobList[0].JobCategoryId); //TempData["Skills"] = objJobMod.GetTopSkills(objJobList[0].JobCategoryId); if (gigid != 0) { TempData["Tags"] = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId); } else { TempData["Tags"] = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId + " and TagType = 'S'"); } TempData["Skills"] = _SkillsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId); objGigList.FirstOrDefault().GigSkillsMappingList = objGigMod.GetSkillsByGigId(gigid); objGigList.FirstOrDefault().GigTrendingTagsMappingList = objGigMod.GetTagsByGigId(gigid); objGigList.FirstOrDefault().GigDocumentsList = objGigMod.GetDocumentsByGigId(gigid); objGig = objGigList.FirstOrDefault(); objGig.BudgetInDollar = objGig.BudgetASP; objGig.BudgetASP = objGig.BudgetASP * (decimal)Session["ExRate"]; objGig.BudgetASPString = "$ " + objGig.BudgetASP.ToString("#,##0.00"); objGig.GigId = Convert.ToInt32(id); TempData["SelectedTags"] = objGig.GigTrendingTagsMappingList; TempData["SelectedSkills"] = objGig.GigSkillsMappingList; Session["TrendingTagsList"] = objGig.GigTrendingTagsMappingList; Session["SkillsList"] = objGig.GigSkillsMappingList; } } return(View("CreateGig", objGig)); }
public ActionResult Index(int?id, int?jid) { if (Session["UserType"] == null || Session["UserType"].ToString() != "4") { TempData["jid"] = jid.GetValueOrDefault(); //?redirecturl = "+ "Y"; return(RedirectToAction("Index", "Jobs", new{ @redirecturl = "Y" })); } else { TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); TempData["BlockReason"] = _objUsrBlockModel.GetList(); TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList(); ViewBag.pageIndex = id; if (id == 1) { ViewBag.pageTitle = "Manage User"; } else if (id == 2) { ViewBag.pageTitle = "Manage Jobs"; } else if (id == 3) { ViewBag.pageTitle = "Jobs pending to be approved"; } else if (id.GetValueOrDefault() == 0 && jid.GetValueOrDefault() == 0) { ViewBag.pageTitle = "Manage User"; } if (jid.GetValueOrDefault() != 0) { ViewBag.pageTitle = "Jobs pending to be approved"; ViewBag.pageIndex = 3; ViewBag.JobIndex = jid.GetValueOrDefault(); } return(View()); } }
public Task Execute(IJobExecutionContext context) { List <Job> _PendingList = new List <Job>(); JobModel _JobModelObj = new JobModel(); _PendingList = _JobModelObj.GetPendingJobsForApproval(new Job()); if (_PendingList != null && _PendingList.Count() > 0) { foreach (var item in _PendingList) { if (MatchBxCommon.sendPendingApprovalEmailToAdmin(1, item.JobTitle, item.JobId, item.Email, item.CreatedDateDisplay) == 1) { ReminderMails obj = new ReminderMails(); obj.JobId = item.JobId; ReminderMailsModel ReminderObj = new ReminderMailsModel(); ReminderObj.Save(obj); } } } return(Task.FromResult <object>(null)); }
public ActionResult JobReviewFilter(string _searchtext, int JobCategoryId, string SortBy) { JobModel _JobModel = new JobModel(); Job _Job = new Job(); _Job.JobCategoryId = JobCategoryId; _Job.SortBy = SortBy; List <Job> _JobList = new List <Job>(); _JobList = MatchBxCommon.GenerateBadge(_JobModel.GetJobReview(_Job)); if (_JobList.Count > 0) { foreach (Job _job in _JobList) { _JobList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP)); _JobList.ForEach(s => s.EndsIn = (s.JobCompletionDate.Subtract(DateTime.Now)).Days + " days, " + (s.JobCompletionDate.Subtract(DateTime.Now)).Hours + " hours"); } if (!String.IsNullOrEmpty(_searchtext)) { _JobList = _JobList.Where(p => p.JobDescription != null && p.JobDescription.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobTitle != null && p.JobTitle.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobCompletionDateDisplay != null && p.JobCompletionDateDisplay.ToLower().Contains(_searchtext.ToLower()) || p.TrendingTagsIdList != null && p.TrendingTagsIdList.ToLower().Contains(_searchtext.ToLower())).ToList(); } var objJobListFiltered = _JobList.GroupBy(x => x.JobId).Select(y => y.First()).ToList(); ReviewRecord = objJobListFiltered.Count(); if (ReviewRecord > recordDisplay) { reviewloadmore = 1; } else { reviewloadmore = 0; } objJobListFiltered.ForEach(x => x.Isloadmore = reviewloadmore); model.JobReview = objJobListFiltered.Take(recordDisplay).ToList(); return(Json(model.JobReview, JsonRequestBehavior.AllowGet)); } else { return(Json("Failed", JsonRequestBehavior.AllowGet)); } }
public ActionResult LoadMoreGig(string _searchtext, int JobCategoryId, string SortBy, int id) { GigModel _GigModel = new GigModel(); Gig _Gig = new Gig(); _Gig.JobCategoryId = JobCategoryId; _Gig.SortBy = SortBy; List <Gig> _GigList = new List <Gig>(); _GigList = SortBy == "N" ? (MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigReview(_Gig).Where(x => x.GigId < id).ToList())) : (MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigReview(_Gig).Where(x => x.GigId > id).ToList())); if (_GigList.Count > 0) { //foreach (Job _job in _JobList) //{ _GigList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP)); // _JobList.ForEach(s => s.EndsIn = (s.JobCompletionDate.Subtract(DateTime.Now)).Days + " days, " + (s.JobCompletionDate.Subtract(DateTime.Now)).Hours + " hours"); //} if (!String.IsNullOrEmpty(_searchtext)) { _GigList = _GigList.Where(p => p.GigDescription != null && p.GigDescription.ToLower().Contains(_searchtext.ToLower().Trim()) || p.GigTitle != null && p.GigTitle.ToLower().Contains(_searchtext.ToLower().Trim()) || p.TrendingTagsIdList != null && p.TrendingTagsIdList.ToLower().Contains(_searchtext.ToLower()) || p.SkillsList != null && p.SkillsList.ToLower().Contains(_searchtext.ToLower())).ToList(); } var objJobListFiltered = _GigList.GroupBy(x => x.GigId).Select(y => y.First()).ToList(); ReviewRecord = objJobListFiltered.Count(); if (ReviewRecord > recordDisplay) { reviewloadmore = 1; } else { reviewloadmore = 0; } objJobListFiltered.ForEach(x => x.Isloadmore = reviewloadmore); model.GigReview = objJobListFiltered.Take(recordDisplay); return(Json(model.GigReview, JsonRequestBehavior.AllowGet)); } else { return(Json("Failed", JsonRequestBehavior.AllowGet)); } }
public Task Execute(IJobExecutionContext context) { List <Gig> _PendingList = new List <Gig>(); GigModel _GigModelObj = new GigModel(); _PendingList = _GigModelObj.GetGigForApproval(new Gig()); if (_PendingList != null && _PendingList.Count() > 0) { foreach (var item in _PendingList) { if (MatchBxCommon.sendPendingGigApprovalEmailToAdmin(1, item.GigTitle, item.GigId, item.Email, item.CreatedDateDisplay) == 1) { ReminderMailsGig obj = new ReminderMailsGig(); obj.GigId = item.GigId; ReminderMailsGigModel ReminderObj = new ReminderMailsGigModel(); ReminderObj.Save(obj); } } } return(Task.FromResult <object>(null)); }
public void Send(int sendUserId, int receiverUserId, string roomId, string message, string type, decimal filesize, string filename, int messagejobID) { Business.MatchBXMessage _obj = new Business.MatchBXMessage(); Model.MatchBXMessageModel _model = new Model.MatchBXMessageModel(); _obj.SendUserId = sendUserId; _obj.ReceiverId = receiverUserId; _obj.Message = message; _obj.MessageType = type; _obj.FileSize = filesize; _obj.FileName = filename; _obj.JobId = messagejobID; _model.Save(_obj); Model.LoginModel _objLoginModel = new Model.LoginModel(); Business.Login _objLogin = new Business.Login(); _objLogin = _objLoginModel.CheckUserOnlineStatus(receiverUserId, sendUserId); Clients.All.addNewMessageToPage(message, receiverUserId, sendUserId, "Chat", _objLogin.IsOnline, roomId, type, filesize, filename, _objLogin.ProfilePic); if (_objLogin.IsMailSent == 0) { MatchBxCommon.OfflineMessageMail(sendUserId, receiverUserId, _model.Id); } }
public ActionResult JobCancelProcess(string JobId, string UserId, string Email, int CancelReason) { TempData["BlockReason"] = _objUsrBlockModel.GetList(); TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList(); Job _objJob = new Job(); List <Job> _lstJobs = new List <Job>(); _lstJobs = _ObjJobModel.GetList("*", "JobId = " + JobId); _objJob = _lstJobs[0]; List <Users> _lstUsers = new List <Users>(); _lstUsers = _objUserModel.GetList("*", "UserId = " + UserId); _objUsers = _lstUsers[0]; _objJob.JobId = Convert.ToInt32(JobId); _objJob.CancelReason = CancelReason; if (CancelReason == 0) { _objJob.IsActive = "Y"; } else { _objJob.IsActive = "N"; } int Success = _ObjJobModel.Save(_objJob); if (Convert.ToInt32(Success) > 0) { MatchBxCommon.CancelJobEmail(_objJob.JobTitle, _objUsers.FullName, Email, false); } return(View("Index")); }
public bool ValidateEmail(Users user) { string email = user.Email; objUsersList = objUsersMod.GetList("*", " Email = '" + email + "' and IsActive=1"); if (objUsersList.Count() > 0) { objUsers.UserId = objUsersList[0].UserId; objUsers.Password = objUsersList[0].Password; objUsers.Email = objUsersList[0].Email; objUsers.FullName = objUsersList[0].FullName; objUsers.UserName = objUsersList[0].UserName; MatchBxCommon.sendForgetPasswordEmail(objUsers, false); TempData["ErrorMessage"] = "Instructions to reset your password have been sent to your e-mail address. If you need further assistance, please contact [email protected]"; TempData["Status"] = "true"; return(true); } else { TempData["ErrorMessage"] = "Account with specified email not found."; TempData["Status"] = "false"; return(false); } }
//[SessionExpire] public ActionResult Index(int?id) { TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); TempData["RecordDisplay"] = _RecordDisplay; //Session["ProfilePic"] = "/Content/images/client_pic_1.png"; int userid = id.GetValueOrDefault(); if (userid.ToString() != null) { Session["MemberNo"] = userid; Session["PublicProfileId"] = userid; // Gus: 2FA TwoFactorAuthenticator tfa = new TwoFactorAuthenticator(); string useruniquekey = Convert.ToString(userid) + Session["UserName"]; Session["Useruniquekey"] = useruniquekey; var setupinfo = tfa.GenerateSetupCode("MatchBX-" + Session["email"], useruniquekey, 280, 280); ViewBag.qrcode = setupinfo.QrCodeSetupImageUrl; ViewBag.manualcode = setupinfo.ManualEntryKey; } objProfile = objProfileMod.LoadUserProfile(userid).FirstOrDefault(); try { string rating = Adjust(decimal.ToDouble(objProfile.Rating)).ToString(); if (rating.Contains('.')) { string[] parts = rating.Split('.'); TempData["RatingWhole"] = parts[0]; if (parts[1] != null) { TempData["RatingFraction"] = parts[1]; } else { TempData["RatingFraction"] = 0; } } else { TempData["RatingWhole"] = rating; TempData["RatingFraction"] = 0; } } catch (Exception ex) { } model.Profile = objProfile; objUserSkillList = objUserSkill.SkillsByUserId(userid); objUserSkillList.ToList().ForEach(x => x.Description = "#" + x.Description.ToString()); string userskilllist = ""; foreach (var item in objUserSkillList) { if (objUserSkillList.IndexOf(item) == objUserSkillList.Count - 1) { userskilllist += item.Description; } else { userskilllist += item.Description + ", "; } } model.UserSkill = objUserSkillList; model.Skill = userskilllist; if (userid != 0) { objJob.TrendingTagsIdList = "0"; objJob.SkillsList = "0"; objJob.UserId = userid; Session["PublicProfileId"] = userid; objCompletedJob.TrendingTagsIdList = "0"; objCompletedJob.SkillsList = "0"; objCompletedJob.JobSeekerId = userid; objCompletedJob.FromPage = "J"; objJob.FromPage = "J"; //objGig.TrendingTagsIdList = "0"; //objGig.SkillsList = "0"; objGig.UserId = userid; objGig.LoginUserId = Convert.ToInt32(Session["UserId"]); objPurchasedGig.UserId = userid; objCompletedJobList = objJobMod.GetJobDetails(objCompletedJob); model.CompletedJobCount = objCompletedJobList.Count(); model.CompletedJob = MatchBxCommon.GenerateBadge(objCompletedJobList.Take(_RecordDisplay).ToList()); objJobList = objJobMod.GetJobDetails(objJob); model.ListedJobCount = objJobList.Count(); model.ListedJob = MatchBxCommon.GenerateBadge(objJobList.Take(_RecordDisplay).ToList()); objGigList = objGigMod.GetGigDetailsProfile(objGig); model.ListedGigCount = objGigList.Count(); model.ListedGig = MatchBxCommon.GenerateBadgeForGig(objGigList.Take(_RecordDisplay).ToList()); //model.UserSkill = objUserSkill.LoadSkillsByUserId(userid); objPurchasedGigList = objGigMod.GetPurchasedGig(objPurchasedGig); model.PurchasedGigCount = objPurchasedGigList.Count(); model.PurchasedGig = MatchBxCommon.GenerateBadgeForGig(objPurchasedGigList.Take(_RecordDisplay).ToList()); model.WithID = "Y"; } else { model.WithID = "N"; } model.messageSender = 0; //model.Job.messageSender=0; return(View("Index", model)); }
//[SessionExpire] public ActionResult CryptoExchange(int?id) { var Coins = MatchBxCommon.GetOnlyUsefullCoins(); return(View("CryptoExchange", Coins)); }
public ActionResult Details(int?id, int?subid, string type = "") { TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); TempData["BidMessage"] = ""; TempData["GigAmount"] = ""; TempData["AXPRFeeAmt"] = "0.00"; TempData["AXPRFeeTotAmt"] = ""; TempData["BidAmountinDollar"] = ""; TempData["GigSubscriptionId"] = 0; TempData["GigCompletionDate"] = ""; TempData["GigTitle"] = string.Empty; TempData["GigCompletionDate"] = ""; TempData["JobCompletionDateDisplay"] = ""; //Session["Expired"] = "N"; //Session["FromDetails"] = "Y"; Session["GigSubDocMasterList"] = null; Session["GigSubDocList"] = null; TempData["NoofDocuments"] = 0; TempData["GigSubscriptionStatus"] = "S"; dynamic model = new ExpandoObject(); GigModel _GigModel = new GigModel(); GigReviewModel _GigReviewModel = new GigReviewModel(); Gig _Gig = new Gig(); int gigid = id.GetValueOrDefault(); Session["GigId"] = gigid; Session["SubGigId"] = subid.GetValueOrDefault(); if (gigid != 0) { List <Gig> _GigList = MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigPost(gigid)); if (_GigList.Count() > 0) { _GigList.FirstOrDefault().GigSkillsMappingList = _GigModel.GetSkillsByGigId(gigid); _GigList.FirstOrDefault().GigTrendingTagsMappingList = _GigModel.GetTagsByGigId(gigid); _Gig = _GigList.FirstOrDefault(); Session["JobPoster"] = _Gig.UserId; Session["JobCategory"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower()); Session["JobCategoryHeader"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower()); if (Session["JobCategoryId"] != null && Session["JobCategoryId"].ToString() == "0") { Session["JobCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase("ALL SERVICES".ToLower()); } else { Session["JobCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower()); } decimal exchangerate = MatchBxCommon.GetExchangeRate(); decimal bid = Convert.ToDecimal(_Gig.BudgetASP); decimal perc = (Convert.ToDecimal(bid) * 3) / 100; TempData["AXPRFeeAmt"] = perc.ToString("#,##0.00"); string totalfees = (bid + perc).ToString("#,##0.00"); TempData["AXPRFeeTotAmt"] = totalfees; TempData["GigAmount"] = _Gig.BudgetASP.ToString() + " AXPR"; //TempData["BidAmountinDollar"] = (Math.Round(exchangerate * (bid + perc), 2)).ToString("#,##0.00"); TempData["BidAmountinDollar"] = (Math.Round(exchangerate * (bid), 2)).ToString("#,##0.00"); UserProfileModel objProfileMod = new UserProfileModel(); UserProfile objProfile = new UserProfile(); objProfile = objProfileMod.LoadUserProfile(_Gig.UserId).FirstOrDefault(); _Gig.ProfilePic = objProfile.ProfilePic; if (type == "R") { var _SubObj = new GigSubscription(); _SubObj.GigId = Convert.ToInt32(id); _Gig.GigSubscriptionList = new GigSubscriptionModel().GetGigSubscriptions(_SubObj); } else if (type == "A") { var _SubObj = new GigSubscription(); _SubObj.GigId = Convert.ToInt32(id); _Gig.GigActiveOrdersList = new GigSubscriptionModel().GetActiveOrders(_SubObj); } else if (type == "C") { var _SubObj = new GigSubscription(); _SubObj.GigId = Convert.ToInt32(id); _Gig.GigCompletedOrdersList = new GigSubscriptionModel().GetCompletedOrders(_SubObj); } _Gig.GigReviewList = _GigReviewModel.GetReviewForGig(gigid); if (_Gig.GigReviewList.Count > _RecordDisplay) { _Gig.GigReviewList.ForEach(s => s.Isloadmore = 1); } else { _Gig.GigReviewList.ForEach(s => s.Isloadmore = 0); } TempData["ReviewCount"] = _Gig.GigReviewList.Count(); _Gig.GigReviewList = _Gig.GigReviewList.Take(_RecordDisplay).ToList(); try { string rating = Adjust(decimal.ToDouble(objProfile.Rating)).ToString(); TempData["Rating"] = rating; TempData["RatingCount"] = Adjust(decimal.ToDouble(objProfile.RatingCount)).ToString(); if (rating.Contains('.')) { string[] parts = rating.Split('.'); TempData["RatingWhole"] = parts[0]; if (parts[1] != null) { TempData["RatingFraction"] = parts[1]; } else { TempData["RatingFraction"] = 0; } } else { TempData["RatingWhole"] = rating; TempData["RatingFraction"] = 0; } } catch (Exception ex) { } if (Convert.ToInt32(Session["UserId"]) != _Gig.UserId) { if (subid.GetValueOrDefault() > 0) { GigSubscription _GigSubscription = new GigSubscription(); GigSubscriptionModel _GigSubscriptionModel = new GigSubscriptionModel(); _GigSubscription.GigSubscriptionId = subid.GetValueOrDefault(); List <GigSubscription> _GigSubscriptionList = _GigSubscriptionModel.LoadSubscriptionDetails(_GigSubscription); if (_GigSubscriptionList.Count() > 0) { TempData["BidMessage"] = _GigSubscriptionList.FirstOrDefault().Description; TempData["GigTitle"] = _GigSubscriptionList.FirstOrDefault().Title; TempData["GigCompletionDate"] = _GigSubscriptionList.FirstOrDefault().JobCompletionDate; TempData["GigSubscriptionId"] = _GigSubscriptionList.FirstOrDefault().GigSubscriptionId; TempData["JobCompletionDateDisplay"] = _GigSubscriptionList.FirstOrDefault().JobCompletionDateDisplay; TempData["NoofDocuments"] = _GigSubscriptionList.FirstOrDefault().NoofDocuments; TempData["GigSubscriptionStatus"] = _GigSubscriptionList.FirstOrDefault().GigSubscriptionStatus; } } } } } return(View("Details", _Gig)); }
public ActionResult SaveGigSubscription(int GigId, int JobPosterId, string Description, string JobCompletionDate, string Title, int GigSubscriptionId) { GigSubscription _GigSubscription = new GigSubscription(); GigSubscriptionModel _GigSubscriptionModel = new GigSubscriptionModel(); string message = "failed"; _GigSubscription.GigId = GigId; _GigSubscription.JobPosterId = JobPosterId; _GigSubscription.Description = Description; _GigSubscription.GigSubscriptionId = GigSubscriptionId; //CultureInfo culture = new CultureInfo("en-US"); //DateTime tempDate = Convert.ToDateTime(JobCompletionDate, culture); DateTime tempDate = DateTime.ParseExact(JobCompletionDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); _GigSubscription.JobCompletionDate = tempDate; _GigSubscription.IsActive = "Y"; _GigSubscription.GigSubscriptionStatus = "S"; _GigSubscription.Title = Title; List <GigSubscriptionDocument> fileList = new List <GigSubscriptionDocument>(); List <GigSubscriptionDocument> fileUpdatedList = new List <GigSubscriptionDocument>(); if (TempData["fileList"] != null) { fileList = (List <GigSubscriptionDocument>)TempData.Peek("fileList"); } if (Session["GigSubDocMasterList"] != null) { fileUpdatedList = (List <GigSubscriptionDocument>)Session["GigSubDocMasterList"]; } if (GigId != 0) { if (Convert.ToInt32(_GigSubscription.GigSubscriptionDocumentList.Count) == 0) { if (fileList != null) { foreach (var file in fileList) { _GigSubscription.GigSubscriptionDocumentList.Add(new GigSubscriptionDocument() { DocumentName = file.DocumentName.ToString(), IsActive = "Y", FileSize = file.FileSize }); } } if (fileUpdatedList != null) { foreach (var file in fileUpdatedList) { _GigSubscription.GigSubscriptionDocumentList.Add(new GigSubscriptionDocument() { DocumentName = file.DocumentName.ToString(), IsActive = file.IsActive, FileSize = file.FileSize, GigSubscriptionDocumentId = file.GigSubscriptionDocumentId, GigSubscriptionId = file.GigSubscriptionId, CreatedDate = file.CreatedDate }); } } } } var gigId = 0; if ((gigId = _GigSubscriptionModel.SaveWithTransaction(_GigSubscription)) > 0) { Users _objuser = new Users(); UsersModel objUsersMod = new UsersModel(); if (Convert.ToInt32(Session["UserType"]) == 1) { _objuser.UserId = Convert.ToInt32(Session["UserId"]); _objuser.UserType = "3"; int returnvalue = objUsersMod.ChangeUserRole(_objuser); if (returnvalue > 0) { Session["UserType"] = "3"; } } message = "success"; if (MatchBxCommon.checkuseremailpreferences("4,5", Convert.ToInt32(Session["UserId"])) == true) { try { Gig _objGig = new Gig(); GigModel _objGigModel = new GigModel(); _objGig = _objGigModel.GetARecord(GigId); _objuser = objUsersMod.GetList("*", " UserId = '" + _objGig.UserId + "'").FirstOrDefault(); string email = _objuser.Email; string fullname = _objuser.FullName != null ? _objuser.FullName : _objuser.UserName; MatchBxCommon.sendGigOfferEmail(email, false, Session["UserName"].ToString(), Title, fullname); } catch (Exception e) { } } Session["GigSubDocMasterList"] = null; Session["GigSubDocList"] = null; } return(Json(message, JsonRequestBehavior.AllowGet)); }