private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { PleaseWaitForm.Hide(); PleaseWaitForm.Dispose(); PleaseWaitForm = null; buttongo.Enabled = true; var x = e.Result as XDocument; if (x.Document.Root.Name == "Families") { this.Swap(families); families.ShowFamilies(x); } else { var locked = bool.Parse(x.Document.Root.Attribute("waslocked").Value); if (locked) MessageBox.Show("Family is already being viewed"); else { this.Swap(family); family.ShowFamily(x); } } }
private void Go() { if (textBox1.Text == "010") { Application.Exit(); return; } if (textBox1.Text == "411") { if (Program.CheckAdminPIN()) this.Swap(namesearch); } else if (textBox1.Text.StartsWith("0") && textBox1.Text.Length > 1) Print.MemberList(textBox1.Text.Substring(1)); else { PleaseWaitForm = new PleaseWait(); PleaseWaitForm.Show(); buttongo.Enabled = false; var bw = new BackgroundWorker(); bw.DoWork += backgroundWorker1_DoWork; bw.RunWorkerCompleted += backgroundWorker1_RunWorkerCompleted; bw.RunWorkerAsync(textBox1.Text); } textBox1.Text = string.Empty; }
private void Return_Click(object sender, EventArgs e) { Program.TimerStop(); if (Return.Text.Contains("Try Again")) { this.GoHome(string.Empty); return; } PleaseWaitForm = new PleaseWait(); PleaseWaitForm.Show(); var bw = new BackgroundWorker(); bw.DoWork += DoPrinting; bw.RunWorkerCompleted += PrintingCompleted; bw.RunWorkerAsync(); }
private void PrintingCompleted(object sender, RunWorkerCompletedEventArgs e) { PleaseWaitForm.Hide(); PleaseWaitForm.Dispose(); PleaseWaitForm = null; Program.FamilyId = 0; classlist = new List<ClassInfo>(); PrintAll.Text = string.Empty; if (Program.AskLabels) { var f = new DidItWork(); var ret = f.ShowDialog(); f.Hide(); f.Dispose(); if (ret == DialogResult.No) { Util.ReportPrinterProblem(); var fa = new AdminLogin(); fa.ShowDialog(); } } this.GoHome(string.Empty); }
private void PrintingCompleted(object sender, RunWorkerCompletedEventArgs e) { PleaseWaitForm.Hide(); PleaseWaitForm.Dispose(); PleaseWaitForm = null; Program.FamilyId = 0; classlist = new List<ClassInfo>(); this.GoHome(string.Empty); }
private void Return_Click(object sender, EventArgs e) { Program.TimerStop(); if (Return.Text.Contains("Try Again")) { this.GoHome(string.Empty); return; } if (Program.addguests == null && list.Where(i => i.ischecked && i.access == "true").Any()) { Program.addguests = new BuildingAddGuests(); Program.addguests.StartPosition = FormStartPosition.Manual; Program.addguests.Location = new Point(Program.baseform.Location.X + 100, Program.baseform.Location.Y + 100); var i = 1; foreach (var p in list.Where(pp => pp.ischecked && pp.access == "true")) { var rb = Program.addguests.Controls.Find("rb" + i, true)[0] as RadioButton; rb.Text = p.name; rb.Visible = true; rb.Tag = p; if (i == 1) rb.Checked = true; i++; } } if (Program.addguests != null) { var ret = Program.addguests.ShowDialog(); if (ret == DialogResult.No) { Program.addguests.Dispose(); Program.addguests = null; } } PleaseWaitForm = new PleaseWait(); PleaseWaitForm.Show(); var bw = new BackgroundWorker(); bw.DoWork += DoPrinting; bw.RunWorkerCompleted += PrintingCompleted; bw.RunWorkerAsync(); }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { PleaseWaitForm.Hide(); PleaseWaitForm.Dispose(); PleaseWaitForm = null; buttongo.Enabled = true; var x = e.Result as XDocument; if (x.Document.Root.Name == "Families") { this.Swap(families); families.ShowFamilies(x); } else { this.Swap(family); family.ShowFamily(x); } }