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); }
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); }
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); }
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); }