public override Task <Empty> DeleteCompanyJob(CompanyJobPayload request, ServerCallContext context) { CompanyJobPoco poco = _logic.Get(Guid.Parse(request.Id)); _logic.Delete(new CompanyJobPoco[] { poco }); return(new Task <Empty>(() => new Empty())); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,Company,ProfileCreated,IsInactive,IsCompanyHidden")] CompanyJobPoco companyJobPoco) { if (id != companyJobPoco.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(companyJobPoco); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyJobPocoExists(companyJobPoco.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Company"] = new SelectList(_context.CompanyProfiles, "Id", "Id", companyJobPoco.Company); return(View(companyJobPoco)); }
public ActionResult JobDetails(Guid?id) { CompanyJobPoco companyJobPoco = null; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (TempData["ListJobsModelPerCompany"] != null) { IEnumerable <CompanyJobPoco> companyJobList = (IEnumerable <CompanyJobPoco>)TempData["ListJobsModelPerCompany"]; companyJobPoco = companyJobList.Where(c => c.Id == id).FirstOrDefault(); if (companyJobPoco == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TempData.Keep("ListJobsModelPerCompany"); } else { IDataRepository <CompanyJobPoco> repoCompanyJob = new MvcLogic <CompanyJobPoco>().Repo; companyJobPoco = repoCompanyJob.GetSingle(c => c.Id == id); if (companyJobPoco == null) { return(HttpNotFound()); } } if (TempData["JobDetailsModelPerCompany"] == null) { TempData["JobDetailsModelPerCompany"] = companyJobPoco; } return(View(companyJobPoco)); }
public ActionResult Delete(Guid id) { var request = new RestRequest($"api/careercloud/company/v1/job/{id}"); var response = _client.Execute <CompanyJobPoco>(request); var companyJob = JsonConvert.DeserializeObject <CompanyJobPoco>(response.Content); CompanyJobPoco[] pocos = new CompanyJobPoco[] { companyJob }; var deleteRequest = new RestRequest("api/careercloud/company/v1/job", Method.DELETE) { RequestFormat = DataFormat.Json }; deleteRequest.AddBody(pocos); _client.Execute(deleteRequest); return(View("Index")); }
public override Task <CompanyJobReply> GetCompanyJob(IdRequest4 request, ServerCallContext context) { CompanyJobPoco poco = _logic.Get(Guid.Parse(request.Id)); return(Task.FromResult <CompanyJobReply>(FromPoco(poco))); }
public ActionResult Create([Bind(Include = "ProfileCreated,IsInactive,IsCompanyHidden")] CompanyJobPoco poco) { var companyId = Session["Company"]; poco.Company = (Guid)companyId; CompanyJobPoco[] pocos = new CompanyJobPoco[] { poco }; var request = new RestRequest("api/careercloud/company/v1/job", Method.POST); request.AddJsonBody(pocos); request.RequestFormat = DataFormat.Json; var response = client.Execute(request); //Get Job //Get Back The Job just saved and add to session CompanyJobRepository repository = new CompanyJobRepository(); CompanyJobLogic logic = new CompanyJobLogic(repository); var companyJob = logic.GetAll().Where(s => s.Company == poco.Company).FirstOrDefault(); if (Session["Job"] == null) { Session["Job"] = companyJob.Id; } return(RedirectToAction("JobDescription")); }
public ActionResult DeleteConfirmed(Guid id) { CompanyJobPoco companyJobPoco = companyJobLogic.Get(id); //db.CompanyJobs.Find(id); compJobPoco[0] = companyJobPoco; companyJobLogic.Delete(compJobPoco); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(Guid id) { CompanyJobPoco companyJobPoco = db.CompanyJobs.Find(id); db.CompanyJobs.Remove(companyJobPoco); db.SaveChanges(); return(RedirectToAction("Index")); }
public CompanyJobPoco GetSingleCompanyJob(string Id) { var logic = new CompanyJobLogic(new EFGenericRepository <CompanyJobPoco>(false)); CompanyJobPoco companyJobPoco = new CompanyJobPoco(); companyJobPoco = logic.Get(Guid.Parse(Id)); return(companyJobPoco); }
private CompanyJobPoco TranslateFromProto(CompanyJobObj proto, CompanyJobPoco poco) { poco.Id = Guid.Parse(proto.Id); poco.Company = Guid.Parse(proto.Company); poco.ProfileCreated = proto.ProfileCreated.ToDateTime(); poco.IsInactive = proto.IsInactive; poco.IsCompanyHidden = proto.IsCompanyHidden; return(poco); }
public ActionResult DeleteConfirmed(Guid id) { CompanyJobPoco companyJobPoco = _logic.Get(id); // db.CompanyJob.Find(id); //db.CompanyJob.Remove(companyJobPoco); //db.SaveChanges(); _logic.Delete(new CompanyJobPoco[] { companyJobPoco }); return(RedirectToAction("Index")); }
// GET: ApplicantResume/Create public ActionResult Create() { CompanyJobPoco companyJobPoco = new CompanyJobPoco(); //ViewBag.Applicant = new SelectList(db.ApplicantProfiles, "Id", "Currency"); return(View(companyJobPoco)); //return View(); }
public ActionResult GetCompanyJob(Guid jobid) { CompanyJobPoco poco = _logic.Get(jobid); if (poco is null) { return(NotFound()); } return(Ok(poco)); }
public IHttpActionResult GetCompanyJob(Guid companyJobId) { CompanyJobPoco appEdu = _logic.Get(companyJobId); if (appEdu == null) { return(NotFound()); } return(Ok(appEdu)); }
public ActionResult Edit([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden,TimeStamp")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { db.Entry(companyJobPoco).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(companyJobPoco)); }
public IHttpActionResult GetCompanyJob(Guid CompanyJobId) { CompanyJobPoco companyJob = _logic.Get(CompanyJobId); if (companyJob == null) { return(NotFound()); } return(Ok(companyJob)); }
public IHttpActionResult GetCompanyJob(Guid id) { CompanyJobPoco poco = _logic.Get(id); if (poco == null) { return(NotFound()); } return(Ok(poco)); }
public ActionResult Edit([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { db.Entry(companyJobPoco).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Company = new SelectList(db.CompanyProfiles, "Id", "CompanyWebsite", companyJobPoco.Company); return(View(companyJobPoco)); }
private CompanyJobReply FromPoco(CompanyJobPoco poco) { return(new CompanyJobReply() { Id = poco.Id.ToString(), Company = poco.Company.ToString(), IsCompanyHidden = poco.IsCompanyHidden, IsInactive = poco.IsInactive, ProfileCreated = Timestamp.FromDateTime(DateTime.SpecifyKind(poco.ProfileCreated, DateTimeKind.Utc)) }); }
public ActionResult Create([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden,TimeStamp")] CompanyJobPoco companyJobPoco, string JobName, string JobDescriptions, string Major, int Importance, string Skill, string SkillLevel, short EImportance) { Session["Company"] = companyJobPoco.Company; if (ModelState.IsValid) { companyJobPoco.Id = Guid.NewGuid(); companyJobPoco.ProfileCreated = DateTime.Now; compJobPoco[0] = companyJobPoco; CompanyJobSkillPoco companySkillsPoco = new CompanyJobSkillPoco(); companySkillsPoco.Id = Guid.NewGuid(); companySkillsPoco.Job = companyJobPoco.Id; companySkillsPoco.Skill = Skill; companySkillsPoco.SkillLevel = SkillLevel; companySkillsPoco.Importance = Importance; CompanyJobSkillPoco[] compJobSkillPoco = new CompanyJobSkillPoco[] { companySkillsPoco }; CompanyJobEducationPoco companyJobEducationPoco = new CompanyJobEducationPoco(); companyJobEducationPoco.Id = Guid.NewGuid(); companyJobEducationPoco.Job = companyJobPoco.Id; companyJobEducationPoco.Major = Major; companyJobEducationPoco.Importance = EImportance; CompanyJobEducationPoco[] compEducationPoco = new CompanyJobEducationPoco[] { companyJobEducationPoco }; CompanyJobDescriptionPoco companyJobDescriptionPoco = new CompanyJobDescriptionPoco(); companyJobDescriptionPoco.Id = Guid.NewGuid(); companyJobDescriptionPoco.Job = companyJobPoco.Id; companyJobDescriptionPoco.JobName = JobName; companyJobDescriptionPoco.JobDescriptions = JobDescriptions; CompanyJobDescriptionPoco[] compJobDescriptionPoco = new CompanyJobDescriptionPoco[] { companyJobDescriptionPoco }; companyJobLogic.Add(compJobPoco); companyJobSkillLogic.Add(compJobSkillPoco); companyJobEducationLogic.Add(compEducationPoco); companyJobDescriptionLogic.Add(compJobDescriptionPoco); //return RedirectToAction("Details", "CompanyProfile", new { id = companyJobPoco.Company }); return(RedirectToAction("Details", "CompanyJob", new { id = companyJobPoco.Company })); } ViewBag.Company = new SelectList(companyJobLogic.GetAll(), "Company", "Company"); return(View(companyJobPoco)); }
public ActionResult Edit([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden,TimeStamp")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { compJobPoco[0] = companyJobPoco; companyJobLogic.Update(compJobPoco); return(RedirectToAction("Index")); } ViewBag.Company = new SelectList(companyJobLogic.GetAll(), "Company", "Company"); return(View(companyJobPoco)); }
private CompanyJobreply FromPoco(CompanyJobPoco poco) { return(new CompanyJobreply() { Id = poco.Id.ToString(), Company = poco.Company.ToString(), ProfileCreated = poco.ProfileCreated == null ? null : Timestamp.FromDateTime((DateTime)poco.ProfileCreated), IsInactive = poco.IsInactive, IsCompanyHidden = poco.IsCompanyHidden }); }
private void CompanyJob_Init() { _companyJob = new CompanyJobPoco() { Id = Guid.NewGuid(), Company = _companyProfile.Id, IsCompanyHidden = false, IsInactive = false, ProfileCreated = Faker.Date.Past() }; }
public override Task <CompanyJobObj> GetCompanyJob(IdRequestCompanyJob request, ServerCallContext context) { var _logic = new CompanyJobLogic(new EFGenericRepository <CompanyJobPoco>()); CompanyJobPoco poco = _logic.Get(Guid.Parse(request.Id)); if (poco == null) { throw new ArgumentOutOfRangeException(); } return(TranslateFromPoco(poco)); }
private Task <CompanyJobObj> TranslateFromPoco(CompanyJobPoco poco) { return(Task.FromResult(new CompanyJobObj { Id = poco.Id.ToString(), Company = poco.Company.ToString(), ProfileCreated = Timestamp.FromDateTime(DateTime.SpecifyKind(poco.ProfileCreated, DateTimeKind.Utc)), IsInactive = poco.IsInactive, IsCompanyHidden = poco.IsCompanyHidden })); }
private CompanyJobReply FromPoco(CompanyJobPoco poco) { return(new CompanyJobReply() { Id = poco.Id.ToString(), Company = poco.Company.ToString(), ProfileCreated = Timestamp.FromDateTime(DateTime.SpecifyKind((DateTime)poco.ProfileCreated, DateTimeKind.Utc)), IsInactive = (bool)poco.IsInactive, IsCompanyHidden = (bool)poco.IsCompanyHidden, TimeStamp = ByteString.CopyFrom(poco.TimeStamp) }); }
public ActionResult Create([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden,TimeStamp")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { companyJobPoco.Id = Guid.NewGuid(); db.CompanyJobPocoes.Add(companyJobPoco); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(companyJobPoco)); }
public async Task <IActionResult> Create([Bind("Id,Company,ProfileCreated,IsInactive,IsCompanyHidden")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { companyJobPoco.Id = Guid.NewGuid(); _context.Add(companyJobPoco); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Company"] = new SelectList(_context.CompanyProfiles, "Id", "Id", companyJobPoco.Company); return(View(companyJobPoco)); }
public ActionResult Create([Bind(Include = "Id,Company,ProfileCreated,IsInactive,IsCompanyHidden")] CompanyJobPoco companyJobPoco) { if (ModelState.IsValid) { companyJobPoco.Id = Guid.NewGuid(); db.CompanyJobs.Add(companyJobPoco); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Company = new SelectList(db.CompanyProfiles, "Id", "CompanyWebsite", companyJobPoco.Company); return(View(companyJobPoco)); }
public override Task <CompanyJobPayLoad> ReadCompanyJob(IdRequestJob request, ServerCallContext context) { CompanyJobPoco poco = _logic.Get(Guid.Parse(request.Id)); return(new Task <CompanyJobPayLoad>(() => new CompanyJobPayLoad() { Id = poco.Id.ToString(), Company = poco.Company.ToString(), ProfileCreated = Timestamp.FromDateTime((DateTime)poco.ProfileCreated), IsInactive = poco.IsInactive, IsCompanyHidden = poco.IsCompanyHidden })); }