예제 #1
0
        public ActionResult Edit(Employee employee)
        {
            if (ModelState.IsValid)
            {
                EmployeeContainer.SaveEmployee(employee);
                return(RedirectToAction("Index"));
            }

            return(View(employee));
        }
예제 #2
0
        public ActionResult Create(Employee employee)
        {
            if (ModelState.IsValid)
            {
                EmployeeContainer.SaveEmployee(employee);
                return(RedirectToAction("Index"));
            }
            var model = new EmployeeModel();

            model.Employee = employee;
            model.Markets  = MarketContainer.GetMarkets();

            return(View(model));
        }
예제 #3
0
        public ActionResult Create(Employee employee)
        {
            if (ModelState.IsValid)
            {
                if ((int)Session["role"] > SessionAccessor.getUserRole(employee.Functie))
                {
                    EmployeeContainer.SaveEmployee(employee);
                    return(RedirectToAction("Index"));
                }
            }
            var model = new EmployeeModel();

            model.Employee = employee;
            model.Markets  = MarketContainer.GetMarkets();

            return(View(model));
        }