Пример #1
0
        //[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));
        }
Пример #2
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));
        }
Пример #3
0
        public ActionResult GetTagsnSkills(int category, int jobId)
        {
            //TempData["Tags"] = objJobMod.GetTrendingTags(category);
            TrendingTagsModel _TrendingTagsModel = new TrendingTagsModel();
            SkillsModel       _SkillsModel       = new SkillsModel();
            Job _objJobList = new Job();

            if (jobId != 0)
            {
                _objJobList.TrendingTagsList = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + category);
                TempData["Tags"]             = _objJobList.TrendingTagsList;
            }
            else
            {
                _objJobList.TrendingTagsList = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + category + " and TagType = 'S'");
                TempData["Tags"]             = _objJobList.TrendingTagsList;
            }
            //TempData["Skills"] = objJobMod.GetTopSkills(category);

            //_objJobList.TrendingTagsList =  objJobMod.GetTrendingTags(category);

            //_objJobList.JobSkillsList = objJobMod.GetTopSkills(category);
            _objJobList.JobSkillsList = _SkillsModel.GetList(" * ", " JobCategoryId = " + category);
            TempData["Skills"]        = _objJobList.JobSkillsList;
            return(Json(_objJobList, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }
Пример #6
0
        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));
        }