Exemple #1
0
 public int Create(RPT_Menu data)
 {
     using (ReportEntities db = new ReportEntities())
     {
         db.RPT_Menu.Add(data);
         return(db.SaveChanges());
     }
 }
Exemple #2
0
 public int Update(RPT_Menu data)
 {
     using (ReportEntities db = new ReportEntities())
     {
         var exsit = db.RPT_Menu.FirstOrDefault(p => p.MenuID == data.MenuID);
         if (exsit != null)
         {
             int id = exsit.ID;
             exsit.CopyFrom(data);
             exsit.ID = id;
         }
         return(db.SaveChanges());
     }
 }