Пример #1
0
        public GetFiscalsResponse GetFiscalsOfCustomer(AjaxGetRequest request, Guid customerID)
        {
            GetFiscalsResponse response = new GetFiscalsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Query     query    = new Query();
                Criterion criteria = new Criterion("Customer.ID", customerID, CriteriaOperator.Equal);
                query.Add(criteria);

                Response <Fiscal> fiscalsResponse = _fiscalRepository.FindBy(query, index, count);

                IEnumerable <FiscalView> fiscals = fiscalsResponse.data.ConvertToFiscalViews();

                response.FiscalViews = fiscals;
                response.Count       = fiscalsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Пример #2
0
        public GetFiscalsResponse GetFiscalsCanConfirm(AjaxGetRequest request, string employeeID)
        {
            GetFiscalsResponse response = new GetFiscalsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                string query = "From Fiscal F Where '" + employeeID
                               + "' In (Select M.Employee.ID From F.MoneyAccount.MoneyAccountEmployees M)"
                               + " AND Confirm <> 2 AND Confirm <> 3";

                Response <Fiscal> fiscalsResponse = _fiscalRepository
                                                    .FindAll(query, index, count);

                IEnumerable <FiscalView> fiscals = fiscalsResponse.data
                                                   .ConvertToFiscalViews();

                response.FiscalViews = fiscals;
                response.Count       = fiscalsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Пример #3
0
        public GetFiscalsResponse GetFiscalsCreatedOrConfirmedWithMe(AjaxGetRequest request, string employeeID)
        {
            GetFiscalsResponse response = new GetFiscalsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                string query = "From Fiscal Where CreateEmployee.ID = '" + employeeID + "' Or ConfirmEmployee.ID = '" + employeeID + "'";

                Infrastructure.Domain.Response <Fiscal> fiscalsResponse = _fiscalRepository
                                                                          .FindAll(query, index, count);

                IEnumerable <FiscalView> fiscals = fiscalsResponse.data
                                                   .ConvertToFiscalViews();

                response.FiscalViews = fiscals;
                response.Count       = fiscalsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Пример #4
0
        public GetFiscalsResponse GetFiscals(AjaxGetRequest request)
        {
            GetFiscalsResponse response = new GetFiscalsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Response <Fiscal> fiscalsResponse = _fiscalRepository.FindAll(index, count);

                IEnumerable <FiscalView> fiscals = fiscalsResponse.data.ConvertToFiscalViews();

                response.FiscalViews = fiscals;
                response.Count       = fiscalsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }