溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)

發(fā)布時間:2020-08-08 23:05:23 來源:網(wǎng)絡(luò) 閱讀:329 作者:jirigala 欄目:編程語言

申請用戶帳戶的界面如下,若想記錄用戶選中的默認(rèn)參數(shù),如下圖:

C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)

  需要能記錄紅色選中部分的選項內(nèi)容,希望每次進(jìn)入次頁面的時候,能記住用戶的當(dāng)前選中狀態(tài)。

C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)

下面粘貼通用權(quán)限管理系統(tǒng)中的源碼,有興趣的朋友可以閱讀理解,記錄用戶選中狀態(tài)的代碼實(shí)現(xiàn)部分


C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)
#region public override void FormOnLoad() 加載窗體
///<summary>
/// 加載窗體
///</summary>
publicoverridevoid FormOnLoad()
        {
// 綁定下拉筐數(shù)據(jù)
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;
                }
elseif (password.Equals(this.rbtnDefaultPassword.Name))
                {
this.rbtnDefaultPassword.Checked = true;
                }
elseif (password.Equals(this.rbtnUserNamePassword.Name))
                {
this.rbtnUserNamePassword.Checked = true;
                }
            }
        }
#endregion
C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)


C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)
privatevoid 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);
           }
       }

privatevoid 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);
           }
       }

privatevoid 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);
           }
       }
C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)


C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)
privatevoid chkIsStaff_CheckedChanged(object sender, EventArgs e)
       {
if (this.FormLoaded)
           {
               DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "IsStaff", this.chkIsStaff.Checked.ToString());
           }
       }

privatevoid chkClose_CheckedChanged(object sender, EventArgs e)
       {
if (this.FormLoaded)
           {
               DotNetService.Instance.ParameterService.SetParameter(BaseSystemInfo.UserInfo, "User", "RequestAnAccount", "Close", this.chkClose.Checked.ToString());
           }
       }
C#.NET通用權(quán)限管理系統(tǒng)組件中用少數(shù)幾行代碼實(shí)現(xiàn)記錄頁面狀態(tài)



向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI