예제 #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 async Task <IHttpActionResult> Put(int id, GigModel model)
        {
            try
            {
                var gig = await this.gigRepository.FindGigDetails(id);

                if (gig == null)
                {
                    return(this.NotFound());
                }

                if (id != model.Id)
                {
                    return(this.BadRequest());
                }

                this.mapper.Map(model, gig);

                if (await this.gigRepository.Update(gig))
                {
                    return(this.Ok(this.mapper.Map <GigModel>(gig)));
                }
                else
                {
                    return(this.InternalServerError());
                }
            }
            catch (Exception ex)
            {
                return(this.InternalServerError(ex));
            }
        }
예제 #3
0
        public void GigModel_WhenGivenValidData_StoresValidData()
        {
            /* Arrange */

            // Create a Mocked IHostingEnviornment
            var mockHostEnv = new Mock <IHostingEnvironment>();

            //Create a Gig Model
            var model = new GigModel();

            //create valid data
            var view  = "ensemble";
            var gig   = new Gig();
            var venue = new Venue();

            /* Act */
            model.ViewType = view;
            model.Gig      = gig;
            model.Venue    = venue;

            /* Assert */
            Assert.IsType <string>(model.ViewType);
            Assert.IsType <Gig>(model.Gig);
            Assert.IsType <Venue>(model.Venue);
        }
예제 #4
0
        public async Task <IHttpActionResult> Post(GigModel model)
        {
            try
            {
                if (await this.gigRepository.FindGigDetails(model.Id) != null)
                {
                    ModelState.AddModelError("GigId", "Gig in use");
                }

                if (ModelState.IsValid)
                {
                    var gig = this.mapper.Map <Gig>(model);

                    if (await this.gigRepository.Insert(gig))
                    {
                        var newModel = this.mapper.Map <GigModel>(gig);
                        return(this.CreatedAtRoute("GetGig", new { id = newModel.Id }, newModel));
                    }
                }
            }
            catch (Exception ex)
            {
                return(this.InternalServerError(ex));
            }

            return(this.BadRequest(this.ModelState));
        }
예제 #5
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));
        }
예제 #6
0
        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));
        }
예제 #7
0
        public JsonResult GetAutomatedSearchForGigs(string _searchtext)
        {
            GigModel _objMod = new GigModel();
            Gig      _objBus = new Gig();

            _objBus.searchText = _searchtext;
            List <Gig> _GigList = new List <Gig>();

            _GigList = _objMod.GetAutomatedGigsForGigReview(_objBus);
            return(Json(_GigList, JsonRequestBehavior.AllowGet));
        }
예제 #8
0
        public JsonResult GetAutomatedSearch(string _searchtext)
        {
            GigModel _GigModel = new GigModel();
            dynamic  model     = new ExpandoObject();
            Gig      _Gig      = new Gig();

            _Gig.searchText = _searchtext;
            List <Gig> _GigList = new List <Gig>();

            _GigList = _GigModel.GetAutomatedGigForTrendingTags(_Gig);
            return(Json(_GigList, JsonRequestBehavior.AllowGet));
        }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            client.BaseAddress = baseAddress;
            gig    = new GigModel();
            userID = (int)Session["UserID"];
            HttpResponseMessage resp = client.GetAsync(client.BaseAddress + "/api/User/GetUserByID/" + userID).Result;

            if (resp.IsSuccessStatusCode)
            {
                string data = resp.Content.ReadAsStringAsync().Result;
                u = new UserModel(JsonConvert.DeserializeObject <UserModel>(data));
            }
        }
예제 #10
0
        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));
        }
예제 #11
0
        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));
            }
        }
예제 #12
0
        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));
        }
예제 #13
0
        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));
        }
예제 #14
0
        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));
        }
예제 #15
0
        public ActionResult Details(int?id)
        {
            //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;
            //Session["Expired"] = "N";
            //Session["FromDetails"] = "Y";

            dynamic  model     = new ExpandoObject();
            GigModel _GigModel = new GigModel();
            Gig      _Gig      = new Gig();

            int gigid = id.GetValueOrDefault();

            Session["GigId"] = gigid;
            if (gigid != 0)
            {
                List <Gig> _GigList = MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigPost(gigid));
                if (_GigList.Count() > 0)
                {
                    //ViewBag.MetaTag = HomeMetaTags(objJobList[0].JobTitle.ToString(), objJobList[0].JobDescription.ToString());

                    _GigList.FirstOrDefault().GigSkillsMappingList       = _GigModel.GetSkillsByGigId(gigid);
                    _GigList.FirstOrDefault().GigTrendingTagsMappingList = _GigModel.GetTagsByGigId(gigid);
                    _Gig = _GigList.FirstOrDefault();
                    //Session["JobPoster"] = objJob.UserId;

                    Session["JobCategory"]       = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower());
                    Session["JobCategoryHeader"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower());

                    if (Session["JobCategoryId"].ToString() == "0")
                    {
                        Session["JobCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase("ALL JOBS".ToLower());
                    }
                    else
                    {
                        Session["JobCategoryName"] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(_Gig.Category.ToLower());
                    }

                    decimal exchangerate = MatchBxCommon.GetExchangeRate();
                    int     bid          = Convert.ToInt32(_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");

                    //TimeSpan span = objJob.JobCompletionDate.Subtract(DateTime.Now);
                    //string EndingIn = span.Days + " DAYS, " + span.Hours + " HOURS, " + span.Minutes + " MINS";
                    //if (span.Days == 0 || objJob.JobStatus == "P")
                    //{
                    //    Session["Expired"] = "N";
                    //    EndingIn = span.Days + " DAYS, " + Math.Abs(span.Hours) + " HOURS, " + Math.Abs(span.Minutes) + " MINS";
                    //}
                    //else if (span.Days < 0 || span.Hours < 0 || span.Minutes < 0 || objJob.JobStatus == "A" || objJob.JobStatus == "C" || objJob.JobStatusSeeker == "C")
                    //{
                    //    Session["Expired"] = "Y";
                    //}
                    //TempData["EndingIn"] = EndingIn;
                    //if (Convert.ToInt32(Session["UserId"]) != _Gig.UserId)
                    //{
                    //    GigSubscription _GigSubscription = new GigSubscription();
                    //    GigSubscriptionModel _GigSubscriptionModel = new GigSubscriptionModel();
                    //    _GigSubscription.UserId = Convert.ToInt32(Session["UserId"]);
                    //    _GigSubscription.GigId = _Gig.GigId;

                    //    List<GigSubscription> _GigSubscriptionList = _GigSubscriptionModel.LoadJobBiddingDetails(_JobBidding);
                    //    if (objBiddingList.Count() > 0)
                    //    {
                    //        TempData["BidMessage"] = objBiddingList.FirstOrDefault().BidMessage;
                    //        TempData["BidAmount"] = (objBiddingList.FirstOrDefault().BidAmount).ToString("#,##0") + " AXPR";
                    //        int bid = Convert.ToInt32(objBiddingList.FirstOrDefault().BidAmount);
                    //        decimal perc = (Convert.ToDecimal(bid) * 3) / 100;
                    //        TempData["AXPRFeeAmt"] = perc.ToString("#,##0.00");

                    //        string totalfees = (bid - perc).ToString("#,##0.00");
                    //        TempData["AXPRFeeTotAmt"] = totalfees;
                    //        decimal exchangerate = MatchBxCommon.GetExchangeRate();
                    //        TempData["BidAmountinDollar"] = (Math.Round(exchangerate * (objBiddingList.FirstOrDefault().BidAmount), 2)).ToString("#,##0.00");
                    //        TempData["JobBiddingId"] = objBiddingList.FirstOrDefault().JobBiddingId;
                    //        TempData["TokenDistributionId"] = objBiddingList.FirstOrDefault().TokenDistributionId;
                    //        TempData["IsPendingStatus"] = objBiddingList.FirstOrDefault().IsPending;
                    //    }
                    //    else
                    //    {
                    //        TempData["IsPendingStatus"] = "N";
                    //    }
                }

                //objJob.ShareJob = shareJobObj.GetShareDetails(jobid, Convert.ToInt32(Session["UserId"]));
                //if (objJob.ShareJob == null)
                //{
                //    objJob.ShareJob = new SocialMediaShare();
                //    objJob.ShareJob.JobId = jobid;
                //    objJob.ShareJob.UserId = Convert.ToInt32(Session["UserId"]);
                //    objJob.ShareJob.FBShare = null;
                //    objJob.ShareJob.TwitterShare = null;
                //}
                //}
            }
            return(View("Details", _Gig));
        }
예제 #16
0
        public ActionResult GigReview(int?Gigid)
        {
            if (Session["UserType"] == null || Session["UserType"].ToString() != "4")
            {
                TempData["gigid"] = Gigid.GetValueOrDefault();
                return(RedirectToAction("Index", "Jobs", new { @redirecturl = "Y" }));
            }
            else
            {
                JobCategoryModel objCatMod = new JobCategoryModel();
                var     categoryList       = objCatMod.GetList();
                dynamic model = new ExpandoObject();
                categoryList.ForEach(c =>
                {
                    var lowerCase = c.Category.ToLower();
                    var r         = new Regex(@"(^[a-z])|\.\s+(.)", RegexOptions.ExplicitCapture);
                    c.Category    = r.Replace(lowerCase, s => s.Value.ToUpper());
                });
                TempData["Category"]        = categoryList;
                TempData["message"]         = string.Empty;
                TempData["BlockReason"]     = _objUsrBlockModel.GetList();
                TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList();
                GigModel _GigModel = new GigModel();

                Gig _Gig = new Gig();
                _Gig.JobCategoryId = 0;
                _Gig.SortBy        = "N";



                List <Gig> _GigList = new List <Gig>();
                _GigList = MatchBxCommon.GenerateBadgeForGig(_GigModel.GetGigReview(_Gig));
                if (Gigid.GetValueOrDefault() != 0)
                {
                    _GigList = _GigList.Where(x => x.GigId == Gigid.GetValueOrDefault()).ToList <Gig>();
                }
                if (_GigList.Count > 0)
                {
                    //foreach (Job _job in _GigList)
                    //{
                    _GigList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP));
                    // }
                    //if (!String.IsNullOrEmpty(_searchtext))
                    //{
                    //    _GigList = _GigList.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 = _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).ToList();
                }
                else
                {
                    model.GigReview = new List <Gig>();
                }
                return(View("GigReview", model.GigReview));
            }
        }