Exemplo n.º 1
0
 public ActionResult Edit(PersonModel model, string button)
 {
     ViewBag.EducationLevels = _enterpriseAdapter.GetEducationLevels();
     ViewBag.PostLevels = _enterpriseAdapter.GetPostLevels();
     ViewBag.Activities = _enterpriseAdapter.GetActivities(model.SummaryId);
     if (button.Equals("Удалить", StringComparison.OrdinalIgnoreCase))
     {
         _enterpriseAdapter.RemovePerson(model.Id);
     }
     else
     {
         if (ModelState.IsValid)
         {
             if (model.Id == 0)
             {
                 _enterpriseAdapter.CreatePerson(model);
             }
             else
             {
                 _enterpriseAdapter.UpdatePerson(model);
             }
         }
     }
     HttpContext.Response.Redirect(HttpContext.Request.Url.AbsoluteUri);
     return this.PartialView(model);
 }
Exemplo n.º 2
0
 public void CreatePerson(PersonModel model)
 {
     using (EnterpriseDataServiceClient proxy = new EnterpriseDataServiceClient())
       {
     proxy.CreatePerson(model.SummaryId, model.ActivityId, model.Title, model.Post, model.PostLevelId, model.EducationLevelId, model.YearSalary, model.Gender,
     model.WasQualificationIncrease, model.WasValidate, model.BirthYear, model.HiringYear, model.StartPostYear, model.DismissalYear ?? 0);
       }
 }
Exemplo n.º 3
0
 public PartialViewResult Edit(int summaryId)
 {
     PersonModel model = new PersonModel();
     model.SummaryId = summaryId;
     ViewBag.EducationLevels = _enterpriseAdapter.GetEducationLevels();
     ViewBag.PostLevels = _enterpriseAdapter.GetPostLevels();
     ViewBag.Activities = _enterpriseAdapter.GetActivities(summaryId);
     return this.PartialView(model);
 }