Пример #1
0
        public string ExportFuelOrdersByCustClient(ExportDataRequest model)
        {
            var       table = ExportFuelOrdersByCust(model.ClientID, model.ListOfIDs, model.StartDate.ToShortDateString(), model.EndDate.ToShortDateString());
            DataTable copyDataTable;

            copyDataTable            = table.Copy();
            copyDataTable.PrimaryKey = null;
            copyDataTable.Columns["Name"].SetOrdinal(0);
            copyDataTable.Columns["RequestedBy"].SetOrdinal(1);
            copyDataTable.Columns["TailNumber"].SetOrdinal(4);
            copyDataTable.Columns["Product"].SetOrdinal(5);
            copyDataTable.Columns["PPG"].SetOrdinal(6);
            copyDataTable.Columns["DateRequested"].SetOrdinal(7);
            copyDataTable.Columns["FuelingDateTime"].SetOrdinal(8);
            copyDataTable.Columns["PostedRetail"].SetOrdinal(9);
            copyDataTable.Columns["QuotedPPG"].SetOrdinal(10);
            copyDataTable.Columns["InvoicedPPG"].SetOrdinal(11);
            copyDataTable.Columns["QuotedVolume"].SetOrdinal(12);
            copyDataTable.Columns["InvoicedVolume"].SetOrdinal(13);
            copyDataTable.Columns["RampFee"].SetOrdinal(14);
            copyDataTable.Columns["RampFeeWaivedAt"].SetOrdinal(15);
            copyDataTable.Columns["InvoiceStatus"].SetOrdinal(16);
            copyDataTable.Columns["CustNotes"].SetOrdinal(17);
            string filePath = ExportHelper.CreateFilePath("FuelOrderTransactions.csv", model.ClientName);

            CSVGenerator.GenerateCSV(copyDataTable, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
Пример #2
0
        public string ExportContacts(ExportDataRequest model)
        {
            var    table    = GetCompanies(model.ClientID, model.ListOfIDs);
            string filePath = ExportHelper.CreateFilePath("Companies.csv", model.ClientName);

            CSVGenerator.GenerateCSV(table, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
Пример #3
0
        public string ExportCustTotalByStatusData(GetDashboardRequest model)
        {
            var    table    = GetTotalCustFuelOrdersByStatusDataTable(model.ClientID, model.StartDateFilter.ToShortDateString(), model.EndDateFilter.ToShortDateString());
            string filePath = ExportHelper.CreateFilePath("FuelOrdersTotalByStatus.csv", model.ClientName);

            CSVGenerator.GenerateCSV(table, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
Пример #4
0
        public string ExportFuelOrdersByAdminClient(ExportDataRequest model)
        {
            var    table    = ExportFuelOrders(model.ClientID, model.ListOfIDs, model.StartDate.ToShortDateString(), model.EndDate.ToShortDateString());
            string filePath = ExportHelper.CreateFilePath("FuelOrderTransactions.csv", model.ClientName);

            CSVGenerator.GenerateCSV(table, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
Пример #5
0
        public string ExportByClientID(ExportDataRequest model)
        {
            if (!ModelState.IsValid)
            {
                return((Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)).ToString());
            }
            var    table    = GetAirports(model.ClientID, model.ListOfIDs);
            string filePath = ExportHelper.CreateFilePath("Airports.csv", model.ClientName);

            CSVGenerator.GenerateCSV(table, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }
Пример #6
0
        public string ExportPrices(ExportDataRequest model /*int adminId, string adminName*/)
        {
            var       table = GetSupplierFuelsPricesDataTable(model.ClientID);
            DataTable copyDataTable;

            copyDataTable            = table.Copy();
            copyDataTable.PrimaryKey = null;
            copyDataTable.Columns.Remove("Id");
            copyDataTable.Columns.Remove("AdminClientID");
            copyDataTable.Columns.Remove("SupplierID");
            copyDataTable.Columns.Remove("DateUploaded");
            copyDataTable.Columns["EffectiveDate"].SetOrdinal(7);
            string filePath = ExportHelper.CreateFilePath("VendorFuelsPrices.csv", model.ClientName);

            CSVGenerator.GenerateCSV(copyDataTable, filePath);
            return(ExportHelper.GetFilePathFromRoot(filePath));
        }