public ActionResult invitejob(Guid userid) { Int32 jobid = Convert.ToInt32(TempData.Peek("JobID")); tbl_JobEmployees jobemp = new tbl_JobEmployees(); jobemp.Fk_JobId = jobid; jobemp.fromUserId = clsSession.UserID; jobemp.fromUserName = clsSession.UserName; jobemp.toUserId = userid; jobemp.EmplyeeFeePaymentStatus = "invitation sent"; jobemp.CreatedDate = DateTime.Now; jobemp.IsActive = true; _dataContext.tbl_JobEmployees.Add(jobemp); _dataContext.SaveChanges(); //Sent Email to employee to introduce about job detail...!!! //Get send user details...!!! tbl_Users touserdetail = _dataContext.tbl_Users.Where(s => s.Pk_UserId == userid).FirstOrDefault(); //Get Job Detail...!!! tbl_Jobs job = _dataContext.tbl_Jobs.Where(s => s.Pk_JobId == jobid).FirstOrDefault(); MailMessage message = new MailMessage( "*****@*****.**", // From field touserdetail.EmailId, // Recipient field "Job Request Sent by Client", // Subject of the email message PopulateBody(clsSession.UserName, job.JobTitle, job.JobCategory, job.JobLocation, "$" + job.Amount.ToString(), job.JobDescription) // Email message body ); _sendemail.SendEmail(message); return(PartialView("_invitationsentsuccess")); }
public ActionResult approvejob(Int32 id, Guid fromId) { tbl_JobEmployees jobstatus = _dataContext.tbl_JobEmployees.Where(s => s.Fk_JobId == id && s.fromUserId == fromId).FirstOrDefault(); jobstatus.EmplyeeFeePaymentStatus = "Approved"; _dataContext.SaveChanges(); //For Change Job Status...!!! tbl_Jobs job = _dataContext.tbl_Jobs.Where(s => s.Pk_JobId == id).FirstOrDefault(); List <tbl_JobEmployees> jobemployeedata = _dataContext.tbl_JobEmployees.Where(s => s.Fk_JobId == id && s.EmplyeeFeePaymentStatus == "Approved").ToList(); if (jobemployeedata.Count >= job.NoOfEmployeeNeeded) { job.JobStatus = "Approved"; _dataContext.SaveChanges(); } //Sent Email to employee to introduce about job detail...!!! //Get send user details...!!! tbl_Users touserdetail = _dataContext.tbl_Users.Where(s => s.Pk_UserId == jobstatus.fromUserId).FirstOrDefault(); string userid = EncrytDecrypt.passwordEncrypt(clsSession.UserID.ToString(), true); string jobid = EncrytDecrypt.passwordEncrypt(job.Pk_JobId.ToString(), true); string paymenturl = "http://hardyhat.com/user/payment/checkout?userid=" + clsSession.UserID.ToString() + "&jobid=" + job.Pk_JobId.ToString(); //Get Job Detail...!!! MailMessage message = new MailMessage( "*****@*****.**", // From field touserdetail.EmailId, // Recipient field "Job Approved by Client", // Subject of the email message PopulateBody(clsSession.UserName, job.JobTitle, job.JobCategory, job.JobLocation, "$" + job.Amount.ToString(), job.JobDescription, true, paymenturl, false, false) // Email message body ); return(RedirectToAction("clientjobproposal")); }
public ActionResult applyjob(Int32 id) { tbl_Jobs job = _dataContext.tbl_Jobs.Where(s => s.Pk_JobId == id).SingleOrDefault(); if (job != null) { tbl_JobEmployees employeedata = new tbl_JobEmployees(); employeedata.Fk_JobId = id; employeedata.fromUserId = clsSession.UserID; employeedata.fromUserName = clsSession.UserName; employeedata.toUserId = job.ClientUserId; employeedata.EmplyeeFeePaymentStatus = "employee requested"; employeedata.IsActive = true; employeedata.CreatedDate = DateTime.Now; _dataContext.tbl_JobEmployees.Add(employeedata); _dataContext.SaveChanges(); //Sent Email to employee to introduce about job detail...!!! //Get send user details...!!! tbl_Users touserdetail = _dataContext.tbl_Users.Where(s => s.Pk_UserId == job.ClientUserId).FirstOrDefault(); //Get Job Detail...!!! MailMessage message = new MailMessage( "*****@*****.**", // From field touserdetail.EmailId, // Recipient field "Job Request Sent by Employee", // Subject of the email message PopulateBody(clsSession.UserName, job.JobTitle, job.JobCategory, job.JobLocation, "$" + job.Amount.ToString(), job.JobDescription, false, "", false, false) // Email message body ); _sendemail.SendEmail(message); } return(RedirectToAction("jobrequested")); }
public ActionResult rejectjob(Int32 id) { tbl_JobEmployees jobstatus = _dataContext.tbl_JobEmployees.Where(s => s.Fk_JobId == id).FirstOrDefault(); jobstatus.EmplyeeFeePaymentStatus = "Rejected"; _dataContext.SaveChanges(); return(RedirectToAction("clientjobproposal")); }
public ActionResult approve(Int32 id) { tbl_JobEmployees jobstatus = _dataContext.tbl_JobEmployees.Where(s => s.Fk_JobId == id && s.toUserId == clsSession.UserID).FirstOrDefault(); jobstatus.EmplyeeFeePaymentStatus = "Approved"; _dataContext.SaveChanges(); //For Change Job Status...!!! tbl_Jobs job = _dataContext.tbl_Jobs.Where(s => s.Pk_JobId == id).FirstOrDefault(); //Sent Email to employee to introduce about job detail...!!! //Get send user details...!!! tbl_Users touserdetail = _dataContext.tbl_Users.Where(s => s.Pk_UserId == clsSession.UserID).FirstOrDefault(); //Get Job Detail...!!! string userid = EncrytDecrypt.passwordEncrypt(clsSession.UserID.ToString(), true); string jobid = EncrytDecrypt.passwordEncrypt(id.ToString(), true); string paymenturl = "http://hardyhat.com/user/payment/checkout?userid=" + clsSession.UserID.ToString() + "&jobid=" + id.ToString(); MailMessage message = new MailMessage( "*****@*****.**", // From field touserdetail.EmailId, // Recipient field "Pending For Payment Approval", // Subject of the email message PopulateBody(clsSession.UserName, job.JobTitle, job.JobCategory, job.JobLocation, "$" + job.Amount.ToString(), job.JobDescription, false, paymenturl, true, false) // Email message body ); _sendemail.SendEmail(message); List <tbl_JobEmployees> jobemployeedata = _dataContext.tbl_JobEmployees.Where(s => s.Fk_JobId == id && s.EmplyeeFeePaymentStatus == "Approved").ToList(); bool updateFlag = false; if (jobemployeedata.Count >= job.NoOfEmployeeNeeded) { updateFlag = true; //Sent Email to employee to introduce about job detail...!!! //Get send user details...!!! tbl_Users touserdetailClient = _dataContext.tbl_Users.Where(s => s.Pk_UserId == jobstatus.fromUserId).FirstOrDefault(); //Get Job Detail...!!! string touserid = EncrytDecrypt.passwordEncrypt(touserdetailClient.Pk_UserId.ToString(), true); string tojobid = EncrytDecrypt.passwordEncrypt(job.Pk_JobId.ToString(), true); string paymenturlClient = "http://hardyhat.com/user/payment/checkout?userid=" + touserdetailClient.Pk_UserId.ToString() + "&jobid=" + job.Pk_JobId.ToString(); MailMessage messageClient = new MailMessage( "*****@*****.**", // From field touserdetail.EmailId, // Recipient field "Pending For Payment Approval", // Subject of the email message PopulateBody(clsSession.UserName, job.JobTitle, job.JobCategory, job.JobLocation, "$" + job.Amount.ToString(), job.JobDescription, false, paymenturlClient, false, true) // Email message body ); _sendemail.SendEmail(messageClient); } if (updateFlag) { tbl_Jobs jobupdate = _dataContext.tbl_Jobs.Find(id); if (TryValidateModel(jobupdate)) { jobupdate.JobStatus = "Approved"; _dataContext.SaveChanges(); } } return(RedirectToAction("jobproposals")); }