예제 #1
0
 public ActionResult Creat(CatagorySolution catagorySolution)
 {
     if (ModelState.IsValid) {
     dbContext.CatagorySolutions.Add(catagorySolution);
     dbContext.SaveChanges();
     int index = 0;
     index = dbContext.CatagorySolutions.OrderBy(x => x.CatagorySolutionName).ToList().IndexOf(catagorySolution);
     return Json(index,JsonRequestBehavior.AllowGet);
     }
     return new HttpStatusCodeResult(400, "Custom Error Message 2");
 }
예제 #2
0
 public ActionResult UpdateCatagorySolution(CatagorySolution catagorySolution)
 {
     if (ModelState.IsValid)
     {
         dbContext.Entry(catagorySolution).State = EntityState.Modified;
         dbContext.SaveChanges();
         return null;
     }
     else
     {
         return new HttpStatusCodeResult(400, "Custom Error Message 2");
     }
 }