public static Getdatabase getInstance() { if (dh == null) { dh = new Getdatabase(); } return(dh); }
private void btnGiris_MouseClick(object sender, MouseEventArgs e) { Getdatabase dh = Getdatabase.getInstance(); //Costumer logined = Costumer.getInstance(); Costumer customer = dh.GetCostumer(txtKadi.Text, txtSifre.Text); if (customer != null) { if (txtKadi.Text == customer.Username && txtSifre.Text == customer.Password) { MessageBox.Show("Girdi"); } } else { MessageBox.Show("Wrong Username or Password.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void updateScreen() { Costumer cs = Costumer.getInstance(); Console.WriteLine(cs.Name.ToString()); if (cs != null) { btnCard.Visible = true; btnLogout.Visible = true; btnMyprofile.Visible = true; btnPrev.Visible = true; bool flag = false; Getdatabase db = new Getdatabase(); db.IsAdmin(cs, ref flag); if (flag) { btnAdmin.Visible = true; } } }