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

📄 userbaseinfo.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>
	///		UserBaseInfo 的摘要说明。
	/// </summary>
	public class UserBaseInfo : CRM.Web.Utility.UserControlBase
	{
		protected System.Web.UI.WebControls.Label Msg;
		protected System.Web.UI.WebControls.TextBox UserNickName;
		protected System.Web.UI.WebControls.DropDownList Sex;
		protected System.Web.UI.WebControls.TextBox Birthday;
		protected System.Web.UI.WebControls.DropDownList Month;
		protected System.Web.UI.WebControls.DropDownList Day;
		protected System.Web.UI.WebControls.TextBox MobilePhone;
		protected System.Web.UI.WebControls.TextBox Phone;
		protected System.Web.UI.WebControls.TextBox Email;
		protected System.Web.UI.WebControls.TextBox PostCode;
		protected System.Web.UI.WebControls.TextBox Address;
		protected System.Web.UI.WebControls.Button UserInfo_Submit;
		protected System.Web.UI.WebControls.Button UserInfo_Reset;
		protected System.Web.UI.HtmlControls.HtmlTextArea BZ;

		protected CRM.Model.Parameter parms;
		protected CRM.Model.UserPower power;
		protected CRM.Model.SysUserInfo user = new CRM.Model.SysUserInfo();

		private void Page_Load(object sender, System.EventArgs e)
		{
			this.parms = base.GetRequestParm();
			this.PageDateBind(null);

		}
		#region 页面控件数据绑定
		protected void PageDateBind(string option)
		{
			this.user = BLL.SysUser.GetSysUserById(((SysUserInfo)base.Session["userinfo"]).UserId);
			if (!Page.IsPostBack)
			{
				this.UserNickName.Text = this.user.TrueName;
				this.Sex.SelectedValue = this.user.Sex.Trim();
				if (this.user.Birthday.Length ==10)
				{
					this.Birthday.Text = this.user.Birthday.Substring(0,4);
					this.Month.SelectedValue = this.user.Birthday.Substring(5,2);
					this.Day.SelectedValue = this.user.Birthday.Substring(8,2);
				}
				this.MobilePhone.Text = this.user.MobilePhone.Trim();
				this.Phone.Text = this.user.Phone.Trim();
				this.Email.Text = this.user.Email.Trim();
				this.PostCode.Text = this.user.PostCode.Trim();
				this.Address.Text = this.user.Address;
				this.BZ.Value = this.user.BZ;
			}
		}
		#endregion

		#region 页面数据收集
		protected void PagePageCollectData()
		{
			this.user.TrueName = this.UserNickName.Text;
			this.user.Sex = this.Sex.SelectedValue;
			if (this.Birthday.Text != "")
			{
				this.user.Birthday = this.Birthday.Text +"-"+ this.Month.SelectedValue +"-"+ this.Day.SelectedValue;
			}
			this.user.MobilePhone = this.MobilePhone.Text;
			this.user.Phone = this.Phone.Text;
			this.user.Email = this.Email.Text;
			this.user.PostCode = this.PostCode.Text;
			this.user.Address = this.Address.Text;
			this.user.BZ = this.BZ.Value;
		}
		#endregion
		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		设计器支持所需的方法 - 不要使用代码编辑器
		///		修改此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.UserInfo_Submit.Click += new System.EventHandler(this.UserInfo_Submit_Click);
			this.BZ.ServerChange += new System.EventHandler(this.BZ_ServerChange);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void BZ_ServerChange(object sender, System.EventArgs e)
		{
		
		}
		protected void GetWebNavigate()
		{
			this.Response.Write(base.InitWebNavigate(this.parms));
		}

		private void UserInfo_Submit_Click(object sender, System.EventArgs e)
		{
			this.PagePageCollectData();
			try
			{
				BLL.SysUser.Update(this.user);
				base.WirteSysLog(parms.UserControl,"基本信息修改","1",null);
				this.Msg.Text="恭喜您,基本信息修改成功!";
			}
			catch
			{
				base.WirteSysLog(parms.UserControl,"基本信息修改","0",null);
				this.Msg.Text = "对不起,基本信息修改失败!";
			}
		}
	}
}

⌨️ 快捷键说明

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