private static string GetDeliverType(int deliverTypeId) { DeliverTypeInfo deliverTypeById = DeliverType.GetDeliverTypeById(deliverTypeId); if (!deliverTypeById.IsNull) { return(deliverTypeById.TypeName); } return(string.Empty); }
public static decimal GetDeliverCharge(int deliverTypeId, double totalWeight, string postCode, decimal totalMoney, bool needInvoice) { DeliverTypeInfo deliverTypeById = DeliverType.GetDeliverTypeById(deliverTypeId); decimal chargeByTotalMoney = 0M; if (!deliverTypeById.IsNull) { switch (deliverTypeById.ChargeType) { case 0: chargeByTotalMoney = 0M; break; case 1: if (totalWeight > 0.0) { chargeByTotalMoney = GetChargeByWeight(postCode, deliverTypeId, totalWeight); } break; case 2: chargeByTotalMoney = GetChargeByTotalMoney(deliverTypeById, totalMoney); break; case 3: return(deliverTypeById.MinMoney1); } if (((chargeByTotalMoney > 0M) && (deliverTypeById.ReleaseType > 0)) && (totalMoney >= deliverTypeById.MinMoney1)) { chargeByTotalMoney = GetAgreedCharge(chargeByTotalMoney, totalMoney, deliverTypeById); } } if (chargeByTotalMoney > 0M) { chargeByTotalMoney = TaxRateComputeOfDeliver(deliverTypeById, chargeByTotalMoney, needInvoice); } if (chargeByTotalMoney < 0M) { chargeByTotalMoney = 0M; } return(chargeByTotalMoney); }