//Post job Via Admin public ActionResult sendMailToOperator(long advID) { try { advertisementList adlist = new advertisementList(); adlist = db.advertisementLists.Include(e => e.jobDetails).Where(ex => ex.advertisementRefID == advID).FirstOrDefault(); adlist.sentToDataOperatorForPost = true; db.Entry(adlist).State = EntityState.Modified; db.SaveChanges(); long empid = adlist.empID; var empdet = db.EmployerDetails.Where(ex => ex.EmployerID == empid).FirstOrDefault(); long cid = empdet.companyID; var compdet = db.companyDetails.Where(ex => ex.companyID == cid).FirstOrDefault(); StreamReader sr = new StreamReader(Server.MapPath("/Emailer/toAdminCreateAD.html")); string HTML_Body = sr.ReadToEnd(); string final_Html_Body = HTML_Body.Replace("#name", "Admin").Replace("#refID", advID.ToString()).Replace("#companyname", compdet.companyName).Replace("#empname", empdet.Name).Replace("#pdfurl", adlist.advertisementPDFUrk).Replace("#imgurl", adlist.advertisementimageURL); sr.Close(); string To = WebConfigurationManager.AppSettings["AdminEmail"].ToString(); string mail_Subject = "Request Received For Newspaper Advertisement Creation"; string result = BaseUtil.sendEmailer(To, mail_Subject, final_Html_Body, ""); return(RedirectToAction("ThankYou")); } catch (Exception e) { BaseUtil.CaptureErrorValues(e); } return(View()); }
public ActionResult NewJob(Int64?jobID, Int64?refID, int?islink) { jobDetail jobDetailsModel = new jobDetail(); try { if (jobID == 0 || jobID == null) { long employerID = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())); if (refID != null) { jobDetailsModel.advertisementRefID = refID; //====================================================================== //postStatus 0 -> for leave after upload advt image // 1 -> post advt job by self // 2 -> post advt job by operator //========================================================================= advertisementList oadvertisementList = new advertisementList(); oadvertisementList = db.advertisementLists.Where(e => e.advertisementRefID == refID).FirstOrDefault(); if (oadvertisementList.empID == employerID) { oadvertisementList.postStatus = 1; db.Entry(oadvertisementList).State = EntityState.Modified; db.SaveChanges(); } } long companyID = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.companyID.ToString())); var comany = db.companyDetails.Find(companyID); var employer = db.EmployerDetails.Find(employerID); jobDetailsModel.CompanyName = comany.companyName; jobDetailsModel.CompanyDescription = comany.companyDescription; jobDetailsModel.CompanyWebsite = comany.website; jobDetailsModel.jobContactPersonName = employer.Name; jobDetailsModel.responsesEmailID = employer.Email; jobDetailsModel.jobContactPersonEmail = employer.Email; jobDetailsModel.jobContactPersonMobile = employer.Mobile; jobDetailsModel.CompanyLogo = comany.logo; } else { jobDetailsModel = db.jobDetails.Where(e => e.jobID == jobID).FirstOrDefault(); jobDetailsModel.requiredSkills = BaseUtil.JOb_skillSet(jobDetailsModel.jobID); } ViewBag.gender = db.genderLists; ViewBag.EmploymentTypeID = db.EmploymentTypes.Where(e => e.isActive == true); ViewBag.industryID = db.industries.Where(e => e.isActive == true); ViewBag.currency = db.currencies.Where(e => e.isActive == true); ViewBag.EducationReq = db.Educations; ViewBag.ComapnyDetails = db.companyDetails.Where(e => e.isActive == true).Select(e => new { e.companyID, e.companyName }); ViewBag.isLink = ""; if (islink == 1) { ViewBag.isLink = "3"; } } catch (Exception e) { BaseUtil.CaptureErrorValues(e); } return(View(jobDetailsModel)); }
public ActionResult createAdvertisement(advertisementList adList, HttpPostedFileBase files, FormCollection frm) { try { if (frm["hdnjobID"] == null) { advertisementList newadlist = new advertisementList(); newadlist.empID = Convert.ToUInt32(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())); newadlist.postStatus = 0; newadlist.advertisementURL = "Some URL"; //====================================================================== //postStatus 0 -> for leave after upload advt image // 1 -> post advt job by self // 2 -> post advt job by operator //========================================================================= var path = string.Empty; if (files != null) { var fileName = Guid.NewGuid() + "_" + Path.GetFileName(files.FileName); path = Path.Combine(Server.MapPath("~/newspaper"), fileName); files.SaveAs(path); newadlist.advertisementimageURL = "https://spotaneedle.com/newspaper/" + fileName; newadlist.dataIsCreated = BaseUtil.GetCurrentDateTime(); newadlist.dataIsUpdated = BaseUtil.GetCurrentDateTime(); db.advertisementLists.Add(newadlist); db.SaveChanges(); string advtID = BaseUtil.encrypt((newadlist.advertisementRefID).ToString()); newadlist.advertisementURL = "https://spotaneedle.com/jobDetails/advertisementApplyHome/?refid=" + advtID; newadlist.isComplePosted = true; db.SaveChanges(); return(RedirectToAction("adPostSuccess", new { ID = newadlist.advertisementRefID })); } else { return(View()); } } else { long id = Convert.ToInt32(frm["hdnjobID"]); advertisementList oadvertisementList = new advertisementList(); oadvertisementList = db.advertisementLists.Where(e => e.advertisementRefID == id).FirstOrDefault(); var path = string.Empty; if (files != null) { var fileName = Guid.NewGuid() + "_" + Path.GetFileName(files.FileName); path = Path.Combine(Server.MapPath("~/newspaper"), fileName); files.SaveAs(path); oadvertisementList.advertisementimageURL = "https://spotaneedle.com/newspaper/" + fileName; oadvertisementList.dataIsUpdated = BaseUtil.GetCurrentDateTime(); oadvertisementList.advertisementURL = "https://spotaneedle.com/jobDetails/advertisementApplyHome/?refid=" + id; oadvertisementList.isComplePosted = true; db.Entry(oadvertisementList).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("jobDashboard", "jobDetails")); } } catch (Exception e) { BaseUtil.CaptureErrorValues(e); } return(View()); }