Exemplo n.º 1
0
        private void MainFormShown(object sender, System.EventArgs e)
        {
            Boolean isFirstRun = Boolean.Parse(ConfigurationManager.AppSettings.Get("FirstRun"));

            if (isFirstRun)
            {
                var selectClinic = new ClinicSelection();
                selectClinic.ShowDialog(this);
            }

            var login = new Login();

            login.ShowDialog(this);

            if (AppContext.Authenticated)
            {
                this.txtLoggedIn.Text  = String.Format("{0}:{1}", AppContext.LoggedInUser.RoleName, AppContext.LoggedInUser.UserName);
                this.txtClinic.Text    = String.Format("Phòng khám: {0}", AppContext.CurrentClinic.Name);
                this.mnuLogout.Enabled = true;
                this.mnuLogin.Enabled  = false;
            }
            else
            {
                this.mnuLogout.Enabled = false;
                this.mnuLogin.Enabled  = true;
            }
            this.CommonInitilize();
        }
Exemplo n.º 2
0
        private void MainFormShown(object sender, System.EventArgs e)
        {
            Boolean isFirstRun = Boolean.Parse(ConfigurationManager.AppSettings.Get("FirstRun"));
            if (isFirstRun)
            {
                var selectClinic = new ClinicSelection();
                selectClinic.ShowDialog(this);
            }

            var login = new Login();
            login.ShowDialog(this);

            if (AppContext.Authenticated)
            {
                this.txtLoggedIn.Text = String.Format("{0}:{1}", AppContext.LoggedInUser.RoleName, AppContext.LoggedInUser.UserName);
                this.txtClinic.Text = String.Format("Phòng khám: {0}", AppContext.CurrentClinic.Name);
                this.mnuLogout.Enabled = true;
                this.mnuLogin.Enabled = false;
            }
            else
            {
                this.mnuLogout.Enabled = false;
                this.mnuLogin.Enabled = true;
            }
            this.CommonInitilize();
        }