public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,Department,Designation,CompanyAddress,StartDate,EndDate,UserId,IsPublic")] WorkingExperience workingExperience)
        {
            if (id != workingExperience.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(workingExperience);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkingExperienceExists(workingExperience.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("WorkingExperience", "UserProfile"));
            }
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Id", workingExperience.UserId);
            return(View(workingExperience));
        }
Beispiel #2
0
        /*
         * [HttpPost]
         * [ValidateAntiForgeryToken]
         * public async Task<IActionResult> Resume(ResumeViewModel model)
         * {
         *  var user = await _userManager.GetUserAsync(User);
         *  return View(model);
         * }
         * this.CompanyName = company;
         *  this.Position = position;
         *  this.StartDate = startDate;
         *  this.EndDate = endDate;
         */
        public async Task <IActionResult> workingexperience()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
            }
            var a  = new WorkingExperience("testA", "kkjhkh", "llkkjh", new DateTime(2010, 2, 2), new DateTime(2011, 3, 11));
            var ab = new WorkingExperience("testB", "kkjhkh", "llkkjh", new DateTime(2010, 2, 2), new DateTime(2011, 3, 11));
            var b  = new WorkingExperience("testC", "kkjhkh", "llkkjh", new DateTime(2010, 2, 2), new DateTime(2011, 3, 11));

            List <WorkingExperience> testt = new List <WorkingExperience>();

            testt.Add(a);
            testt.Add(ab);
            testt.Add(b);
            var model = new workingexperienceViewModel
            {
                CompanyName = "company",
                Position    = "position",
                StartDate   = new DateTime(1992, 2, 22),
                EndDate     = new DateTime(2018, 2, 22),
                ResumeWorkingExperiences = testt
            };


            return(View(model));
        }
Beispiel #3
0
        public void Test1()
        {
            var spec = new WorkingExperience(TimeSpan.FromDays(365));
            var rule = new Rule(1, "x", spec);

            rule.SetCalculation(CalculationStrategy.DecreasePointsTo(10));
        }
        public async Task <ActionResult <WorkingExperience> > PostWorkingExperience(WorkingExperience workingExperience)
        {
            _context.WorkingExperiences.Add(workingExperience);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(WorkingExperience), new { id = workingExperience.Id }, workingExperience));
        }
        public async Task <IActionResult> PutWorkingExperience(long id, WorkingExperience workingExperience)
        {
            if (id != workingExperience.Id)
            {
                return(BadRequest());
            }

            _context.Entry(workingExperience).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!workingExperienceExist(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <int> DeleteAsync(int id)
        {
            WorkingExperience model = await ReadByIdAsync(id);

            EntityExtension.FlagForDelete(model, IdentityService.Username, UserAgent, true);
            DbSet.Update(model);
            return(await DbContext.SaveChangesAsync());
        }
        public ActionResult DeleteConfirmed(int id)
        {
            WorkingExperience workingExperience = db.WorkingExperiences.Find(id);

            db.WorkingExperiences.Remove(workingExperience);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #8
0
 public static void WorkingExpMap(this WorkingExperience dbWExp, WorkingExperience wExp)
 {
     dbWExp.CompanyName = wExp.CompanyName;
     dbWExp.Descritpion = wExp.Descritpion;
     dbWExp.Position    = wExp.Position;
     dbWExp.StartDate   = wExp.StartDate;
     dbWExp.EndDate     = wExp.EndDate;
 }
Beispiel #9
0
        private void CreateNewRow_Exp()
        {
            var newExp          = this.ExpDbset.Create();
            WorkingExperience C = (WorkingExperience)newExp;

            C.Key      = Encryption.GetUniqueKey(16);
            C.StaffKey = this.StaffKey;
            this.ExpDbset.Local.Add(newExp);
        }
Beispiel #10
0
 private static WorkingExperience ToWorkingExperienceDto(WorkingExperience workingExpeience)
 {
     return(new WorkingExperience
     {
         CompanyName = workingExpeience.CompanyName,
         Position = workingExpeience.Position,
         Descritpion = workingExpeience.Descritpion,
         StartDate = workingExpeience.StartDate,
         EndDate = workingExpeience.EndDate,
     });
 }
 public ActionResult Edit([Bind(Include = "WEId,JobseekerId,WorkingExp")] WorkingExperience workingExperience)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workingExperience).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.JobseekerId = new SelectList(db.Jobseekers, "JobseekerId", "Name", workingExperience.JobseekerId);
     return(View(workingExperience));
 }
        public ActionResult Create([Bind(Include = "WEId,JobseekerId,WorkingExp")] WorkingExperience workingExperience)
        {
            if (ModelState.IsValid)
            {
                db.WorkingExperiences.Add(workingExperience);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.JobseekerId = new SelectList(db.Jobseekers, "JobseekerId", "Name", workingExperience.JobseekerId);
            return(View(workingExperience));
        }
        public async Task <IActionResult> Create([Bind("Id,CompanyName,Department,Designation,CompanyAddress,StartDate,EndDate,UserId,IsPublic")] WorkingExperience workingExperience)
        {
            if (ModelState.IsValid)
            {
                _context.Add(workingExperience);
                await _context.SaveChangesAsync();

                return(RedirectToAction("WorkingExperience", "UserProfile"));
            }
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Id", workingExperience.UserId);
            return(View(workingExperience));
        }
        // GET: WorkingExperiences/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkingExperience workingExperience = db.WorkingExperiences.Find(id);

            if (workingExperience == null)
            {
                return(HttpNotFound());
            }
            return(View(workingExperience));
        }
Beispiel #15
0
        public ActionResult Insert(SignUpViewModel model, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                //    var file = Request.Files[0];
//                byte[] uploadedFile = new byte[model.Picture.InputStream.Length];


                Jobseeker jobseeker = new Jobseeker();
                jobseeker.Name              = model.Name;
                jobseeker.Email             = model.Email;
                jobseeker.Password          = model.Password;
                jobseeker.PhoneNo           = model.PhoneNo;
                jobseeker.Qualification     = model.Qualification;
                jobseeker.FieldOfStudy      = model.FieldOfStudy;
                jobseeker.PreferredLocation = model.PreferredLocation;
                jobseeker.PreferredSalary   = model.PreferredSalary;
                jobseeker.PreferredField    = model.PreferredField;
                //           model.Picture.InputStream.Read(uploadedFile,0,uploadedFile.Length);

                db.Jobseekers.Add(jobseeker);
                db.SaveChanges();

                int lastId = jobseeker.JobseekerId;

                Language language = new Language();
                language.LanguageLearned = model.LanguageLearned;
                language.JobseekerId     = lastId;

                db.Languages.Add(language);
                db.SaveChanges();

                WorkingExperience exp = new WorkingExperience();
                exp.WorkingExp  = model.WorkingExp;
                exp.JobseekerId = lastId;

                db.WorkingExperiences.Add(exp);
                db.SaveChanges();

                Skill skill = new Skill();
                skill.SkillAcquired = model.SkillAcquired;
                skill.JobseekerId   = lastId;

                db.Skills.Add(skill);
                db.SaveChanges();
                int lastProductId = db.Jobseekers.Max(item => item.JobseekerId);
                return(RedirectToAction("Details", new { id = lastProductId }));
            }
            return(View(model));
        }
        public async Task <int> UpdateAsync(int id, WorkingExperience model)
        {
            var data = await ReadByIdAsync(id);

            data.Company        = model.Company;
            data.JobPosition    = model.JobPosition;
            data.TanggalMulai   = model.TanggalMulai;
            data.TanggalSelesai = model.TanggalSelesai;
            data.Deskripsi      = model.Deskripsi;
            data.Sertifikat     = model.Sertifikat;

            DbSet.Update(data);
            return(await DbContext.SaveChangesAsync());
        }
        // GET: WorkingExperiences/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkingExperience workingExperience = db.WorkingExperiences.Find(id);

            if (workingExperience == null)
            {
                return(HttpNotFound());
            }
            ViewBag.JobseekerId = new SelectList(db.Jobseekers, "JobseekerId", "Name", workingExperience.JobseekerId);
            return(View(workingExperience));
        }
Beispiel #18
0
        public async Task <ActionResult <WorkingExperience> > PostWorkingExperience([FromBody] WorkingExperienceFormViewModel workingExperience)
        {
            VerifyUser();
            var model = new WorkingExperience()
            {
                AccountInformationId = workingExperience.AccountInformationId,
                Company = workingExperience.Company,
                JobPositionExperience = workingExperience.JobPositionExperience,
                TanggalMulai          = workingExperience.TanggalMulai,
                TanggalSelesai        = workingExperience.TanggalSelesai,
                Deskripsi             = workingExperience.Deskripsi,
                Sertifikat            = workingExperience.Sertifikat.GetValueOrDefault()
            };

            EntityExtension.FlagForCreate(model, _identityService.Username, UserAgent);
            _context.WorkingExperiences.Add(model);
            await _context.SaveChangesAsync();

            return(Created("", model));
        }
 public Task UpdateWorkingExperienceAsync(WorkingExperience workingExperience)
 {
     throw new NotImplementedException();
 }
Beispiel #20
0
 public ICvOptionalValues WithWorkingExperienceItem(WorkingExperience workingExperienceItem)
 {
     _curriculumVitae.WorkingExperiences.Add(workingExperienceItem);
     return(this);
 }
 public async Task <int> CreateAsync(WorkingExperience model)
 {
     EntityExtension.FlagForCreate(model, IdentityService.Username, UserAgent);
     DbSet.Add(model);
     return(await DbContext.SaveChangesAsync());
 }