////////////////////////////////////////////////////////////////////////// //Parcelforce 优先自动包 邮费的计算 /// <summary> /// 快件从英国发送到英国,只与重量有关 /// </summary> /// <param name="weight">重量</param> /// <returns>返回邮寄费用</returns> private float parcelforceAutoFromUKToUK(float weight) { float price = 0; Postage postage = new PostageDAO().getPostage(weight, "UK", "UK", "Parcelforce priority auto"); if (weight >= postage.Weight) { weight = postage.Weight; } price = weight * postage.Rate; return(price); }
/// <summary> /// 计算从英国寄到英国的包裹 /// </summary> /// <param name="weight">重量</param> /// <param name="length">长度</param> /// <param name="width">宽度</param> /// <param name="height">高度</param> /// <returns></returns> private float parcelforceEconomyFromUKToUK(float weight, float length, float width, float height) { float price = 0; Postage postage = new PostageDAO().getPostage(weight, "UK", "UK", "Parcelforce economy"); if (weight >= postage.Weight) { weight = postage.Weight; } price = weight * postage.Rate; return(price); }
/// <summary> /// 计算从英国寄往台湾的包裹费用 /// </summary> /// <param name="weight">重量</param> /// <param name="length">长度</param> /// <param name="width">宽度</param> /// <param name="height">高度</param> /// <returns></returns> private float parcelforceAutoFromUKToTaiWan(float weight, float length, float width, float height) { Postage rate = new Postage(); float price = 0; //获得包裹的实际重量,如果体积过大就计算体积重 weight = (float)Math.Max(weight, ((length * width * height) / 5000.0)); if (weight <= 30.0) { rate = new PostageDAO().getPostage(weight, "UK", "TaiWan", "Parcelforce priority auto"); price = rate.Rate; } else { rate = new PostageDAO().getPostage(30.0f, "UK", "TaiWan", "Parcelforce priority auto"); price = (float)(rate.Rate + (weight - 30.0) * 1.78 * 2 * 1.01); } return(price); }
/// <summary> /// 计算从英国寄到台湾的邮费 /// </summary> /// <param name="weight">重量</param> /// <param name="length">长度</param> /// <param name="width">宽度</param> /// <param name="height">高度</param> /// <returns></returns> private float parcelforceEconomyFromUKToTaiWan(float weight, float length, float width, float height) { float price = 0; Postage postage = new Postage(); //获得包裹的实际重量,如果体积过大就计算体积重 weight = (float)Math.Max(weight, ((length * width * height) / 5000.0)); if (weight <= 30.0) { postage = new PostageDAO().getPostage(weight, "UK", "TaiWan", "Parcelforce economy"); price = postage.Rate; } else { postage = new PostageDAO().getPostage(30.0f, "UK", "TaiWan", "Parcelforce economy"); price = (float)(postage.Rate + (weight - 30.0) * 1.75 * 2 * 1.01); } return(price); }