public static int them(CTTK tk) { try { DAO.QLTONK.them(tk); return(1); } catch (Exception ex) { Console.WriteLine(ex.Message); return(0); } }
public static void them(CTTK tk) { tk.ID = db.TONKHOes.Select(s => s.ID).LastOrDefault(); db.CTTKs.Add(tk); db.SaveChanges(); }