public ActionResult CompleteProfile(int id, RessourceViewModel rvm) { Ressource r = new Ressource(); // RessourceViewModel rvm = new RessourceViewModel(); ServiceRessource sr = new ServiceRessource(); Skills s = new Skills(); ServiceSkills ser = new ServiceSkills(); ServiceSkillRessource skillressource = new ServiceSkillRessource(); SkillRessource skr = new SkillRessource(); var nomskill = ser.GetMany(); List <String> SkillsList = new List <string>(); foreach (var item in nomskill) { SkillsList.Add(item.SkillName); } List <String> WType = (new List <String> { "IT", "HR", "Finance", "Administration" }); List <String> CType = (new List <String> { "Employee", "Freelancer" }); List <String> SType = (new List <String> { "Junior", "Senior" }); var x = ser.Get(t => t.SkillName == rvm.Skill); ViewBag.list1 = WType; ViewBag.list2 = CType; ViewBag.list3 = SType; ViewBag.list4 = SkillsList; skr.SkillRate = rvm.Note; skr.IdRessource = id; skr.IdSkill = x.SkillId; r = sr.GetById(id); r.WorkType = (MapDomain.Entities.WorkType)rvm.WorkType; r.ContractType = (MapDomain.Entities.ContractType)rvm.ContractType; sr.Update(r); sr.Commit(); skillressource.Add(skr); skillressource.Commit(); return(RedirectToAction("AllResources")); }
public ActionResult CompleteProfile(int id) { // public enum ContractType { Employee, Freelancer } // public enum WorkType { IT, HR, Finance, Administration } Ressource r = new Ressource(); RessourceViewModel rvm = new RessourceViewModel(); ServiceRessource sr = new ServiceRessource(); Skills s = new Skills(); ServiceSkills ser = new ServiceSkills(); var nomskill = ser.GetMany(); List <String> SkillsList = new List <string>(); foreach (var item in nomskill) { SkillsList.Add(item.SkillName); } List <String> WType = (new List <String> { "IT", "HR", "Finance", "Administration" }); List <String> CType = (new List <String> { "Employee", "Freelancer" }); List <String> SType = (new List <String> { "Junior", "Senior" }); ViewBag.list1 = WType; ViewBag.list2 = CType; ViewBag.list3 = SType; ViewBag.list4 = SkillsList; r = sr.GetById(id); rvm.UserName = r.UserName; rvm.AccountType = r.AccountType; rvm.Id = r.Id; rvm.ContractType = (MapWeb.Models.ContractType)r.ContractType; rvm.WorkType = (MapWeb.Models.WorkType)r.WorkType; return(View(rvm)); }