Esempio n. 1
0
 public void Update(Role model)
 {
     var target = Find(model.ID);
     db.Attach<Role>(target);
     target.Name = model.Name;
     target.Description = model.Description;
     db.Commit();
 }
Esempio n. 2
0
 public Role Create(RoleViewModel model)
 {
     var entity = new Role();
     entity.Name = model.Name;
     entity.Description = model.Description;
     if (!string.IsNullOrEmpty(model.ActionID))
     {
         var ActionArray = Utilities.GetIdList(model.ActionID);
         var ActionList = ActionService.GetALL().Where(x => ActionArray.Contains(x.ID));
         entity.Action.AddRange(ActionList);
     }
     db.Add<Role>(entity);
     db.Commit();
     return entity;
 }
Esempio n. 3
0
 public void Delete(Role model)
 {
     var target = Find(model.ID);
     db.Remove<Role>(target);
     db.Commit();
 }
Esempio n. 4
0
 public void Create(Role model)
 {
     db.Add<Role>(model);
     db.Commit();
 }