예제 #1
0
        public StatusEnum.Status CreateRole(RoleModel model)
        {
            StatusEnum.Status status = StatusEnum.Status.Success;
            try
            {
                _role = new RS.Entity.Models.Roles();
                // _role.RoleId = model.RoleId;
                _role.RoleName = model.RoleName;
                //_role.Description = model.Description;
                //_role.IsDeleted = model.IsDeleted;
                //_role.DeletedBy = model.DeletedBy;
                //_role.DeletedDateTime = model.DeletedDateTime;
                //_role.ModifiedBy = model.ModifiedBy;
                //_role.ModifiedDateTime = model.ModifiedDateTime;
                _roleRepository.Create(_role);
                _roleRepository.SaveChanges();
            }
            catch (Exception)
            {
                status = StatusEnum.Status.Fail;
                throw;
            }

            return(status);
        }
예제 #2
0
 public StatusEnum.Status DeleteRole(Guid id)
 {
     StatusEnum.Status status = StatusEnum.Status.Success;
     try
     {
         RS.Entity.Models.Roles roleDelete = _roleRepository.GetByID(id);
         //roleDelete.IsDeleted = true;
         _roleRepository.Update(roleDelete);
         _roleRepository.SaveChanges();
     }
     catch (Exception)
     {
         status = StatusEnum.Status.Fail;
     }
     return(status);
 }
예제 #3
0
 public StatusEnum.Status UpdateRole(RoleModel model)
 {
     StatusEnum.Status status = StatusEnum.Status.Success;
     try
     {
         RS.Entity.Models.Roles roleUpdate = _roleRepository.GetByID(model.RoleId);
         roleUpdate.RoleId   = model.RoleId;
         roleUpdate.RoleName = model.RoleName;
         //roleUpdate.Description = model.Description;
         //roleUpdate.IsDeleted = model.IsDeleted;
         //roleUpdate.DeletedBy = model.DeletedBy;
         //roleUpdate.DeletedDateTime = model.DeletedDateTime;
         //roleUpdate.ModifiedBy = model.ModifiedBy;
         //roleUpdate.ModifiedDateTime = model.ModifiedDateTime;
         _roleRepository.Update(roleUpdate);
         _roleRepository.SaveChanges();
     }
     catch (Exception)
     {
         status = StatusEnum.Status.Fail;
         throw;
     }
     return(status);
 }