예제 #1
0
 public ActionResult Delete(int id, Config pNewConfig)
 {
     try
     {
         // TODO: Add delete logic here
         var check = new ConfigModel().Remove(id);
         if (check)
             return RedirectToAction("Index");
         else
             return View(pNewConfig);
     }
     catch
     {
         return View();
     }
 }
예제 #2
0
 public ActionResult Create(Config pNewConfig,string Lang)
 {
     try
     {
         // TODO: Add insert logic here
         if (Lang == "Tiếng Việt")
             pNewConfig.LangId = 0;
         else
             pNewConfig.LangId = 1;
         var check = new ConfigModel().Create(pNewConfig);
         if (check)
             return RedirectToAction("Index");
         else
             return View(pNewConfig);
     }
     catch
     {
         return View(pNewConfig);
     }
 }
예제 #3
0
 public ActionResult Edit(int id, Config pNewConfig,string Lang)
 {
     try
     {
         // TODO: Add update logic here
         if (Lang == "Tiếng Việt")
             pNewConfig.LangId = 0;
         else
             pNewConfig.LangId = 1;
         var check = new ConfigModel().Edit(id,pNewConfig);
         if (check)
             return RedirectToAction("Index");
         else
             return View(pNewConfig);
     }
     catch
     {
         return View();
     }
 }