protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { MyResume r = new MyResume(); r.ResumeID = int.Parse(Request.QueryString["id"]); r.UserName = Profile.UserName; MyResume.Insert(r); }
public IHttpActionResult PutMyResume(int id, MyResume myResume) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != myResume.Id) { return(BadRequest()); } db.Entry(myResume).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MyResumeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IActionResult> Post([FromBody] MyResume resume) { _logger.LogInformation("User Service Post method getting started..."); if (String.IsNullOrEmpty(resume.Name)) { throw new ArgumentException("Name cannot be empty"); } if (String.IsNullOrEmpty(resume.Email)) { throw new ArgumentException("Email cannot be empty"); } if (String.IsNullOrEmpty(resume.Phone)) { throw new ArgumentException("Phone cannot be empty"); } var isEmailExist = await _repository.GetByEmail(resume.Email); if (isEmailExist == null) { await _repository.Create(resume); return(Ok("Resume Id: " + resume.Id)); } else { throw new ArgumentException("Resume already exist"); } }
// POST: api/AgentyJobApplication public ResponseCreate Post([FromBody] MyResume value) { MongoDBProcess process = new MongoDBProcess(); var result = process.createResume(value); return(result); }
protected void Button1_Click(object sender, EventArgs e) { MyResume r = new MyResume(); r.ResumeID = int.Parse(Request.QueryString["id"]); r.UserName = Profile.UserName; MyResume.Insert(r); }
public IActionResult Post([FromBody] MyResume resume) { if (!ModelState.IsValid) { return(BadRequest(ModelState.Values.SelectMany(m => m.Errors) .Select(e => e.ErrorMessage) .ToList())); } return(Ok(_repo.Post(resume))); }
public IHttpActionResult GetMyResume(int id) { MyResume myResume = db.myResumes.Find(id); if (myResume == null) { return(NotFound()); } return(Ok(myResume)); }
public ObjectId Post(MyResume myResume) { myResume.Id = ObjectId.NewObjectId(); var resumes = _db.GetCollection <MyResume>(); resumes.EnsureIndex(r => r.Id); resumes.Insert(myResume); return(myResume.Id); }
public IHttpActionResult PostMyResume(MyResume myResume) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.myResumes.Add(myResume); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = myResume.Id }, myResume)); }
public ActionResult GetPdf(string Id) { MyResume tmp = GetMyResumeLang(Id); string fileName = System.IO.Path.Combine(_env.WebRootPath + tmp.Download.PathCV); FileStream fileStream = System.IO.File.OpenRead(fileName); //HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); //response.Content = new StreamContent(fileStream); //response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf"); return(File(fileStream, "application/pdf")); }
public void GetAllRetrieveErrorWithEmptyParameter() { // Arrange var env = new Mock <IWebHostEnvironment>(); env.Setup(x => x.WebRootPath).Returns(@"C:\Proyectos\ResumeCV\ResumeCVCoreAng2\ResumeCVCoreAng2\wwwroot"); var obj = new LangAPIController(env.Object); string expected = ""; // Act var jsonresult = obj.GetAll(expected); MyResume result = (MyResume)jsonresult.Value; // Assert //Assert.IsNull(result); }
public IHttpActionResult DeleteMyResume(int id) { MyResume myResume = db.myResumes.Find(id); if (myResume == null) { return(NotFound()); } db.myResumes.Remove(myResume); db.SaveChanges(); return(Ok(myResume)); }
public void GetAllRetrieveSpanish() { // Arrange var env = new Mock <IWebHostEnvironment>(); env.Setup(x => x.WebRootPath).Returns(@"C:\Proyectos\ResumeCV\ResumeCVCoreAng2\ResumeCVCoreAng2\wwwroot"); var obj = new LangAPIController(env.Object); var expected = "es"; // Act var jsonresult = obj.GetAll(expected); MyResume result = (MyResume)jsonresult.Value; // Assert Assert.AreEqual(expected, result.Language); }
public ResponseCreate createResume(MyResume resume) { try { MongoClient dbClient = new MongoClient(conenctionString); var resp = new ResponseCreate(); var database = dbClient.GetDatabase("ResumeDB"); var collection = database.GetCollection <MyResume>("MyResume"); collection.InsertOne(resume); resp.Success = true; resp.idResume = resume._id.ToString(); return(resp); } catch (Exception ex) { return(new ResponseCreate() { Success = false, ErrorDescription = ex.Message.ToString() }); } }
public JsonResult GetSidebar(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Sidebar)); }
public JsonResult GetPortfolio(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Portfolio)); }
public JsonResult GetAbout(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.About)); }
public JsonResult GetTitle(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Header)); }
public JsonResult GetExperience(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Experience)); }
public JsonResult GetEducation(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Education)); }
public JsonResult GetJournal(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Journal)); }
public long Post(MyResume vm) { return(Resumes.Insert(vm)); }
public async Task <MyResume> Create(MyResume user) { await _MyResume.InsertOneAsync(user); return(user); }
public JsonResult GetDownload(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Download)); }
public JsonResult GetContact(string Id) { MyResume tmp = GetMyResumeLang(Id); return(Json(tmp.Contact)); }