Пример #1
0
        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"));
        }
Пример #2
0
        public ActionResult BidJob(decimal bidamount, int bidDuration, string bidmessage, int jobid, int bidid, int jobposterid, string jobtitle, int _TokenDistributionId, string _AccountInfo)
        {
            Users _objuser = new Users();

            objBidding.UserId       = Convert.ToInt32(Session["UserId"]);
            objBidding.BidAmount    = bidamount;
            objBidding.BidDuration  = bidDuration;
            objBidding.BidMessage   = bidmessage;
            objBidding.JobId        = jobid;
            objBidding.JobBiddingId = bidid;
            objBidding.IsAccepted   = "N";
            objBidding.IsActive     = "Y";
            string  BidUserName = "******" + Session["UserName"].ToString();
            decimal bidAmount   = bidamount;
            string  message     = "";

            if (objBiddingMod.Save(objBidding) > 0)
            {
                if (bidmessage != string.Empty)
                {
                    MatchBXMessage      _objMessage      = new MatchBXMessage();
                    MatchBXMessageModel _objMessageModel = new MatchBXMessageModel();

                    _objMessage.SendUserId  = Convert.ToInt32(Session["UserId"]);
                    _objMessage.Message     = bidmessage;
                    _objMessage.ReceiverId  = jobposterid;
                    _objMessage.ReadStatus  = 0;
                    _objMessage.MessageType = "J";
                    _objMessage.FileSize    = 0;
                    _objMessage.FileName    = "";
                    _objMessage.JobId       = jobid;

                    _objMessageModel.Save(_objMessage);
                }


                if (MatchBxCommon.checkuseremailpreferences("4,5", Convert.ToInt32(Session["UserId"])) == true)
                {
                    _objuser = objUsersMod.GetList("*", " UserId = '" + jobposterid + "'").FirstOrDefault();
                    string email = _objuser.Email;

                    string fullname = _objuser.FullName != null ? _objuser.FullName : _objuser.UserName;
                    //string fullname = objUsersMod.FullName != null ? objUser.FullName : objUser.UserName;
                    MatchBxCommon.sendBidOfferEmail(email, false, BidUserName, jobtitle, bidAmount, fullname);
                }
                objJob           = objJobMod.GetList("*", " JobId = '" + jobid + "'").FirstOrDefault();
                objJob.JobStatus = "B";
                if (objJobMod.Save(objJob) > 0)
                {
                    TokenDistributionModel _TokenDistributionModel = new TokenDistributionModel();
                    TokenDistribution      _TokenDistribution      = new TokenDistribution();

                    if (_TokenDistributionId > 0)
                    {
                        _TokenDistribution = _TokenDistributionModel.GetList("*", " TokenDistributionId = '" + _TokenDistributionId + "'").FirstOrDefault();
                        _TokenDistribution.TokenAddress = _AccountInfo;
                    }
                    else
                    {
                        _TokenDistribution.TokenDistributionId = 0;
                        _TokenDistribution.JobBiddingId        = objBiddingMod.Id;
                        _TokenDistribution.TokenAddress        = _AccountInfo;
                        _TokenDistribution.UserId     = Convert.ToInt32(Session["UserId"]);
                        _TokenDistribution.IsApproved = "N";
                    }
                    if (_TokenDistributionModel.Save(_TokenDistribution) > 0)
                    {
                        message = "Success";
                    }
                    else
                    {
                        message = "Failed";
                    }
                }
                else
                {
                    message = "Failed";
                }
            }
            else
            {
                message = "Failed";
            }
            return(Json(message, JsonRequestBehavior.AllowGet));
        }