示例#1
0
 public ActionResult Delete(string id, EmployeeDepartmentTableDetails data)
 {
     try
     {
         var employeeResponse = db.ClientTaEmployeeDepartmentTableDetailsbleData.Find(id);
         db.ClientTaEmployeeDepartmentTableDetailsbleData.Remove(employeeResponse);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
 public ActionResult Create(EmployeeDepartmentTableDetails data)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.ClientTaEmployeeDepartmentTableDetailsbleData.Add(data);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View());
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
 public ActionResult Edit(string id, EmployeeDepartmentTableDetails data)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(data).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View());
     }
     catch
     {
         return(View());
     }
 }