예제 #1
0
 public OpResult SaveRole(ProductRole obj)
 {
     if (obj.Id == 0)
     {
         obj.RoleId    = ProductRoleRepository.GetMaxInt(o => o.RoleId, whereLambda: o => o.RoleVerId == obj.RoleVerId);
         obj.CreateDT  = DateTime.Now;
         obj.CreateUID = CurrentUser.UID;
         ProductRoleRepository.Add(obj, false);
     }
     else
     {
         var role = ProductRoleRepository.Get(obj.Id);
         role.Title = obj.Title;
     }
     ProductRoleRepository.SaveChanges();
     return(OpResult.Success());
 }
예제 #2
0
 public ProductRole GetRole(int id)
 {
     return(ProductRoleRepository.Get(id));
 }