Esempio n. 1
0
        /// <summary>
        /// Gets the the sales report from the utdwsclient to populate the tables
        /// </summary>
        /// <param name="start">the start date</param>
        /// <param name="end">the end Date</param>
        /// <param name="productTypeID">the product type id</param>
        /// <param name="productID">the id of the product</param>
        /// <param name="providerID">id of the provider</param>
        /// <param name="chain">the name of the chain</param>
        /// <param name="merchant">the merchant</param>
        /// <returns>Returns a list of type {UTDWSClient.Interfaces.SalesReport_Result}</returns>
        public static List<UTDWSClient.Interfaces.SalesReport_Result> getSalesReport(DateTime start, DateTime end, string productTypeID="0", string productID="0", string providerID="0",string chain="0",string merchant="0")
        {
            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = UTDWSClient.WSClient.Login("00008475", "00008475");
            if (r.RSP_CODE is String && r.SESSION is String)
            {
                UTDWSClient.Interfaces.ReportParameters recparam = new UTDWSClient.Interfaces.ReportParameters();
                start = start.Subtract(start.TimeOfDay);
                recparam.START = start;
                recparam.END = end.AddHours(23.99);
                recparam.PRODUCT_TYPE_ID = Convert.ToInt32(productTypeID);
                recparam.PRODUCT_ID = Convert.ToInt32(productID);
                recparam.PROVIDER_ID = Convert.ToInt32(providerID);
                recparam.NUMRECORDS = 50;
                UTDWSClient.Interfaces.RspReportSales report = new UTDWSClient.Interfaces.RspReportSales();
                report = WSClient.ReportSales(r.SESSION, recparam);
                List<UTDWSClient.Interfaces.SalesReport_Result> result = report.RESULT;

                if (result.Count > 0)
                {
                    return result;
                }

            }
            return null;
        }
Esempio n. 2
0
 /// <summary>
 ///  Gets the the sales report summarized by provider Type from the utdwsclient to populate the tables
 /// </summary>
 /// <param name="start">The start date</param>
 /// <param name="end">The end date</param>
 /// <returns>Returns a list of type {UTDWSClient.Interfaces.SalesReportByProvider_Result} </returns>
 public static List<UTDWSClient.Interfaces.SalesReportByProvider_Result> getSalesReportByProvider(DateTime start, DateTime end)
 {
     try
     {
         UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
         r = UTDWSClient.WSClient.Login("00008475", "00008475");
         if (r.RSP_CODE is String && r.SESSION is String)
         {
             UTDWSClient.Interfaces.ReportParameters recparam = new UTDWSClient.Interfaces.ReportParameters();
             start = start.Subtract(start.TimeOfDay);
             recparam.START = start;
             recparam.END = end.AddHours(23.99);
             UTDWSClient.Interfaces.RspReportSalesByProvider report = new UTDWSClient.Interfaces.RspReportSalesByProvider();
             report = WSClient.ReportSalesByProvider(r.SESSION, recparam);
             List<UTDWSClient.Interfaces.SalesReportByProvider_Result> result = report.RESULT;
             return result;
         }
         else
         {
             return null;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }