📄 addremit.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Crm
{
using PowerEasy.Common;
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Crm;
using PowerEasy.Model.Crm;
using PowerEasy.Web.UI;
using System;
using System.Web.UI.WebControls;
public class AddRemit : AdminPage
{
protected Button BtnCancel;
protected DatePicker DpkReceiptDate;
protected HiddenField HdnClientId;
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtBalance;
protected TextBox TxtBank;
protected TextBox TxtClientName;
protected TextBox TxtMemo;
protected TextBox TxtMoney;
protected TextBox TxtRemark;
protected Button TxtSave;
protected PowerEasy.Controls.RequiredFieldValidator ValrMoney;
protected PowerEasy.Controls.RequiredFieldValidator ValrReceiptDate;
protected DateValidator VdateReceiptDate;
protected MoneyValidator VmoneyMoney;
protected void BtnCancel_Click(object sender, EventArgs e)
{
BasePage.ResponseRedirect("ClientShow.aspx?ClientID=" + this.HdnClientId.Value);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.Page.IsPostBack)
{
int clientId = BasePage.RequestInt32("ClientID");
this.ShowInitialize(clientId);
}
}
protected void ShowInitialize(int clientId)
{
this.HdnClientId.Value = clientId.ToString();
ClientInfo clientById = Client.GetClientById(clientId);
if (!clientById.IsNull)
{
this.TxtClientName.Text = clientById.ClientName;
this.TxtBalance.Text = clientById.Balance.ToString();
}
else
{
AdminPage.WriteErrMsg("未找到该客户的相关信息!", "ClientManage.aspx");
}
}
protected void TxtSave_Click(object sender, EventArgs e)
{
if (this.Page.IsValid)
{
int clientId = DataConverter.CLng(this.HdnClientId.Value);
decimal money = DataConverter.CDecimal(this.TxtMoney.Text);
DateTime receiptDate = DataConverter.CDate(this.DpkReceiptDate.Text);
string text = this.TxtBank.Text;
string remark = this.TxtRemark.Text;
if (Client.Remit(clientId, money, receiptDate, text, remark, PEContext.Current.Admin.AdminName, this.TxtMemo.Text))
{
AdminPage.WriteSuccessMsg("添加银行汇款成功!", "ClientShow.aspx?ClientID=" + clientId + "&InfoType=3");
}
else
{
AdminPage.WriteErrMsg("添加银行汇款失败!", "");
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -