Ejemplo n.º 1
0
        /// <summary>
        /// login form load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoginForm_Load(object sender, EventArgs e)
        {
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                Version deploy = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion;

                StringBuilder version = new StringBuilder();
                version.Append("VERSION : ");
                version.Append(applicationName + "_");
                version.Append(deploy.Major);
                version.Append("_");
                version.Append(deploy.Minor);
                version.Append("_");
                version.Append(deploy.Build);
                version.Append("_");
                version.Append(deploy.Revision);

                Version_lbl.Text = version.ToString();
            }


            LoginName_txt.Select();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// check for the user authentificate
        /// </summary>
        /// <returns></returns>
        private bool IsAuthentificated()
        {
            if (!isPwdCheckNeeded)
            {
                return(true);
            }

            string authentificateFlag = ConfigurationDataTypeEnum.AUTHENTIFICATE_FLAG.GetValue();


            AuthentificateStrategyDataTypeEnum authentificateTypeEnum =
                AuthentificateStrategyDataTypeEnum.GetAuthentificateStrategyDataTypeEnum(authentificateFlag);

            if (authentificateTypeEnum == null)
            {
                messageData = new MessageData("llce00008", Properties.Resources.llce00008.ToString(), authentificateFlag);
                Logger.Info(messageData);
                popUpMessage.Information(messageData, Text);
                return(false);
            }


            UserAuthentificateStrategy userAuthentificateStrategy = authentificateTypeEnum.CreateAuthentificateStrategy();



            if (!userAuthentificateStrategy.Authentificate(LoginName_txt.Text, Password_txt.Text))
            {
                messageData = new MessageData("llce00004", Properties.Resources.llce00004.ToString(), null);
                Logger.Info(messageData);
                popUpMessage.Information(messageData, Text);

                LoginName_txt.Focus();
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Checks mandatory fields
        /// </summary>
        /// <returns></returns>
        private bool CheckMandatory()
        {
            if (LoginName_txt.Text == string.Empty)
            {
                messageData = new MessageData("llce00002", Properties.Resources.llce00002.ToString());
                Logger.Info(messageData);
                popUpMessage.ApplicationError(messageData, this.Text);

                LoginName_txt.Focus();

                return(false);
            }
            if (Password_txt.Text == string.Empty)
            {
                messageData = new MessageData("llce00003", Properties.Resources.llce00003.ToString());
                Logger.Info(messageData);
                popUpMessage.ApplicationError(messageData, this.Text);

                Password_txt.Focus();

                return(false);
            }
            return(true);
        }