C#.NET通用权限管理系统组件中用少数几行代码实现记录页面状态

  申请用户帐户的界面如下,若想记录用户选中的默认参数,如下图:

吉日嘎拉,通用权限管理系统组件

   需要能记录红色选中部分的选项内容,希望每次进入次页面的时候,能记住用户的当前选中状态。

吉日嘎拉,通用权限管理系统组件 

 下面粘贴通用权限管理系统中的源码,有兴趣的朋友可以阅读理解,记录用户选中状态的代码实现部分

 

         #region public override void FormOnLoad() 加载窗体
         ///   <summary>
        
///  加载窗体
        
///   </summary>
         public  override  void FormOnLoad()
        {
             //  绑定下拉筐数据
             this.BindItemDetails();
             if (! string.IsNullOrEmpty( this.UserInfo.CompanyId))
            {
                 this.ucCompany.SelectedId =  this.UserInfo.CompanyId;
            }
             string isStaff = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" IsStaff ");
             if (! string.IsNullOrEmpty(isStaff))
            {
                 this.chkIsStaff.Checked =  true.ToString().Equals(isStaff);
            }
             string close = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Close ");
             if (! string.IsNullOrEmpty(close))
            {
                 this.chkClose.Checked =  true.ToString().Equals(close);
            }
             string password = DotNetService.Instance.ParameterService.GetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Password ");
             if (! string.IsNullOrEmpty(password))
            {
                 if (password.Equals( this.rbtnUserInput.Name))
                {
                     this.rbtnUserInput.Checked =  true;
                }
                 else  if (password.Equals( this.rbtnDefaultPassword.Name))
                {
                     this.rbtnDefaultPassword.Checked =  true;
                }
                 else  if (password.Equals( this.rbtnUserNamePassword.Name))
                {
                     this.rbtnUserNamePassword.Checked =  true;
                }
            }
        }
         #endregion

 

         private  void rbtnUserInput_CheckedChanged( object sender, EventArgs e)
        {
             if ( this.rbtnUserInput.Checked)
            {
                 this.txtPassword.TabStop =  true;
                 this.txtConfirmPassword.TabStop =  true;
                 this.txtPassword.Text =  string.Empty;
                 this.txtConfirmPassword.Text =  string.Empty;
                DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Password "this.rbtnUserInput.Name);
            }
        }

         private  void rbtnDefaultPassword_CheckedChanged( object sender, EventArgs e)
        {
             if ( this.rbtnDefaultPassword.Checked)
            {
                 this.txtPassword.Text = BaseSystemInfo.DefaultPassword;
                 this.txtConfirmPassword.Text = BaseSystemInfo.DefaultPassword;
                 if (! string.IsNullOrEmpty( this.txtPassword.Text))
                {
                     this.txtPassword.TabStop =  false;
                     this.txtConfirmPassword.TabStop =  false;
                }
                DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Password "this.rbtnDefaultPassword.Name);
            }
        }

         private  void rbtnUserNamePassword_CheckedChanged( object sender, EventArgs e)
        {
             if ( this.rbtnUserNamePassword.Checked)
            {
                 this.txtPassword.Text =  this.txtUserName.Text;
                 this.txtConfirmPassword.Text =  this.txtUserName.Text;
                 if ( string.IsNullOrEmpty( this.txtPassword.Text))
                {
                     this.txtPassword.TabStop =  true;
                     this.txtConfirmPassword.TabStop =  true;
                }
                 else
                {
                     this.txtPassword.TabStop =  false;
                     this.txtConfirmPassword.TabStop =  false;
                }
                DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Password "this.rbtnUserNamePassword.Name);
            }
        }

 

         private  void chkIsStaff_CheckedChanged( object sender, EventArgs e)
        {
             if ( this.FormLoaded)
            {
                DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" IsStaff "this.chkIsStaff.Checked.ToString());
            }
        }

         private  void chkClose_CheckedChanged( object sender, EventArgs e)
        {
             if ( this.FormLoaded)
            {
                DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo,  " User "" RequestAnAccount "" Close "this.chkClose.Checked.ToString());
            }
        }

 

转载于:https://my.oschina.net/iwenr/blog/227941

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值