//public decimal CalculateCourierFee() //{ // using (FreeMarketEntities db = new FreeMarketEntities()) // { // decimal totalWeight = GetTotalWeightOfOrder(); // if (totalWeight == 0) // return 0; // else // return (decimal)db.CalculateDeliveryFee(totalWeight, Order.OrderNumber).FirstOrDefault(); // } //} public decimal CalculateCourierFeeAdhoc(int postalCode) { using (FreeMarketEntities db = new FreeMarketEntities()) { decimal totalWeight = GetTotalWeightOfOrder(); if (totalWeight == 0) { return(0); } else { return((decimal)db.CalculateDeliveryFeeAdhoc(totalWeight, postalCode).FirstOrDefault()); } } }