Beispiel #1
0
 public ActionResult Edit(string nameAr, string nameEn, string nameOr, int id)
 {
     using (ApplicationDbContext db = new Models.ApplicationDbContext())
     {
         Models.DBTables.Category Category = db.Categories.Where(a => a.ID == id).FirstOrDefault();
         Category.NameAR = nameAr;
         Category.NameEN = nameEn;
         Category.NameOR = nameOr;
         db.SaveChanges();
         return(Json(new { result = true }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #2
0
 public ActionResult Add(string nameAr, string nameEn, string nameOr, int?Categoryid)
 {
     using (ApplicationDbContext db = new ApplicationDbContext())
     {
         Models.DBTables.Category Category = new Models.DBTables.Category()
         {
             NameAR = nameAr, NameEN = nameEn, NameOR = nameOr, Block = false, Delete = false, CategoryID = Categoryid
         };
         db.Categories.Add(Category);
         db.SaveChanges();
         return(Json(new { result = true }, JsonRequestBehavior.AllowGet));
     }
 }