⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contract.ascx.cs

📁 某个公司需要维持良好的客户关系
💻 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>
	///		Contract 的摘要说明。
	/// </summary>
	public class Contract : CRM.Web.Utility.UserControlBase
	{
		protected System.Web.UI.WebControls.TextBox BZ;
		protected System.Web.UI.WebControls.Label Msg;
		protected System.Web.UI.WebControls.DropDownList CustomerList;
		protected System.Web.UI.HtmlControls.HtmlInputButton submit1;
		protected System.Web.UI.HtmlControls.HtmlInputButton reset1;
		protected System.Web.UI.WebControls.TextBox Status;

		protected CRM.Model.Parameter parms;
		protected System.Web.UI.WebControls.Button Back;
		protected System.Web.UI.WebControls.TextBox Content;
		protected CRM.Model.BargainInfo bargain = new CRM.Model.BargainInfo();

		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.bargain = BLL.Bargain.GetBargainById(this.parms.ItemId);
				this.CustomerList.SelectedValue = this.bargain.CustomerId;
				this.Content.Text = this.bargain.Content;
				this.Status.Text = this.bargain.Status;
				this.BZ.Text = this.bargain.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.bargain.CustomerId = this.CustomerList.SelectedValue;
			this.bargain.Content = this.Content.Text;
			this.bargain.Status = this.Status.Text;
			this.bargain.BZ = this.BZ.Text;
			try
			{
				BLL.Bargain.Insert(this.bargain);
				this.Msg.Text = "恭喜您,合同添加成功!";

			}
			catch
			{
				this.Msg.Text = "对不起,合同添加失败!";
			}
		}

				
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -