protected void btnSubmit_Click(object sender, EventArgs e) { if (this.IsValid) { ICurrencyService service = ServiceFactory.GetService <ICurrencyService>(); CurrencyBlacklist entity = null; if (this.IsInsert) { entity = new CurrencyBlacklist() { CurrencyKindCode = this.ddlCurrencyKind.SelectedValue.ToByte(0), FaceAmount = this.txtFaceAmount.Text.Trim().ToShort(0), CurrencyVersion = this.txtCurrencyVersion.Text.Trim().ToShort(0), CurrencyNumber = this.txtCurrencyNumber.Text.Trim() }; if (service.CheckExists_Blacklist(entity)) { this.JscriptMsg("纸币号码已存在", null, "Error"); return; } } service.Save_Blacklist(entity); if (this.IsInsert && (sender as Button).CommandName == "SubmitContinue") { this.ReturnUrl = this.Request.Url.PathAndQuery; } this.JscriptMsg("数据保存成功", this.ReturnUrl, "Success"); } }