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);
 }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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");
            }
        }
Beispiel #4
0
        // POST: api/AgentyJobApplication
        public ResponseCreate Post([FromBody] MyResume value)
        {
            MongoDBProcess process = new MongoDBProcess();
            var            result  = process.createResume(value);

            return(result);
        }
Beispiel #5
0
    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);
    }
Beispiel #6
0
        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)));
        }
Beispiel #7
0
        public IHttpActionResult GetMyResume(int id)
        {
            MyResume myResume = db.myResumes.Find(id);

            if (myResume == null)
            {
                return(NotFound());
            }

            return(Ok(myResume));
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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);
        }
Beispiel #12
0
        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);
        }
Beispiel #14
0
 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));
        }