Example #1
0
 public ActionResult SuaLoaitaisan(int id, FormCollection collection)
 {
     try
     {
         LOAITAISAN pb = data.LOAITAISANs.FirstOrDefault(s => s.ID_LOAITAISAN == id);
         pb.NGAYSUA = DateTime.Now;
         UpdateModel(pb);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(View());
     }
 }
Example #2
0
 public ActionResult XoaLoaitaisan(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         LOAITAISAN pb = data.LOAITAISANs.FirstOrDefault(s => s.ID_LOAITAISAN == id);
         data.LOAITAISANs.DeleteOnSubmit(pb);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(View());
     }
 }
Example #3
0
 public ActionResult ThemLoaitaisan(LOAITAISAN a)
 {
     try
     {
         // TODO: Add insert logic here
         a.NGAYTAO   = DateTime.Now;
         a.TRANGTHAI = true;
         data.LOAITAISANs.InsertOnSubmit(a);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(View());
     }
 }