public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtFareName.Text.Trim().Length == 0) { strErr += "FareName不能为空!\\n"; } if (!PageValidate.IsDecimal(txtPrice.Text)) { strErr += "Price格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int GroupPriceNo = int.Parse(this.lblGroupPriceNo.Text); int FareRateNo = int.Parse(this.lblFareRateNo.Text); string FareName = this.txtFareName.Text; decimal Price = decimal.Parse(this.txtPrice.Text); WebDemo.Model.WebDemo.RatePrice model = new WebDemo.Model.WebDemo.RatePrice(); model.GroupPriceNo = GroupPriceNo; model.FareRateNo = FareRateNo; model.FareName = FareName; model.Price = Price; WebDemo.BLL.WebDemo.RatePrice bll = new WebDemo.BLL.WebDemo.RatePrice(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int GroupPriceNo, int FareRateNo) { WebDemo.BLL.WebDemo.RatePrice bll = new WebDemo.BLL.WebDemo.RatePrice(); WebDemo.Model.WebDemo.RatePrice model = bll.GetModel(GroupPriceNo, FareRateNo); this.lblGroupPriceNo.Text = model.GroupPriceNo.ToString(); this.lblFareRateNo.Text = model.FareRateNo.ToString(); this.txtFareName.Text = model.FareName; this.txtPrice.Text = model.Price.ToString(); }