Exemple #1
0
        public ActionResult AddEmploymentInformationSend(EmploymentViewModel eVM)
        {
            if (ModelState.IsValid)
            {
                Person     p = Session["Person"] as Person;
                Employment e = hrServices.CreateEmployment(eVM, p);
                if (e != null)
                {
                    return(RedirectToAction("AddContactPerson"));
                }
                else
                {
                    ModelState.AddModelError("", "Nieznany blad");
                    return(View("AddEmploymentInformation", eVM));
                }
            }
            else
            {
                eVM.Positions      = hrServices.PositionsSelectListItem();
                eVM.Organizations  = hrServices.OrganizationalUnitSelectListItem();
                eVM.ListOfManagers = hrServices.GetAllManagersSelectList();

                return(View("AddEmploymentInformation", eVM));
            }
        }