예제 #1
0
        //
        // GET: /Employee/Edit/5

        public ActionResult Edit(int id = 0)
        {
            EmployMvcPresentation.Models.EmployeeViewModel employee = Repository.FetchById(id).ToViewModel();
            if (employee == null)
            {
                return(HttpNotFound());
            }
            return(View(employee));
        }
예제 #2
0
        public ActionResult Create(EmployMvcPresentation.Models.EmployeeViewModel employee)
        {
            if (ModelState.IsValid)
            {
                Repository.Add(employee.ToDataContract());
                return(RedirectToAction("Index"));
            }

            return(View(employee));
        }