コード例 #1
0
 public ActionResult Edit(Employee employee)
 {
     if (ModelState.IsValid)
     {
         this.employeeRepository.InsertOrUpdate(employee);
         this.employeeRepository.Save();
         return RedirectToAction("Index");
     }
     
     return this.View();
 }
コード例 #2
0
 public void InsertOrUpdate(Employee employee)
 {
     if (employee.ID == default(int))
     {
         this.context.Employees.Add(employee);
     }
     else
     {
         this.context.Entry(employee).State = EntityState.Modified;
     }
 }
コード例 #3
0
        public ActionResult Create(Employee employee)
        {
            var client = new HttpClient();
            client.GetAsync("www.dcsdcds.dcs");
            logger.Trace("Request made");
            if (ModelState.IsValid)
            {
                this.employeeRepository.InsertOrUpdate(employee);
                this.employeeRepository.Save();
                return RedirectToAction("Index");
            }
          

            return this.View();
        }