예제 #1
0
 public ActionResult XoaLoaithongtin(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         LOAITHONGTIN pb = data.LOAITHONGTINs.FirstOrDefault(s => s.ID_LTT == id);
         data.LOAITHONGTINs.DeleteOnSubmit(pb);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(View());
     }
 }
예제 #2
0
 public ActionResult SuaLoaithongtin(int id, FormCollection collection)
 {
     try
     {
         LOAITHONGTIN pb = data.LOAITHONGTINs.FirstOrDefault(s => s.ID_LTT == id);
         pb.ID_LOAITAISAN = int.Parse(collection["lts"]);
         pb.NGAYSUA       = DateTime.Now;
         UpdateModel(pb);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(View());
     }
 }
예제 #3
0
 public ActionResult ThemLoaithongtin(LOAITHONGTIN a, FormCollection col)
 {
     try
     {
         // TODO: Add insert logic here
         a.ID_LOAITAISAN = int.Parse(col["lts"]);
         a.NGAYTAO       = DateTime.Now;
         a.TRANGTHAI     = true;
         data.LOAITHONGTINs.InsertOnSubmit(a);
         data.SubmitChanges();
         return(RedirectToAction("Danhmuc"));
     }
     catch
     {
         return(PartialView());
     }
 }