📄 modify.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LTP.Common;
namespace Maticsoft.Web.AR
{
public partial class Modify : System.Web.UI.Page
{
protected void Page_LoadComplete(object sender, EventArgs e)
{
(Master.FindControl("lblTitle") as Label).Text = "信息修改";
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.Params["id"] != null || Request.Params["id"].Trim() != "")
{
string id = Request.Params["id"];
ShowInfo(int.Parse(id));
}
}
}
private void ShowInfo(string OrderNo)
{
Maticsoft.BLL.AR bll=new Maticsoft.BLL.AR();
Maticsoft.Model.AR model=bll.GetModel(OrderNo);
this.lblDocumentNo.Text=model.DocumentNo;
this.lblOrderNo.Text=model.OrderNo;
this.txtCustomerID.Text=model.CustomerID;
this.txtLinesProID.Text=model.LinesProID;
this.txtGetMoneyType.Text=model.GetMoneyType;
this.txtGetMethods.Text=model.GetMethods;
this.txtGetMoney.Text=model.GetMoney.ToString();
this.txtRemark.Text=model.Remark;
this.txtRecUserID.Text=model.RecUserID;
this.txtRecDate.Text=model.RecDate.ToString();
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtCustomerID.Text =="")
{
strErr+="CustomerID不能为空!\\n";
}
if(this.txtLinesProID.Text =="")
{
strErr+="LinesProID不能为空!\\n";
}
if(this.txtGetMoneyType.Text =="")
{
strErr+="GetMoneyType不能为空!\\n";
}
if(this.txtGetMethods.Text =="")
{
strErr+="GetMethods不能为空!\\n";
}
if(!PageValidate.IsDecimal(txtGetMoney.Text))
{
strErr+="GetMoney不是数字!\\n";
}
if(this.txtRemark.Text =="")
{
strErr+="Remark不能为空!\\n";
}
if(this.txtRecUserID.Text =="")
{
strErr+="RecUserID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtRecDate.Text))
{
strErr+="RecDate不是时间格式!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string CustomerID=this.txtCustomerID.Text;
string LinesProID=this.txtLinesProID.Text;
string GetMoneyType=this.txtGetMoneyType.Text;
string GetMethods=this.txtGetMethods.Text;
decimal GetMoney=decimal.Parse(this.txtGetMoney.Text);
string Remark=this.txtRemark.Text;
string RecUserID=this.txtRecUserID.Text;
DateTime RecDate=DateTime.Parse(this.txtRecDate.Text);
Maticsoft.Model.AR model=new Maticsoft.Model.AR();
model.CustomerID=CustomerID;
model.LinesProID=LinesProID;
model.GetMoneyType=GetMoneyType;
model.GetMethods=GetMethods;
model.GetMoney=GetMoney;
model.Remark=Remark;
model.RecUserID=RecUserID;
model.RecDate=RecDate;
Maticsoft.BLL.AR bll=new Maticsoft.BLL.AR();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -