private void btnLogin_Click(object sender, EventArgs e) { if ((txtPassword.Text == cmbUser.SelectedValue.ToString())) { appUser au = (appUser)cmbUser.SelectedItem; MessageBox.Show("Bienvenido!", "HUGO DELIVERY", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); frmPrincipal window = new frmPrincipal(au); window.Show(); this.Hide(); } else { MessageBox.Show("Error!, Contraseña incorrecta", "HUGO DELIVERY", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); } }
public static List <appUser> getLista() { string query = "SELECT * FROM APPUSER"; DataTable dt = ConectionDB.ExecuteQuery(query); List <appUser> list = new List <appUser>(); foreach (DataRow row in dt.Rows) { appUser au = new appUser(); au.idUser = Convert.ToInt32(row[0].ToString()); au.fullName = row[1].ToString(); au.userName = row[2].ToString(); au.password = row[3].ToString(); au.userType = Convert.ToBoolean(row[4].ToString()); list.Add(au); } return(list); }
public frmPrincipal(appUser pUser) { InitializeComponent(); user = pUser; }