Exemplo n.º 1
0
        public void ShowFamily(XDocument x)
        {
            xdoc = x;
            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();
                a.cinfo = new ClassInfo
                {
                    oid = e.Attribute("orgid").Value.ToInt(),
                    pid = e.Attribute("id").Value.ToInt(),
                    mv  = e.Attribute("mv").Value,
                };
                a.name   = e.Attribute("name").Value;
                a.first  = e.Attribute("first").Value;
                a.last   = e.Attribute("last").Value;
                a.dob    = e.Attribute("dob").Value;
                a.church = e.Attribute("church").Value;

                a.preferredname = e.Attribute("preferredname").Value;
                a.goesby        = e.Attribute("goesby").Value;
                a.email         = e.Attribute("email").Value;
                a.addr          = e.Attribute("addr").Value;
                a.zip           = e.Attribute("zip").Value;
                a.home          = e.Attribute("home").Value.FmtFone();
                a.cell          = e.Attribute("cell").Value.FmtFone();
                a.gender        = e.Attribute("gender").Value.ToInt();
                a.marital       = e.Attribute("marital").Value.ToInt();
                a.emphone       = e.Attribute("emphone").Value.FmtFone();
                a.emfriend      = e.Attribute("emfriend").Value;
                a.allergies     = e.Attribute("allergies").Value;
                a.grade         = e.Attribute("grade").Value;
                a.activeother   = e.Attribute("activeother").Value;
                a.parent        = e.Attribute("parent").Value;

                if (e.Attribute("parents") != null)
                {
                    a.parents = e.Attribute("parents").Value;
                }

                a.org                   = e.Attribute("org").Value;
                a.orgname               = e.Attribute("orgname").Value;
                a.custody               = bool.Parse(e.Attribute("custody").Value);
                a.transport             = bool.Parse(e.Attribute("transport").Value);
                a.location              = e.Attribute("loc").Value;
                a.leader                = e.Attribute("leader").Value;
                a.NumLabels             = int.Parse(e.Attribute("numlabels").Value);
                a.Row                   = list.Count;
                a.CheckedIn             = bool.Parse(e.Attribute("checkedin").Value);
                a.HasPicture            = bool.Parse(e.Attribute("haspicture").Value);
                a.RequiresSecurityLabel = bool.Parse(e.Attribute("requiressecuritylabel").Value);
                a.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);
        }
Exemplo n.º 2
0
        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();
                a.cinfo = new ClassInfo
                {
                    oid = e.Attribute("orgid").Value.ToInt(),
                    pid = e.Attribute("id").Value.ToInt(),
                    mv = e.Attribute("mv").Value,
                };
                a.name = e.Attribute("name").Value;
                a.first = e.Attribute("first").Value;
                a.last = e.Attribute("last").Value;
                a.dob = e.Attribute("dob").Value;
                a.church = e.Attribute("church").Value;

                a.preferredname = e.Attribute("preferredname").Value;
                a.goesby = e.Attribute("goesby").Value;
                a.email = e.Attribute("email").Value;
                a.addr = e.Attribute("addr").Value;
                a.zip = e.Attribute("zip").Value;
                a.home = e.Attribute("home").Value.FmtFone();
                a.cell = e.Attribute("cell").Value.FmtFone();
                a.gender = e.Attribute("gender").Value.ToInt();
                a.marital = e.Attribute("marital").Value.ToInt();
                a.emphone = e.Attribute("emphone").Value.FmtFone();
                a.emfriend = e.Attribute("emfriend").Value;
                a.allergies = e.Attribute("allergies").Value;
                a.grade = e.Attribute("grade").Value;
                a.activeother = e.Attribute("activeother").Value;
                a.parent = e.Attribute("parent").Value;

                a.org = e.Attribute("org").Value;
                a.orgname = e.Attribute("orgname").Value;
                a.custody = bool.Parse(e.Attribute("custody").Value);
                a.transport = bool.Parse(e.Attribute("transport").Value);
                a.location = e.Attribute("loc").Value;
                a.leader = e.Attribute("leader").Value;
                a.NumLabels = int.Parse(e.Attribute("numlabels").Value);
                a.Row = list.Count;
                a.CheckedIn = bool.Parse(e.Attribute("checkedin").Value);
                a.HasPicture = bool.Parse(e.Attribute("haspicture").Value);
                a.RequiresSecurityLabel = bool.Parse(e.Attribute("requiressecuritylabel").Value);
                a.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);
        }