public InsertDataGroupResponse InsertDataGroup(InsertDataGroupRequest request) { var valid = new ValidationHelper().Initialize(request.Group); InsertDataGroupResponse response = new InsertDataGroupResponse(); try { if (!valid.IsValid) { foreach (var error in valid.Errors) { response.Messages.Add(error.Message); } } else { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { SecurityHelper.InitializeAntiXSS(request.Group); _groupRepo.Add(request.Group); transScope.Complete(); } } } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }
public GetDataFromGridSettingResponse GetDataFromGridSetting(GetDataFromGridSettingRequest request) { GetDataFromGridSettingResponse response = new GetDataFromGridSettingResponse(); try { List <Group> _listGroup = _groupRepo.GetDataFromGridSetting(request.Group); response.GroupList.AddRange(_listGroup); } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }
public GetDataGroupByFilterResponse GetDataGroupByFilter(GetDataGroupByFilterRequest request) { GetDataGroupByFilterResponse response = new GetDataGroupByFilterResponse(); try { List <Group> _listGroup = _groupRepo.GetDataByFilter(request.groupId, request.groupName); response.GroupList.AddRange(_listGroup); } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }
public GetAllDataGroupResponse GetAllDataGroup() { GetAllDataGroupResponse response = new GetAllDataGroupResponse(); try { List <Group> _listGroup = _groupRepo.GetAll(); response.GroupList.AddRange(_listGroup); } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }
public DeleteDataGroupResponse DeleteDataGroup(DeleteDataGroupRequest request) { DeleteDataGroupResponse response = new DeleteDataGroupResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { _groupRepo.Delete(request.Group); transScope.Complete(); } } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }
public GetDataGroupByIdResponse GetDataGroupById(GetDataGroupByIdRequest request) { GetDataGroupByIdResponse response = new GetDataGroupByIdResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { response.Group = _groupRepo.GetDataById(request.groupId); transScope.Complete(); } } catch (Exception ex) { response.Messages.Add(ex.ToString()); LogFileException.LogError(ex, dtStart); } return(response); }