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

📄 sysconfig.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;

	/// <summary>
	///		SysConfig 的摘要说明。
	/// </summary>
	public class SysConfig : CRM.Web.Utility.UserControlBase
	{
		protected System.Web.UI.WebControls.Button Back;
		protected System.Web.UI.WebControls.Label Msg;
		protected System.Web.UI.WebControls.TextBox SystemName;
		protected System.Web.UI.WebControls.TextBox Version;
		protected System.Web.UI.WebControls.TextBox Textbox1;
		protected System.Web.UI.WebControls.TextBox Phone;
		protected System.Web.UI.WebControls.TextBox Email;
		protected System.Web.UI.WebControls.TextBox Address;
		protected System.Web.UI.WebControls.TextBox PayPeriod;
		protected System.Web.UI.WebControls.TextBox Credit;
		protected System.Web.UI.HtmlControls.HtmlInputButton submit1;
		protected System.Web.UI.HtmlControls.HtmlInputButton reset1;
		protected CRM.Model.Parameter parms;
		protected System.Web.UI.WebControls.TextBox CopyRight;
		protected CRM.Model.SysConfigInfo config = new CRM.Model.SysConfigInfo();
		private void Page_Load(object sender, System.EventArgs e)
		{
			this.parms = base.GetRequestParm();
			this.PageDateBind(null);
		}
		protected void GetWebNavigate()
		{
			this.Response.Write(base.InitWebNavigate(this.parms));
		}

		#region 页面控件数据绑定
		protected void PageDateBind(string option)
		{
			this.config = BLL.SysConfig.GetSysConfig();
			if (!Page.IsPostBack)
			{
				this.SystemName.Text = this.config.SystemName.Trim();
				this.Version.Text = this.config.Version.Trim();
				this.CopyRight.Text = this.config.CopyRight.Trim();
				this.Phone.Text = this.config.Tel.Trim();
				this.Email.Text = this.config.Email.Trim();
				this.Address.Text = this.config.Address.Trim();
				this.PayPeriod.Text = this.config.PayPeriod.Trim();
				this.Credit.Text = this.config.Credit.Trim();
			}
		}
		#endregion

		#region 页面数据收集
		protected void PagePageCollectData()
		{
			this.config.SystemName=this.SystemName.Text.Trim();
			this.config.Version=this.Version.Text.Trim();
			this.config.CopyRight=this.CopyRight.Text.Trim();
			this.config.Tel=this.Phone.Text.Trim();
			this.config.Email=this.Email.Text.Trim();
			this.config.Address=this.Address.Text.Trim();
			this.config.PayPeriod=this.PayPeriod.Text.Trim();
			this.config.Credit=this.Credit.Text.Trim();
		}
		#endregion

		#region 输入数据验证
		protected bool PageInputCheck()
		{
			if (Page.IsValid == true)
			{return true;}
			else
			{return false;}
		}
		#endregion

		#region 页面控件可编辑性设置
		protected void PageControlsVisible(bool visible)
		{
			if (visible == false)
			{
				this.submit1.Disabled = true;
				this.reset1.Disabled = true;
			}

		}
		#endregion

		#region 页面提示信息设置
		protected void PageMsgDisplay(string msg)
		{
			this.Msg.Text = msg;
		}
		#endregion

		
		#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

		private void submit1_ServerClick(object sender, System.EventArgs e)
		{
			try
			{
				this.PagePageCollectData();
				BLL.SysConfig.Update(this.config);
				base.WirteSysLog(this.parms.UserControl,"修改系统配置信息","1","修改系统配置信息");
				this.Msg.Text =base.UpdateSucceed;
			}
			catch
			{
				base.WirteSysLog(this.parms.UserControl,"修改系统配置信息","0","修改系统配置信息");
				this.Msg.Text=base.UpdateFailed;
			}
		}
	}
}

⌨️ 快捷键说明

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