예제 #1
0
 private void ChkAuthenticatedType_CheckBoxClick(object sender, EventArgs e)
 {
     if (ChkAuthenticatedType.Checked)
     {
         TxtUserName.SetDisabled();
         TxtPassword.SetDisabled();
     }
     else
     {
         TxtUserName.SetEnabled();
         TxtPassword.SetEnabled();
     }
 }
예제 #2
0
        /// <summary>
        /// 将关联对象中的值,绑定至界面控件进行显示。
        /// </summary>
        private void BindObjectToForm()
        {
            TxtEquipmentNum.Text = dbConfigInfo.EquipmentNum;
            TxtServerIP.Text     = dbConfigInfo.ServerAddress;
            TxtDBName.Text       = dbConfigInfo.DBName;
            TxtUserName.Text     = dbConfigInfo.UserName;
            TxtPassword.Text     = dbConfigInfo.Password;
            SetStoredType(dbConfigInfo.StoredType, dbConfigInfo.PageSize, dbConfigInfo.MaxCapacity);
            SetServerState(dbConfigInfo.ServerState);

            if (dbConfigInfo.AuthenticatedType == (byte)AuthenticatedTypeEnum.Windows)
            {
                ChkAuthenticatedType.Checked = true;
                TxtUserName.SetDisabled();
                TxtPassword.SetDisabled();
            }
            else
            {
                ChkAuthenticatedType.Checked = false;
                TxtUserName.SetEnabled();
                TxtPassword.SetEnabled();
            }
        }