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