示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }