コード例 #1
0
        private void CreateEmployee()
        {
            var employee = new Employee
            {
                FirstName = FirstName,
                LastName  = LastName,
                UidCode   = UidCode
            };

            context.CreateEmployee(employee);
            ConnectedSuccessfully = true;
        }
コード例 #2
0
 public IActionResult Create(Employee employee)
 {
     if (ModelState.IsValid)
     {
         if (employee.EmployeeID > 0)
         {
             _employeeContext.Update(employee);
         }
         else
         {
             _employeeContext.CreateEmployee(employee);
         }
         return(RedirectToAction("Index", "Home"));
     }
     else
     {
         return(View(employee));
     }
 }