private double CalculationPrice(TempOrderVo vo) { string priceType = this.comboType.Text; double serverPrice = SelectDao.GetSkillPriceDetail(vo.SkillName, vo.WorkType, priceType); double gstPrice = 0; double totalPrice = 0; if (priceType.Equals("现金") || priceType.Equals("Visa卡")) { gstPrice = (serverPrice * 6) / 106; } gstPrice = Math.Round(gstPrice, 2, MidpointRounding.AwayFromZero); totalPrice = serverPrice + gstPrice; return(totalPrice); }
private void ComboType_SelectedIndexChanged(object sender, EventArgs e) { double serverPrice = 0; double gstPrice = 0; double totalPrice = 0; string priceType = this.comboType.Text; foreach (TempOrderVo vo in selectedVoList) { serverPrice += SelectDao.GetSkillPriceDetail(vo.SkillName, vo.WorkType, priceType); } if (priceType.Equals("现金") || priceType.Equals("Visa卡")) { gstPrice = (serverPrice * 6) / 106; } gstPrice = Math.Round(gstPrice, 2, MidpointRounding.AwayFromZero); totalPrice = serverPrice + gstPrice; this.textPrice.Text = serverPrice.ToString(); this.textGst.Text = gstPrice.ToString(); this.textTotal.Text = totalPrice.ToString(); }