Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            IDname    = txtID.Text.Trim().ToString();
            Passworld = txtPass.Text.Trim().ToString();
            DBmain.Connect();
            if (DBmain.success)
            {
                string cnstr = "Server = " + Admin_Login.ServerIP + "; Database = " + Admin_Login.DataOfServer + "; User Id = " + Admin_Login.IDname + "; Password = "******";";
                Settings.Default.ConnectionString = cnstr;
                Properties.Settings.Default.Save();

                MessageBox.Show("Succesfull!");

                if (!checkexitform("GiaodienAdmin"))
                {
                    GiaoDienAdmin frm = new GiaoDienAdmin();
                    frm.ShowDialog();
                }
                else
                {
                    activechirldform("GiaodienAdmin");
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Connected Faile!");
            }
        }