private void LoadDate() { this.SupplierTitleCode = Request["SupplierTitleCode"] + ""; this.SupplierCode = Request["SupplierCode"] + ""; if (!this.user.HasRight("141802") && !this.user.HasRight("141803")) { this.btnSave.Visible = false; } if (!this.user.HasRight("141804")) { this.btnDelete.Visible = false; } if (this.SupplierTitleCode != "") { RmsPM.BLL.SupplierTitle cSupplierTitle = new RmsPM.BLL.SupplierTitle(); cSupplierTitle.SupplierTitleCode = this.SupplierTitleCode; DataTable dt = cSupplierTitle.GetSupplierTitles(); for (int i = 0; i < dt.Rows.Count; i++) { this.lblCompanyName.Text = RmsPM.BLL.SupplierRule.GetSupplierName(dt.Rows[i]["SupplierCode"].ToString()); this.TxtCompanyTitle.Value = dt.Rows[i]["Title"].ToString(); this.TxtBankAccount.Value = dt.Rows[i]["BankAccount"].ToString(); } } else { this.lblCompanyName.Text = RmsPM.BLL.SupplierRule.GetSupplierName(this.SupplierCode); this.btnDelete.Visible = false; } }
protected void btnDelete_ServerClick(object sender, EventArgs e) { try { RmsPM.BLL.SupplierTitle cSupplierTitle = new RmsPM.BLL.SupplierTitle(); cSupplierTitle.SupplierTitleCode = SupplierTitleCode; cSupplierTitle.SupplierTitleDelete(); Response.Write(Rms.Web.JavaScript.ScriptStart); Response.Write("window.opener.location = window.opener.location;"); Response.Write(Rms.Web.JavaScript.WinClose(false)); Response.Write(Rms.Web.JavaScript.ScriptEnd); } catch (Exception ex) { Response.Write(JavaScript.Alert(true, "删除失败:" + ex.Message)); return; } }
protected void btnSave_ServerClick(object sender, EventArgs e) { try { if (this.TxtCompanyTitle.Value.Trim() == "") { Response.Write(JavaScript.Alert(true, "公司标题不允许为空")); return; } if (this.TxtBankAccount.Value.Trim() == "") { Response.Write(JavaScript.Alert(true, "银行帐号不允许为空")); return; } RmsPM.BLL.SupplierTitle cSupplierTitle = new RmsPM.BLL.SupplierTitle(); cSupplierTitle.SupplierTitleCode = SupplierTitleCode; cSupplierTitle.SupplierCode = this.SupplierCode; cSupplierTitle.Title = this.TxtCompanyTitle.Value; cSupplierTitle.BankAccount = this.TxtBankAccount.Value; cSupplierTitle.SupplierTitleAdd(); Response.Write(Rms.Web.JavaScript.ScriptStart); Response.Write("window.opener.location = window.opener.location;"); Response.Write(Rms.Web.JavaScript.WinClose(false)); Response.Write(Rms.Web.JavaScript.ScriptEnd); } catch (Exception ex) { Response.Write(JavaScript.Alert(true, "保存失败:" + ex.Message)); return; } }