private void bunifuImageButtonAPPLYlogin_Click(object sender, EventArgs e) { buttonAnimate.ColorAnimate(ImageButtonAPPLYlogin, Color.MediumSeaGreen, XanderUI.XUIObjectAnimator.ColorAnimation.FillEllipse, true, 1); using (_sqlCon = new SQLiteConnection($"Data Source={Directory.GetCurrentDirectory()}\\DataBases\\TRPO.db")) { string email = textboxEMAILlogin.text, password = textboxPASSlogin.text; _sqlCon.Open(); using (_sqlCmd = new SQLiteCommand($"SELECT id FROM LOGin WHERE email='{email}' and password='******'", _sqlCon)) { SQLiteDataReader reader = _sqlCmd.ExecuteReader(); reader.Read(); if (reader.HasRows) { reader.Close(); MetroMessageBox.Show(this, "WELL DONE! LOGGED IN", "SUCCESS!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (CheckFoRadmin(email)) { formADMIN mainForm = new formADMIN(GetUserID(email)); mainForm.Show(); } else { formUSER mainForm = new formUSER(GetUserID(email)); mainForm.Show(); } this.Hide(); } else { MetroMessageBox.Show(this, "LOGIN or PASSWORD is incorrect", "UNSUCCESS!", MessageBoxButtons.OK, MessageBoxIcon.Error); textboxPASSlogin.text = string.Empty; } } } }
public formProfile(formUSER formF, int ID) { InitializeComponent(); SetScaling(); mainForm = formF; userID = ID; ReadThemeAsync(); isADMIN = false; bunifuMaterialTextboxEMAIL.Text = takeAlogin(); bunifuMaterialTextboxPASS.Text = takeApassword(); pictureBoxPROFILE.Image = takeANimg(); }