private void buy(Person person, Product product) { String response = ""; response = Connect("buy:" + person.id + "=" + product.id); if (response == "debt") { errorTone.Play(); LogInForm logIn = new LogInForm(adminArray); if (logIn.ShowDialog() == DialogResult.OK) { Admin admin = logIn.getSelectedAdmin(); if (admin.pin.Equals(logIn.getPIN())) { //Succes response = Connect("forcebuy:" + person.id + "=" + product.id); statusReport.Text = person.name + " kocht " + product.name; succesTone.Play(); } else { statusReport.Text = "Log In Faaaaal"; errorTone.Play(); } } } else if (response == "succes") { statusReport.Text = person.name + " kocht " + product.name; succesTone.Play(); } }
internal static CookieContainer Login(ushort sid) { CookieContainer cc = null; if (!string.IsNullOrWhiteSpace(Settings.Default.Cookies)) { cc = (CookieContainer)HuntsHubConnection.ByteArrayToObject(Convert.FromBase64String(Settings.Default.Cookies)); } while (!HuntsHubConnection.TestCC(cc)) { Application.Current.Dispatcher.Invoke(delegate() { LogInForm lif = new LogInForm(sid); if (lif.ShowDialog().Value&& lif.receivedCookies.Count > 0) { cc = lif.receivedCookies; } if (lif.receivedCookies.Count == 0) { Environment.Exit(0); } }); } return(cc); }
private void Form1_Load(object sender, EventArgs e) { LogInForm login = new LogInForm(); login.ShowDialog(); LbUserId.Text = $"LOGIN : {Commons.USERID}"; }
private void lblOut_Click(object sender, EventArgs e) { this.Hide(); var ds = new LogInForm(); ds.FormClosed += (s, args) => this.Close(); ds.ShowDialog(); }
private void btn_More_Click(object sender, EventArgs e) { int n = 0; try { String ApplyUserPriority = CompactDB.FetchValue(App.ApplyUserPriority); n = int.Parse(ApplyUserPriority); } catch { Tipper.Error = "检测到你可能启用了权限管理,但是可能配置不正确!"; } if (n > 0) { LogInForm logIn = new LogInForm(); logIn.ShowDialog(); if (!logIn.bCloseWindow) { return; } } foreach (Form item in Application.OpenForms) { if (item is MenuForm) { if (item.Owner != this) { return; } if (item.WindowState == FormWindowState.Minimized) { item.WindowState = FormWindowState.Normal; } item.BringToFront(); return; } } Form frm = AppManager.ShowFixedPage(typeof(MenuForm)); frm.Owner = this; }
private void btn_More_Click(object sender, EventArgs e) { int num = 0; try { string s = base.CompactDB.FetchValue(App.ApplyUserPriority, true, "0"); num = int.Parse(s); } catch (Exception) { dotNetLab.Tipper.Error = "检测到你可能启用了权限管理,但是可能配置不正确!"; } if (num > 0) { LogInForm logInForm = new LogInForm(); logInForm.ShowDialog(); if (!logInForm.bCloseWindow) { return; } } foreach (Form openForm in Application.OpenForms) { if (openForm is MenuForm) { if (openForm.Owner == this) { if (openForm.WindowState == FormWindowState.Minimized) { openForm.WindowState = FormWindowState.Normal; } openForm.BringToFront(); } return; } } Form form2 = AppManager.ShowFixedPage(typeof(MenuForm)); form2.Owner = this; }
//if login is clicked then display login form private void btnLogin_Click(object sender, System.EventArgs e) { var logInForm = new LogInForm(this); logInForm.ShowDialog(); }