Esempio n. 1
0
 public bool CreateRole(Role instance)
 {
     if (instance.Id == 0)
     {
         Db.Roles.InsertOnSubmit(instance);
         Db.Roles.Context.SubmitChanges();
         return true;
     }
     return false;
 }
Esempio n. 2
0
 public bool UpdateRole(Role instance)
 {
     Role cache = Db.Roles.FirstOrDefault(p => p.Id == instance.Id);
     if (instance.Id == 0)
     {
         cache.Name = instance.Name;
         cache.Code = instance.Code;
         Db.Roles.Context.SubmitChanges();
         return true;
     }
     return false;
 }
 partial void DeleteRole(Role instance);
 partial void UpdateRole(Role instance);
 partial void InsertRole(Role instance);