//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); }
public decimal GetSalesPriceJSON(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 _price = DAL.GetPrice(CustomerNo, _dtOrdine, ItemNo, Quantity, "PZ", ""); return(_price); }
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); }