public void ShowFamily(XDocument x) { xdoc = x; hasprinter = PrintRawHelper.HasPrinter(Program.Printer); this.Focus(); Program.FamilyId = x.Root.Attribute("familyid").Value.ToInt(); list = new List <PersonInfo>(); if (x.Descendants("member").Count() == 0) { ClearControls(); var lab = new Label(); lab.Font = pfont; lab.Location = new Point(15, 200); lab.AutoSize = true; pgup.Visible = false; pgdn.Visible = false; lab.Text = "Not Found, try another phone number, or 411?"; this.Controls.Add(lab); Return.Text = "Try Again"; controls.Add(lab); return; } else { Return.Text = "Return"; } foreach (var e in x.Descendants("member")) { var a = new PersonInfo { pid = e.Attribute("id").Value.ToInt(), first = e.Attribute("first").Value, last = e.Attribute("last").Value, dob = e.Attribute("dob").Value, goesby = e.Attribute("goesby").Value, email = e.Attribute("email").Value, addr = e.Attribute("addr").Value, zip = e.Attribute("zip").Value, home = e.Attribute("home").Value.FmtFone(), cell = e.Attribute("cell").Value.FmtFone(), gender = e.Attribute("gender").Value.ToInt(), marital = e.Attribute("marital").Value.ToInt(), Row = list.Count, HasPicture = bool.Parse(e.Attribute("haspicture").Value), MemberStatus = e.Attribute("memberstatus").Value, access = e.Attribute("access").Value, notes = e.Value, visitcount = e.Attribute("visitcount").Value.ToInt(), }; list.Add(a); } ShowPage(1); }
public void ShowFamily(XDocument x) { xdoc = x; hasprinter = PrintRawHelper.HasPrinter(Program.Printer); this.Focus(); Program.FamilyId = x.Root.Attribute("familyid").Value.ToInt(); if (!Program.SecurityCode.HasValue()) { Program.SecurityCode = x.Root.Attribute("securitycode").Value; } label3.Text = Program.SecurityCode; Program.MaxLabels = x.Root.Attribute("maxlabels").Value.ToInt(); list = new List <AttendLabel>(); if (x.Descendants("attendee").Count() == 0) { ClearControls(); var lab = new Label(); lab.Font = pfont; lab.Location = new Point(15, 200); lab.AutoSize = true; PrintAll.Visible = false; PrintAll1.Visible = false; PrintAll2.Visible = false; pgup.Visible = false; pgdn.Visible = false; lab.Text = "Not Found, try another phone number?"; this.Controls.Add(lab); Return.Text = "Try again"; controls.Add(lab); return; } foreach (var e in x.Descendants("attendee")) { var a = new AttendLabel { cinfo = new ClassInfo { oid = e.Attribute("orgid").Value.ToInt(), pid = e.Attribute("id").Value.ToInt(), mv = e.Attribute("mv").Value, }, name = e.Attribute("name").Value, first = e.Attribute("first").Value, last = e.Attribute("last").Value, dob = e.Attribute("dob").Value, church = e.Attribute("church").Value, preferredname = e.Attribute("preferredname").Value, goesby = e.Attribute("goesby").Value, email = e.Attribute("email").Value, addr = e.Attribute("addr").Value, zip = e.Attribute("zip").Value, home = e.Attribute("home").Value.FmtFone(), cell = e.Attribute("cell").Value.FmtFone(), gender = e.Attribute("gender").Value.ToInt(), marital = e.Attribute("marital").Value.ToInt(), emphone = e.Attribute("emphone").Value.FmtFone(), emfriend = e.Attribute("emfriend").Value, allergies = e.Attribute("allergies").Value, grade = e.Attribute("grade").Value, activeother = e.Attribute("activeother").Value, parent = e.Attribute("parent").Value, org = e.Attribute("org").Value, orgname = e.Attribute("orgname").Value, custody = bool.Parse(e.Attribute("custody").Value), transport = bool.Parse(e.Attribute("transport").Value), location = e.Attribute("loc").Value, leader = e.Attribute("leader").Value, NumLabels = int.Parse(e.Attribute("numlabels").Value), Row = list.Count, CheckedIn = bool.Parse(e.Attribute("checkedin").Value), HasPicture = bool.Parse(e.Attribute("haspicture").Value), RequiresSecurityLabel = bool.Parse(e.Attribute("requiressecuritylabel").Value), leadtime = double.Parse(e.Attribute("leadtime").Value), }; DateTime dt; if (DateTime.TryParse(e.Attribute("hour").Value, out dt)) { a.cinfo.hour = dt; } list.Add(a); } ShowPage(1); }