当前位置: 首页>>代码示例>>C#>>正文


C# Parcel.getSizeWeight方法代码示例

本文整理汇总了C#中Parcel.getSizeWeight方法的典型用法代码示例。如果您正苦于以下问题:C# Parcel.getSizeWeight方法的具体用法?C# Parcel.getSizeWeight怎么用?C# Parcel.getSizeWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parcel的用法示例。


在下文中一共展示了Parcel.getSizeWeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: show_estimate

        private void show_estimate(string invoiceNo)
        {
            txtBox_estimate_AP.Text = "Invalid";
            txtBox_estimate_AP_factor = 0.0;
            txtBox_estimate_AP_nonfactor = 0.0;
            txtBox_estimate_HE.Text = "Invalid";
            txtBox_estimate_HE_factor = 0.0;
            txtBox_estimate_HE_nonfactor = 0.0;
            txtBox_estimate_EP.Text = "Invalid";
            txtBox_estimate_EP_factor = 0.0;
            txtBox_estimate_EP_nonfactor = 0.0;
            txtBox_estimate_EP_weightfactor = 0.0;
            txtBox_estimate_TL.Text = "Invalid";
            txtBox_estimate_TL_factor = 0.0;
            txtBox_estimate_TL_nonfactor = 0.0;
            txtBox_estimate_TL_weightfactor = 0.0;
            double AP_total = 0.0;
            double EP_total = 0.0;
            double HE_total = 0.0;
            double TL_total = 0.0;
            double EP_size_total = 0.0;
            double TL_size_total = 0.0;

            cost_estimates = new ArrayList(6) { "","","","","",""};

            string new_temp_city = temp_invoice.InvoiceCustomer.City;
            int num_parcels = int.Parse(txtBox_input_parcelnum.Text);
            int parcel_number = 1;

            //int numSizeWeights = txtBox_input_dimensions.Text == "" ? 0 : txtBox_input_dimensions.Text.Split('/').Length;

            // Split the weights and do separate checks for each
            foreach (string str_weight in txtBox_input_weight.Text.Split('/')) {
                float weight = float.Parse(str_weight);
                if (weight > 25.0) {
                    MessageBox.Show("Parcel weight is larger than 25KGs!"); return;
                }

                Parcel p = new Parcel(weight, parcel_number, 0.0d, num_parcels);
                temp_invoice.addParcel(p);

                //if (numSizeWeights > 0 && parcel_number <= numSizeWeights) {
                    Dimensions d = new Dimensions();
                    //string vals = txtBox_input_dimensions.Text.Split('/')[parcel_number - 1];
                    //string[] items = vals.Split('-');
                    txtBox_input_L.Text = string.IsNullOrEmpty(txtBox_input_L.Text) ? "0" : txtBox_input_L.Text;
                    txtBox_input_W.Text = string.IsNullOrEmpty(txtBox_input_W.Text) ? "0" : txtBox_input_W.Text;
                    txtBox_input_H.Text = string.IsNullOrEmpty(txtBox_input_H.Text) ? "0" : txtBox_input_H.Text;
                    //if (items.Length == 3) {
                        d.Length = float.Parse(txtBox_input_L.Text);
                        d.Width = float.Parse(txtBox_input_W.Text);
                        d.Height = float.Parse(txtBox_input_H.Text);

                        p.Size = d;
                    //}
                //}

                // Get Australia post estimate
                //PricingMatrix matrix = GetMatrix(AP);

                float rate = BusinessLayer.PricingAPI.GetCostEstimate(AustraliaPost, p, temp_invoice);
                //float rate = matrix.getCostEstimate(p, temp_invoice);
                AP_total += rate;
                if (parcel_number == 1)
                    cost_estimates[0] = (rate.ToString());
                else
                    cost_estimates[0] += "|" + (rate.ToString());

                // Get Hunter Express estimate
                //matrix = GetMatrix(HE);
                rate = BusinessLayer.PricingAPI.GetCostEstimate(HunterExpress, p, temp_invoice);
                HE_total += rate;
                if (parcel_number == 1)
                    cost_estimates[1] = (rate.ToString());
                else
                    cost_estimates[1] += "|" + (rate.ToString());

                // Get E-post estimate
                // matrix = GetMatrix(EP);
                rate = BusinessLayer.PricingAPI.GetCostEstimate(EPost, p, temp_invoice);
                EP_total += rate;
                if (parcel_number == 1) {
                    cost_estimates[2] = (rate.ToString());
                } else {
                    cost_estimates[2] += "|" + (rate.ToString());
                }

                // Get E-post size estimate
                float sizeWeight = p.getSizeWeight() * EPost.DimensionWeightRate;
                rate = BusinessLayer.PricingAPI.GetCostEstimateByWeight(sizeWeight, EPost, p, temp_invoice);
                //rate = matrix.getEstimateByWeight(sizeWeight, temp_invoice.InvoiceCustomer.Postcode, p.ParcelNumber);
                EP_size_total += rate;
                if (parcel_number == 1) {
                    cost_estimates[3] = (rate.ToString());
                    txtBox_sizeweight_EP.Text = sizeWeight.ToString("N2") + "kg";
                } else {
                    cost_estimates[3] += "|" + (rate.ToString());
                    txtBox_sizeweight_EP.Text += "|" + sizeWeight.ToString("N2") + "kg";
                }

//.........这里部分代码省略.........
开发者ID:mikeyq6,项目名称:LabelPrintingSystem_Manifest,代码行数:101,代码来源:Form1.cs


注:本文中的Parcel.getSizeWeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。