예제 #1
0
        private void bunifuImageButtonADMINPANEL_Click(object sender, EventArgs e)
        {
            AdminPanelForm adminPanel = new AdminPanelForm(userID);

            adminPanel.ShowDialog(this);
            GetInfoIntoComboBoxes();
        }
예제 #2
0
        private void yöneticiPaneliToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AdminPanelForm panel = new AdminPanelForm(aktifKullanici);

            if (panel.ShowDialog() == DialogResult.OK)
            {
                aktifKullanici = panel.aktifKullanici;
            }
        }
예제 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     lockControls();
     try
     {
         using (var conn = new MySqlConnection(Config.ConnectionString))
         {
             using (var cmd = new MySqlCommand($"SELECT * from users where Username='******' and Password ='******' and Role='{(byte)getUserType()}'", conn))// idc much about sql injection here lol
             {
                 conn.Open();
                 var reader = cmd.ExecuteReader();
                 if (reader.Read())
                 {
                     var Type = getUserType();
                     if (Type == UserRoles.SystemAdmin)
                     {
                         var pAdmin = new AdminPanelForm();
                         this.Hide();
                         pAdmin.ShowDialog();
                     }
                     else if (Type == UserRoles.Doctor)
                     {
                         var pAdmin = new DoctorPanelForm();
                         this.Hide();
                         pAdmin.ShowDialog();
                     }
                     else if (Type == UserRoles.Accountant)
                     {
                         var pAdmin = new AccountantPanelForm();
                         this.Hide();
                         pAdmin.ShowDialog();
                     }
                     else
                     {
                         MessageBox.Show("Unknown user error!");
                     }
                 }
                 else
                 {
                     MessageBox.Show("Invalid login info!");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         unlockControls();
     }
 }
예제 #4
0
        private void AdminPanelButton_Click(object sender, EventArgs e)
        {
            this.Hide();

            string passwordFormName = "Redaktoriaus apsauga:";
            string expectedPassword = "******";
            var    adminPanelForm   = new AdminPanelForm();

            var passwordConfirmationForm = new PasswordConfirmationForm(passwordFormName, expectedPassword, adminPanelForm);

            passwordConfirmationForm.Closed += (s, args) => this.Close();

            passwordConfirmationForm.Show();
        }
예제 #5
0
        /// <summary>
        /// button event for login
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_login_Click(object sender, EventArgs e)
        {
            string email    = txt_email.Text;
            string password = txt_password.Text;

            if (!string.IsNullOrEmpty(email))
            {
                if (!string.IsNullOrEmpty(password))
                {
                    UserProfile uProfile = new UserProfile
                    {
                        Email    = email,
                        Password = password
                    };

                    ProfileController pControllor = new ProfileController();
                    Boolean           correct     = pControllor.ProfileAuthenticaion(uProfile);

                    if (correct)
                    {
                        string status = pControllor.GetStatus(uProfile);
                        int    userId = pControllor.GetUserId(uProfile);
                        if (status == "Admin")
                        {
                            this.Hide();
                            AdminPanelForm admin = new AdminPanelForm(email, status);
                            admin.ShowDialog();
                            this.Close();
                        }
                        else if (status == "Developer")
                        {
                            this.Hide();
                            BugTracking panel = new BugTracking(email, userId);
                            panel.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            this.Hide();
                            TesterPanel tp = new TesterPanel(email, userId, true);
                            tp.ShowDialog();
                            this.Close();
                        }
                    }
                    else
                    {
                        MessageBox.Show("please enter valid email or password..");
                        txt_email.Text    = "";
                        txt_password.Text = "";
                        txt_email.Focus();
                    }
                }

                else
                {
                    MessageBox.Show("please enter your password.");
                    txt_password.Focus();
                }
            }
            else
            {
                MessageBox.Show("please enter your email..");
                txt_email.Focus();
            }
        }