public RolesAccessDTO InserRoleAccess(RolesAccessDTO data) { RolesAccess rolesToInsert = new RolesAccess(); rolesToInsert = RolesAccessRequestFormatter.ConvertRespondentInfoFromDTO(data); var responseData = _unitOfWork.RolesAccessRepository.Create(rolesToInsert); return(RolesAccessRequestFormatter.ConvertRespondent(responseData)); }
public RolesAccessDTO GetRoleByRoleIdModuleId(string roleid, string moduleid, string assignid) { int roleId = Convert.ToInt16(roleid); int moduleId = Convert.ToInt16(moduleid); int assignId = Convert.ToInt16(assignid); RolesAccess values = _unitOfWork.RolesAccessRepository.All().Where(x => x.AssignRoleId == roleId && x.AssignModuleId == moduleId && x.AssignId == assignId).First(); return(RolesAccessRequestFormatter.ConvertRespondentInfoToDTO(values)); }
public int UpdateRolesAccess(RolesAccessDTO data) { RolesAccess rolesToUpdate = new RolesAccess(); rolesToUpdate = RolesAccessRequestFormatter.ConvertRespondentInfoFromDTO(data); int res = _unitOfWork.RolesAccessRepository.Update(rolesToUpdate); _unitOfWork.Save(); return(res); }