Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        void PrintLabel_Click(object sender, EventArgs e)
        {
            Program.TimerReset();
            var c  = list[(int)menu.Tag];
            var li = new LabelInfo
            {
                allergies             = c.allergies,
                pid                   = c.cinfo.pid,
                mv                    = c.cinfo.mv,
                n                     = c.NumLabels,
                first                 = c.first,
                last                  = c.last,
                location              = c.location,
                hour                  = c.cinfo.hour,
                org                   = c.org,
                custody               = c.custody,
                transport             = c.transport,
                requiressecuritylabel = c.RequiresSecurityLabel,
                securitycode          = Program.SecurityCode,
                parents               = c.parents
            };

            //			IEnumerable<LabelInfo> liList = new[] { li };
            //			PrinterHelper.doPrinting(liList, true);

            if (!Program.settings.useOldDatamaxFormat)
            {
                IEnumerable <LabelInfo> liList = new[] { li };
                PrinterHelper.doPrinting(liList, true);
            }
            else
            {
                int iLabelSize = PrinterHelper.getPageHeight(Program.settings.printer);

                using (var ms = new MemoryStream())
                {
                    if (iLabelSize >= 170 && iLabelSize <= 230)
                    {
                        ms.LabelKiosk2(li);
                    }
                    else
                    {
                        ms.LabelKiosk(li);
                    }
                    PrintRawHelper.SendDocToPrinter(Program.settings.printer, ms);
                }
            }

            RemoveMenu();
        }
Exemplo n.º 3
0
        public void FinishUp(MemoryStream ms)
        {
            if (LabelsPrinted > 0)
            {
                if (RequiresSecurityLabels > 0)
                {
                    int iLabelSize = PrinterHelper.getPageHeight(Program.settings.printer);

                    var n = RequiresSecurityLabels;
                    if (iLabelSize >= 170 && iLabelSize <= 230)
                    {
                        LabelsPrinted += ms.SecurityLabel2(time, Program.SecurityCode, n);
                    }
                    else
                    {
                        LabelsPrinted += ms.SecurityLabel(time, Program.SecurityCode, n);
                    }
                }
                ms.BlankLabel(LabelsPrinted == 1);                 // force blank if only 1
            }
            PrintRawHelper.SendDocToPrinter(Program.settings.printer, ms);
        }
Exemplo n.º 4
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
                {
                    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);
        }