public void Put(string id, JobSkills jobSkillObj) { try { jobSkillObj.Id = new Guid(id); ServiceFactory.GetJobSkills().Update(jobSkillObj); } catch (Exception exp) { } }
public ActionResult Create([Bind(Exclude = "SkillList")] JobVM jobVM, List <int> SkillList) { if (ModelState.IsValid) { //SkillList_@i Job job = new Job() { JobTitle = jobVM.JobTitle, CatID = jobVM.CatID, ClientId = User.Identity.GetUserId(), Desc = jobVM.Desc, Price = jobVM.Price, ExperienceLevelId = jobVM.ExperienceLevelId }; db.Jobs.Add(job); db.SaveChanges(); foreach (var item in SkillList) { JobSkills JobSkill = new JobSkills(); JobSkill.JobId = job.ID; JobSkill.SkillId = item; db.JobSkills.Add(JobSkill); db.SaveChanges(); } return(RedirectToAction("ClientJobs", "Client")); } var skills = db.Skills.ToList(); List <SkillModel> skillModels = new List <SkillModel>(); foreach (var item in skills) { //SkillModel skillModel = new SkillModel() { Text = item.SkillsName, IsChecked = true,SkillId=item.ID,Value=1 }; SkillModel skillModel = new SkillModel() { Text = item.SkillsName, IsChecked = false, SkillId = item.ID }; skillModels.Add(skillModel); } jobVM.SkillList = skillModels; ViewBag.CatID = new SelectList(db.JobCategory, "ID", "Name", jobVM.CatID); ViewBag.ExperienceLevelId = new SelectList(db.JobExperienceLevel, "ID", "ExperienceLevel", jobVM.ExperienceLevelId); return(View(jobVM)); }
public void AddFreelancerSkills(JobSkills JobSkill) { List <OtherSkills> ListOfSkills = new List <OtherSkills>(); foreach (var item in JobSkill.listOfSkills) { OtherSkills newSkill = new OtherSkills { skill_name = item }; ListOfSkills.Add(newSkill); } job JobObj = context.job.FirstOrDefault(f => f.ID == JobSkill.JobId); JobObj.OtherSkills = ListOfSkills; context.SaveChanges(); }
public void get_Skills_Oficio(TcpClient cliente, string paquete) { string[] separador_skill; CharacterClass personaje = cliente.account.game.character; Job oficio; JobSkills skill = null; short id_oficio, id_skill; byte cantidad_minima, cantidad_maxima; float tiempo; foreach (string datos_oficio in paquete.Substring(3).Split('|')) { id_oficio = short.Parse(datos_oficio.Split(';')[0]); oficio = personaje.oficios.Find(x => x.id == id_oficio); if (oficio == null) { oficio = new Job(id_oficio); personaje.oficios.Add(oficio); } foreach (string datos_skill in datos_oficio.Split(';')[1].Split(',')) { separador_skill = datos_skill.Split('~'); id_skill = short.Parse(separador_skill[0]); cantidad_minima = byte.Parse(separador_skill[1]); cantidad_maxima = byte.Parse(separador_skill[2]); tiempo = float.Parse(separador_skill[4]); skill = oficio.skills.Find(actividad => actividad.id == id_skill); if (skill != null) { skill.set_Actualizar(id_skill, cantidad_minima, cantidad_maxima, tiempo); } else { oficio.skills.Add(new JobSkills(id_skill, cantidad_minima, cantidad_maxima, tiempo)); } } } personaje.evento_Oficios_Actualizados(); }
/// <summary> /// To create a new work history details /// </summary> /// <param name="jobSeekerWorkHistoryObj">WorkHistory object</param> public void Post(JobSkills jobSkillObj) { try { string skillMapId = jobSkillObj.SkillMapId; string[] skillMapIdList = skillMapId.Split(','); for (int i = 0; i < skillMapIdList.Length; i++) { jobSkillObj.JobId = jobSkillObj.JobId; jobSkillObj.SkillScore = jobSkillObj.SkillScore; jobSkillObj.SkillImportance = jobSkillObj.SkillImportance; jobSkillObj.SkillExperience = jobSkillObj.SkillExperience; jobSkillObj.SkillMapId = skillMapIdList[i]; ServiceFactory.GetJobSkills().Create(jobSkillObj); } } catch (Exception ex) { } }