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 UpdateRole(Role instance);
partial void DeleteRole(Role instance);
partial void InsertRole(Role instance);