Exemple #1
0
        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));
        }
        //[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));
        }
Exemple #3
0
        public List <TrendingTags> GetTrendingTags(int JobCategoryId)
        {
            TrendingTags _object = new TrendingTags();

            _object.JobCategoryId = JobCategoryId;
            return(base.GetCustomFunction <TrendingTags>("spGetTrendingTags", _object));
        }
        public ActionResult SaveGig(Gig gig)
        {
            string message = "";

            if (ModelState.IsValid)
            {
                //job.JobTitle = ToCamelCase(job.JobTitle);
                if (Convert.ToInt32(gig.GigTrendingTagsMappingList.Count) == 0)
                {
                    if (Session["TrendingTagsList"] != null)
                    {
                        gig.GigTrendingTagsMappingList = (List <GigTrendingTagsMapping>)Session["TrendingTagsList"];
                    }
                }

                if (Convert.ToInt32(gig.GigSkillsMappingList.Count) == 0)
                {
                    if (Session["SkillsList"] != null)
                    {
                        gig.GigSkillsMappingList = (List <GigSkillsMapping>)Session["SkillsList"];
                    }
                }


                gig.UserId = Convert.ToInt32(Session["UserId"]);


                List <GigDocuments> fileList = new List <GigDocuments>();

                if (TempData["fileList"] != null)
                {
                    fileList = (List <GigDocuments>)TempData.Peek("fileList");
                }

                if (gig != null)
                {
                    if (Convert.ToInt32(gig.GigDocumentsList.Count) == 0)
                    {
                        if (fileList != null)
                        {
                            foreach (var file in fileList)
                            {
                                gig.GigDocumentsList.Add(new GigDocuments()
                                {
                                    DocumentName = file.DocumentName.ToString(), IsActive = "Y", FileSize = file.FileSize
                                });
                            }
                        }
                    }
                }

                var _tagsObjModel = new TrendingTagsModel();
                foreach (var item in gig.GigTrendingTagsMappingList)
                {
                    if (item.TrendingTagsId == 0)
                    {
                        var _trendingTag = new TrendingTags()
                        {
                            Description    = item.Description,
                            TrendingTagsId = item.TrendingTagsId,
                            JobCategoryId  = gig.JobCategoryId,
                            TagType        = "U"
                        };
                        item.TrendingTagsId = objTrendingMod.Save(_trendingTag);
                    }
                }
                var gigId = 0;
                if ((gigId = objGigMod.SaveWithTransaction(gig)) > 0)
                {
                    if (Session["UserType"] != null && Session["UserType"].ToString() == "2")
                    {
                        Session["UserType"] = "3";
                        UsersModel _Model   = new UsersModel();
                        Users      _userobj = new Users();
                        _userobj.UserId   = Convert.ToInt32(Session["UserId"]);
                        _userobj.UserType = Session["UserType"].ToString();
                        int k = _Model.ChangeUserRole(_userobj);
                    }
                    if (gig.GigId > 0)
                    {
                        message = "Your service has been edited and is now pending for approval";
                        MatchBxCommon.sendGigPostedEmailToAdmin(2, gig.GigTitle, gig.GigId);
                        TempData["CreateGig"] = gig.GigId;
                        TempData["DeleteGig"] = 0;
                    }
                    else
                    {
                        message = "Your service has been created and is now pending for approval";
                        MatchBxCommon.sendGigPostedEmailToAdmin(1, gig.GigTitle, gigId);
                        TempData["CreateGig"] = 0;
                        TempData["DeleteGig"] = 0;
                    }

                    TempData.Remove("fileList");
                    Session["FileList"]   = null;
                    Session["GigCreated"] = "Y";
                }
                else
                {
                    if (gig.GigId > 0)
                    {
                        message = "Failed to edit service";
                    }
                    else
                    {
                        message = "Failed to create service";
                    }

                    TempData.Remove("fileList");
                    Session["FileList"] = null;

                    Session["GigCreated"] = "N";
                }
                if (Convert.ToInt32(Session["UserType"]) != 3)
                {
                    Session["FirstLogin"] = "******";
                }
            }
            else
            {
                message = "Failed to create service";

                TempData.Remove("fileList");
                Session["FileList"]   = null;
                Session["GigCreated"] = "N";
                Session["FirstLogin"] = "******";
            }

            return(Json(message, JsonRequestBehavior.AllowGet));
        }
 public List <TrendingTags> GetTrendingTagsForGig(TrendingTags _object)
 {
     return(base.GetCustomFunction <TrendingTags>("spGetTrendingTagsForGig", _object));
 }
        public int Save(TrendingTags _object)
        {
            int _returnValue = base.Save <TrendingTags>("spAddEditTrendingTags", _object);

            return(_returnValue);
        }
        public ActionResult SaveJob(Job job)
        {
            string message = "";

            if (ModelState.IsValid)
            {
                //job.JobTitle = ToCamelCase(job.JobTitle);
                if (Convert.ToInt32(job.JobTrendingTagsMappingList.Count) == 0)
                {
                    if (Session["TrendingTagsList"] != null)
                    {
                        job.JobTrendingTagsMappingList = (List <JobTrendingTagsMapping>)Session["TrendingTagsList"];
                    }
                }

                if (Convert.ToInt32(job.JobSkillsMappingList.Count) == 0)
                {
                    if (Session["SkillsList"] != null)
                    {
                        job.JobSkillsMappingList = (List <JobSkillsMapping>)Session["SkillsList"];
                    }
                }


                job.UserId = Convert.ToInt32(Session["UserId"]);


                List <JobDocuments> fileList = new List <JobDocuments>();

                if (TempData["fileList"] != null)
                {
                    fileList = (List <JobDocuments>)TempData.Peek("fileList");
                }

                if (job != null)
                {
                    if (Convert.ToInt32(job.JobDocumentsList.Count) == 0)
                    {
                        if (fileList != null)
                        {
                            foreach (var file in fileList)
                            {
                                job.JobDocumentsList.Add(new JobDocuments()
                                {
                                    DocumentName = file.DocumentName.ToString(), IsActive = "Y", Filesize = file.Filesize
                                });
                            }
                        }
                    }
                }

                var _tagsObjModel = new TrendingTagsModel();
                foreach (var item in job.JobTrendingTagsMappingList)
                {
                    if (item.TrendingTagsId == 0)
                    {
                        var _trendingTag = new TrendingTags()
                        {
                            Description    = item.Description,
                            TrendingTagsId = item.TrendingTagsId,
                            JobCategoryId  = job.JobCategoryId,
                            TagType        = "U"
                        };
                        item.TrendingTagsId = objTrendingMod.Save(_trendingTag);
                    }
                }
                var jobId = 0;
                if ((jobId = objJobMod.SaveWithTransaction(job)) > 0)
                {
                    if (Session["UserType"] != null && Session["UserType"].ToString() == "1")
                    {
                        Session["UserType"] = "3";
                        UsersModel _Model   = new UsersModel();
                        Users      _userobj = new Users();
                        _userobj.UserId   = Convert.ToInt32(Session["UserId"]);
                        _userobj.UserType = Session["UserType"].ToString();
                        int k = _Model.ChangeUserRole(_userobj);
                    }
                    if (job.JobId > 0)
                    {
                        message = "Your job has been edited and is now pending for approval";
                        MatchBxCommon.sendJobPostedEmailToAdmin(2, job.JobTitle, job.JobId);
                        TempData["postJob"]   = job.JobId;
                        TempData["DeleteJob"] = 0;
                    }
                    else
                    {
                        // message = "Your job has been posted and is now live";
                        message = "Your job has been posted and is now pending for approval";
                        MatchBxCommon.sendJobPostedEmailToAdmin(1, job.JobTitle, jobId);
                        TempData["postJob"]   = 0;
                        TempData["DeleteJob"] = 0;
                    }

                    TempData.Remove("fileList");
                    Session["FileList"]  = null;
                    Session["JobPosted"] = "Y";
                }
                else
                {
                    if (job.JobId > 0)
                    {
                        message = "Failed to edit job";
                    }
                    else
                    {
                        message = "Failed to post job";
                    }

                    TempData.Remove("fileList");
                    Session["FileList"] = null;

                    Session["JobPosted"] = "N";
                }
                if (Convert.ToInt32(Session["UserType"]) != 3)
                {
                    Session["FirstLogin"] = "******";
                }
            }
            else
            {
                message = "Failed to post job";

                TempData.Remove("fileList");
                Session["FileList"]   = null;
                Session["JobPosted"]  = "N";
                Session["FirstLogin"] = "******";
            }

            return(Json(message, JsonRequestBehavior.AllowGet));
        }