Esempio n. 1
0
        //URL TEST: http://localhost:35798/B2BService.svc/getPrezzoXML?cliente=05000003&data=13-11-2014&art=01001&qty=5
        public decimal GetSalesPriceXML(string CustomerNo, string OrderDate, string ItemNo, decimal Quantity)
        {
            if (!CheckBasicAuthentication())
            {
                //Autenticazione non riuscita
                throw new WebFaultException(HttpStatusCode.Unauthorized);
            }

            DateTime  _dtOrdine = Convert.ToDateTime(OrderDate);
            DALPrices DAL       = new DALPrices();
            decimal   _price    = DAL.GetPrice(CustomerNo, _dtOrdine, ItemNo, Quantity, "PZ", "");

            return(_price);
        }
Esempio n. 2
0
        public decimal GetSalesDiscountJSON(string CustomerNo, string OrderDate, string ItemNo, decimal Quantity)
        {
            if (!CheckBasicAuthentication())
            {
                //Autenticazione non riuscita
                //throw new HttpException(401, "Unauthorized access"); //No HttpException perchè viene convertita in errore 400
                throw new WebFaultException(HttpStatusCode.Unauthorized);
            }

            DateTime  _dtOrdine = Convert.ToDateTime(OrderDate);
            DALPrices DAL       = new DALPrices();
            decimal   _discount = DAL.GetDiscount(CustomerNo, _dtOrdine, ItemNo, Quantity, "PZ", "");

            return(_discount);
        }
Esempio n. 3
0
        public ItemDetail GetItemDetailJSON(string CustomerNo, string OrderDate, string ItemNo, decimal Quantity)
        {
            if (!CheckBasicAuthentication())
            {
                //Autenticazione non riuscita
                throw new WebFaultException(HttpStatusCode.Unauthorized);
            }

            ItemDetail DET       = new ItemDetail();
            DALPrices  DAL       = new DALPrices();
            DateTime   _dtOrdine = Convert.ToDateTime(OrderDate);

            DET.ItemNo   = ItemNo;
            DET.Price    = DAL.GetPrice(CustomerNo, _dtOrdine, ItemNo, Quantity, "PZ", "");
            DET.Discount = DAL.GetDiscount(CustomerNo, _dtOrdine, ItemNo, Quantity, "PZ", "");
            return(DET);
        }