📄 orderinfo.ascx.cs
字号:
namespace CRM.Web.Controls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CRM.Model;
/// <summary>
/// OrderInfo 的摘要说明。
/// </summary>
public class OrderInfo : CRM.Web.Utility.UserControlBase
{
protected System.Web.UI.WebControls.TextBox Status;
protected System.Web.UI.WebControls.TextBox BZ; //Web组件
protected System.Web.UI.WebControls.Button Back;
protected System.Web.UI.WebControls.Label Msg;
protected System.Web.UI.WebControls.DropDownList CustomerList;
protected System.Web.UI.WebControls.DropDownList TransTypeList;
protected System.Web.UI.HtmlControls.HtmlInputButton submit1;
protected System.Web.UI.HtmlControls.HtmlInputButton reset1;
protected CRM.Model.Parameter parms; //声明要用到的类
protected CRM.Model.OrderInfo order = new CRM.Model.OrderInfo();
private void Page_Load(object sender, System.EventArgs e)
{
this.parms = base.GetRequestParm(); //窗口初始化函数
this.CustomerList.DataSource = BLL.SysUser.GetCustomerByUserId(((SysUserInfo)base.Session["userinfo"]).UserId);
this.CustomerList.DataTextField = "CustomerName";
this.CustomerList.DataValueField = "CustomerId";
this.CustomerList.DataBind();
if (this.parms.ItemId != null && this.parms.ItemId != string.Empty)
{
this.order = BLL.Order.GetOrderById(this.parms.ItemId);
this.CustomerList.SelectedValue = this.order.CustomerId;
this.TransTypeList.SelectedValue = this.order.TransType;
this.Status.Text = this.order.Status;
this.BZ.Text = this.order.BZ;
this.submit1.Disabled = true;
this.reset1.Disabled = true;
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.submit1.ServerClick += new System.EventHandler(this.submit1_ServerClick);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
protected void GetWebNavigate()
{
this.Response.Write(base.InitWebNavigate(this.parms));
}
private void submit1_ServerClick(object sender, System.EventArgs e)
{
this.order.CustomerId = this.CustomerList.SelectedValue;
this.order.TransType = this.TransTypeList.SelectedValue;
this.order.Status = this.Status.Text;
this.order.BZ = this.BZ.Text;
try
{
BLL.Order.Insert(this.order); //确定按扭的响应事件
this.Msg.Text = "恭喜您,订单添加成功!";
}
catch
{
this.Msg.Text = "对不起,订单添加失败!";
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -