Exemple #1
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            connection = db.getConnection();
            if (connection != null)
            {
                command = new MySqlCommand("select * from user_reg where userid='" + textBox1.Text + "'and password='******'", connection);
                dr = command.ExecuteReader();
                if (dr.HasRows)
                {
                    dr.Read();
                    role = dr.GetString(3);
                    if (textBox1.Text == dr.GetString(0) && textBox2.Text == dr.GetString(2))
                    {
                        user = textBox1.Text;
                        home h = new home();
                        h.Show();
                        this.Hide();

                    }
                    else
                    {
                        textBox1.Text = "";
                        textBox2.Text = "";
                        MessageBox.Show("Invalid user name or password");
                    }
                }
                else
                {
                    textBox1.Text = "";
                    textBox2.Text = "";
                    MessageBox.Show("Invalid user name or password");
                }
            }
        }
    private void main_Load(object sender, EventArgs e)
    {
        Form home = new home();

        home.MdiParent   = this;
        home.WindowState = FormWindowState.Maximized;
        home.Show();
    }
Exemple #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            home newMDIChild = new home();

            // Set the Parent Form of the Child window.
            newMDIChild.MdiParent = this;
            // Display the new form.
            newMDIChild.Show();
            newMDIChild.Dock = DockStyle.Fill;
        }
Exemple #4
0
 private void login_Click(object sender, EventArgs e)
 {
     using (perpustakaanEntities db = new perpustakaanEntities())
     {
         var passx  = hashPass(pass.Text);
         var result = db.logins.Where(i => i.username == "admin" & i.password == passx).ToList();
         if (result.Count > 0)
         {
             home _home = new home();
             _home.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Password Salah!");
         }
     }
 }
 private void transition_Tick(object sender, EventArgs e)
 {
     for (double i = 0.1; i <= 1.0; i++)
     {
         this.Opacity += 0.015;
         t++;
         if (t == 5)
         {
             label1.Text = "Loading Dollars....";
         }
         if (t == 10)
         {
             label1.Text = "Loading Renminbi....";
             label2.Text = "Loading Dollars....";
         }
         if (t == 15)
         {
             label1.Text = "Loading Rupees....";
             label2.Text = "Loading Renminbi....";
         }
         if (t == 20)
         {
             label1.Text = "Loading Ruble....";
             label2.Text = "Loading Rupees....";
         }
         if (t == 25)
         {
             label1.Text = "Loading Dirham....";
             label2.Text = "Loading Ruble....";
         }
         if (t == 30)
         {
             label1.Text = "Loading pointlessflashscreen.exe....";
             label2.Text = "Loading Dirham....";
         }
         if (t == 35)
         {
             label1.Text = "Loading Nothing....";
             label2.Text = "Loading pointlessflashscreen.exe....";
         }
         if (t == 40)
         {
             label1.Text = "Loading Smuggling....";
             label2.Text = "Loading Nothing....";
         }
         if (t == 45)
         {
             label1.Text = "Loading Clover Smuggle Base....";
             label2.Text = "Loading Smuggling....";
         }
         if (t == 50)
         {
             label1.Text = "Loading Complete!";
             label2.Text = "Loading Clover Smuggle Base....";
         }
     }
     if (this.Opacity == 1.0)
     {
         transition.Stop();
         home open = new home();
         open.Show();
     }
 }