Exemplo n.º 1
0
 public ActionResult Edit(int id, Ressource R, HttpPostedFileBase upload)
 {
     try
     {
         if (upload != null)
         {
             string path = Path.Combine(Server.MapPath("~/Content/Upload"), upload.FileName);
             upload.SaveAs(path);
             R.PictureURL = upload.FileName;
         }
         Domain.Entity.Ressource ress = serviceRessource.GetById(id);
         ress.LastName         = R.LastName;
         ress.FirstName        = R.FirstName;
         ress.ContractType     = R.ContractType;
         ress.Seniority        = R.Seniority;
         ress.PictureURL       = R.PictureURL;
         ress.SkillSet         = R.SkillSet;
         ress.Notes            = R.Notes;
         ress.Resume           = R.Resume;
         ress.state            = R.state;
         ress.OrganizationalId = R.OrganizationalId;
         serviceRessource.Update(ress);
         serviceRessource.Commit();
         return(RedirectToAction("Index"));
     } catch
     {
         return(View());
     }
 }
Exemplo n.º 2
0
        // GET: Resource/Edit/5
        public ActionResult Edit(int id)
        {
            //if(id == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            Ressource p = rs.GetById(id);
            //if (p == null)
            //{
            //    //return HttpNotFound();
            //    return View();
            //}
            ResourceModel pm = new ResourceModel();

            pm.Name      = p.UserName;
            pm.ProfileT  = p.ProfileT;
            pm.Seniority = p.Seniority;
            pm.Email     = p.Email;


            return(View(pm));
        }