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