private bool loginSuccessfullDB(string username, string pw) { DetiServices ds = new DetiServices(); VedouciServices vs = new VedouciServices(); Tuple <int, string, string> l; l = ds.LoginAs(username, pw); if (l != null) { this.username = l.Item2; int id = l.Item1; MainForm mf = new MainForm(this, id); mf.Activate(); mf.Show(); mf.labelSigned.Text = "Signed as: " + ds.LoginAs(username, pw).Item2; mf.labelRole.Text = "Role: " + ds.LoginAs(username, pw).Item3; return(true); } l = vs.LoginAs(username, pw); if (l != null) { int id = l.Item1; MainForm mf = new MainForm(this, id); mf.Activate(); mf.Show(); mf.labelSigned.Text = "Signed as: " + username; mf.labelRole.Text = "Role: Admin"; return(true); } return(false); }
public InfoOVed() { vs = new VedouciServices(); this.all = vs.GetAll(); InitializeComponent(); for (int i = 0; i < all.Count(); i++) { comboBoxVed.Items.Add(all[i].Jmeno); } }
public NewEvent(MainForm mainForm) { InitializeComponent(); ac = new AkceServices(); vs = new VedouciServices(); mf = mainForm; this.allResp = vs.GetAll(); this.allHodn = ac.GetHodnosti(); comboBoxRankRestriction.Items.Clear(); comboBoxResponsible.Items.Clear(); for (int i = 0; i < allResp.Count(); i++) { comboBoxResponsible.Items.Add(allResp[i].Jmeno); } for (int i = 0; i < allHodn.Count(); i++) { comboBoxRankRestriction.Items.Add(allHodn[i].Nazev); } }