Exemple #1
0
      //GET:Member/ProfilEdit
      public ActionResult ProfilEdit()
      {
          EmployeeService repo   = new EmployeeService();
          Employee        e      = repo.Get(UserSession.CurrentUser.Id);
          ProfilEditForm  profil = new ProfilEditForm(e);

          return(View(profil));
      }
Exemple #2
0
 public ActionResult ProfilEdit(ProfilEditForm form)
 {
     try
     {
         // TODO: Add update logic here
         if (ModelState.IsValid)
         {
             EmployeeService repo    = new EmployeeService();
             Employee        oldData = repo.Get(UserSession.CurrentUser.Id);
             oldData.LastName  = form.LastName;
             oldData.FirstName = form.FirstName;
             oldData.City      = form.City;
             oldData.Street    = form.Street;
             oldData.Number    = form.Number;
             oldData.NumberBox = form.NumberBox;
             oldData.ZipCode   = form.ZipCode;
             oldData.Country   = form.Country;
             oldData.GSM       = form.GSM;
             if (repo.Update(oldData))
             {
                 return(RedirectToAction("ProfilDetail"));
             }
             else
             {
                 return(View(form));
             }
         }
         else
         {
             return(View(form));
         }
     }
     catch
     {
         return(View());
     }
 }