Exemple #1
0
        public static int AllergyLabel2(this MemoryStream ms, LabelInfo li, string code)
        {
            if (li.n == 0 || !Program.Printer.HasValue())
            {
                return(0);
            }
            if (li.mv != "G" && li.mv != "V")
            {
                return(0);
            }
            var sw = new StreamWriter(ms);

            if (Program.Printer.Contains("ZDesigner"))
            {
                StartZDesignerLabel(sw);
                sw.WriteLine(@"^FT27,87^A0N,79,79^FH\^FD{0}^FS".Fmt(li.first));
                sw.WriteLine(@"^FT26,138^A0N,39,38^FH\^FD{0}^FS".Fmt(li.last));
                sw.WriteLine(@"^FT26,173^A0N,28,28^FH\^FDGuest {0}^FS".Fmt(li.allergies));
                sw.WriteLine(@"^FT26,217^A0N,23,24^FH\^FD{0} ({1})^FS".Fmt(li.org, li.mv.Replace("V", "G")));
                sw.WriteLine(@"^FT27,263^A0N,28,28^FH\^FD{0}^FS".Fmt(li.location));
                sw.WriteLine(@"^FT143,263^A0N,28,28^FH\^FD{0:d}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT252,263^A0N,28,28^FH\^FD{0:t}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT434,265^A0N,79,79^FH\^FD{0}^FS".Fmt(code));
                sw.WriteLine(@"^BY3,2,87^FT55,386^B3N,N,,N,N");
                sw.WriteLine(@"^FD10210217^FS".Fmt(li.pid));
                sw.WriteLine("^PQ1,0,1,Y^XZ");
            }
            else if (Program.Printer.Contains("Godex"))
            {
                var loc = li.location;
                if (!loc.HasValue())
                {
                    loc = "n/a";
                }
                var allergies = li.allergies;
                if (allergies.HasValue())
                {
                    allergies = "(" + allergies + ")";
                }
                StartGodexLabel(sw, 1);
                sw.WriteLine("AG,16,0,1,1,0,0," + li.first);
                sw.WriteLine("AE,18,66,1,1,0,0," + li.last);
                sw.WriteLine("AD,18,108,1,1,0,0,Guest " + allergies);
                sw.WriteLine("AB,18,152,1,1,0,0,{0} ({1})".Fmt(li.org, li.mv.Replace("V", "G")));
                sw.WriteLine("AD,18,195,1,1,0,0," + loc);
                sw.WriteLine("AD,158,195,1,1,0,0,{0:d}".Fmt(li.hour));
                sw.WriteLine("AD,303,195,1,1,0,0,{0:t}".Fmt(li.hour));
                sw.WriteLine("AH,433,162,1,1,0,0," + code);
                sw.WriteLine("BA,57,241,3,7,100,0,2," + li.pid);
                sw.WriteLine("E");
            }
            sw.Flush();
            return(1);
        }
Exemple #2
0
        public static int AllergyLabel(this MemoryStream ms, LabelInfo li)
        {
            //GuestLabel
            if (li.n == 0 || !Program.Printer.HasValue())
            {
                return(0);
            }
            if (li.mv != "G" && li.mv != "V")
            {
                return(0);
            }
            var sw = new StreamWriter(ms);

            if (Program.Printer.Contains("ZDesigner"))
            {
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0406");
                sw.WriteLine("^LS0");
                sw.WriteLine(@"^FT29,83^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
                sw.WriteLine(@"^^FT30,134^A0N,34,33^FH\^FD{0}^FS".Fmt(li.last));
                sw.WriteLine(@"^FT30,183^A0N,28,28^FH\^FDGuest{0}^FS".Fmt(li.allergies.HasValue() ? " (" + li.allergies + ")" : ""));
                sw.WriteLine("^PQ1,0,1,Y^XZ");
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A1800500010" + li.first);
                sw.WriteLine("1911A1200320010" + li.last);
                sw.WriteLine("1911A1000060011Guest" + (li.allergies.HasValue() ? " (" + li.allergies + ")" : ""));
                sw.WriteLine("Q0001");
                sw.WriteLine("E");
            }
            sw.Flush();
            return(1);
        }
        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();
        }
Exemple #4
0
        public static int LocationLabel(this MemoryStream ms, LabelInfo li)
        {
            if (li.n == 0 || !Program.Printer.HasValue())
            {
                return(0);
            }
            if (!li.mv.Replace("V", "G").Contains("G") || !li.location.HasValue())
            {
                return(0);
            }
            var sw = new StreamWriter(ms);

            if (Program.Printer.Contains("ZDesigner"))
            {
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0406");
                sw.WriteLine("^LS0");
                sw.WriteLine(@"^FT29,83^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
                sw.WriteLine(@"^FT30,155^A0N,45,45^FH\^FDLocation/time: {0}, {1:h:mm tt}^FS"
                             .Fmt(li.location, li.hour));
                sw.WriteLine("^PQ1,0,1,Y^XZ");
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A1800450014" + li.first);
                sw.WriteLine("1911A1400120013Location: {0}, {1:h:mm tt}"
                             .Fmt(li.location, li.hour));
                sw.WriteLine("Q0001");
                sw.WriteLine("E");
            }
            sw.Flush();
            return(1);
        }
Exemple #5
0
 public static int AllergyLabel(this MemoryStream ms, LabelInfo li)
 {
     //GuestLabel
     if (li.n == 0 || !Program.Printer.HasValue())
         return 0;
     if (li.mv != "G" && li.mv != "V")
         return 0;
     var sw = new StreamWriter(ms);
     if (Program.Printer.Contains("ZDesigner"))
     {
         sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
         sw.WriteLine("^XA");
         sw.WriteLine("^MMT");
         sw.WriteLine("^PW609");
         sw.WriteLine("^LL0406");
         sw.WriteLine("^LS0");
         sw.WriteLine(@"^FT29,83^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
         sw.WriteLine(@"^^FT30,134^A0N,34,33^FH\^FD{0}^FS".Fmt(li.last));
         sw.WriteLine(@"^FT30,183^A0N,28,28^FH\^FDGuest{0}^FS".Fmt(li.allergies.HasValue() ? " (" + li.allergies + ")" : ""));
         sw.WriteLine("^PQ1,0,1,Y^XZ");
     }
     else if (Program.Printer.Contains("Datamax"))
     {
         sw.WriteLine("\x02n");
         sw.WriteLine("\x02M0500");
         sw.WriteLine("\x02O0220");
         sw.WriteLine("\x02V0");
         sw.WriteLine("\x02SG");
         sw.WriteLine("\x02d");
         sw.WriteLine("\x01D");
         sw.WriteLine("\x02L");
         sw.WriteLine("D11");
         sw.WriteLine("PG");
         sw.WriteLine("pC");
         sw.WriteLine("SG");
         sw.WriteLine("ySPM");
         sw.WriteLine("A2");
         sw.WriteLine("1911A1800500010" + li.first);
         sw.WriteLine("1911A1200320010" + li.last);
         sw.WriteLine("1911A1000060011Guest" + (li.allergies.HasValue() ? " (" + li.allergies + ")" : ""));
         sw.WriteLine("Q0001");
         sw.WriteLine("E");
     }
     sw.Flush();
     return 1;
 }
Exemple #6
0
 public static int AllergyLabel2(this MemoryStream ms, LabelInfo li, string code)
 {
     if (li.n == 0 || !Program.Printer.HasValue())
         return 0;
     if (li.mv != "G" && li.mv != "V")
         return 0;
     var sw = new StreamWriter(ms);
     if (Program.Printer.Contains("ZDesigner"))
     {
         StartZDesignerLabel(sw);
         sw.WriteLine(@"^FT27,87^A0N,79,79^FH\^FD{0}^FS".Fmt(li.first));
         sw.WriteLine(@"^FT26,138^A0N,39,38^FH\^FD{0}^FS".Fmt(li.last));
         sw.WriteLine(@"^FT26,173^A0N,28,28^FH\^FDGuest {0}^FS".Fmt(li.allergies));
         sw.WriteLine(@"^FT26,217^A0N,23,24^FH\^FD{0} ({1})^FS".Fmt(li.org, li.mv.Replace("V", "G")));
         sw.WriteLine(@"^FT27,263^A0N,28,28^FH\^FD{0}^FS".Fmt(li.location));
         sw.WriteLine(@"^FT143,263^A0N,28,28^FH\^FD{0:d}^FS".Fmt(li.hour));
         sw.WriteLine(@"^FT252,263^A0N,28,28^FH\^FD{0:t}^FS".Fmt(li.hour));
         sw.WriteLine(@"^FT434,265^A0N,79,79^FH\^FD{0}^FS".Fmt(code));
         sw.WriteLine(@"^BY3,2,87^FT55,386^B3N,N,,N,N");
         sw.WriteLine(@"^FD10210217^FS".Fmt(li.pid));
         sw.WriteLine("^PQ1,0,1,Y^XZ");
     }
     else if (Program.Printer.Contains("Godex"))
     {
         var loc = li.location;
         if (!loc.HasValue())
             loc = "n/a";
         var allergies = li.allergies;
         if (allergies.HasValue())
             allergies = "(" + allergies + ")";
         StartGodexLabel(sw, 1);
         sw.WriteLine("AG,16,0,1,1,0,0," + li.first);
         sw.WriteLine("AE,18,66,1,1,0,0," + li.last);
         sw.WriteLine("AD,18,108,1,1,0,0,Guest " + allergies);
         sw.WriteLine("AB,18,152,1,1,0,0,{0} ({1})".Fmt(li.org, li.mv.Replace("V", "G")));
         sw.WriteLine("AD,18,195,1,1,0,0," + loc);
         sw.WriteLine("AD,158,195,1,1,0,0,{0:d}".Fmt(li.hour));
         sw.WriteLine("AD,303,195,1,1,0,0,{0:t}".Fmt(li.hour));
         sw.WriteLine("AH,433,162,1,1,0,0," + code);
         sw.WriteLine("BA,57,241,3,7,100,0,2," + li.pid);
         sw.WriteLine("E");
     }
     sw.Flush();
     return 1;
 }
Exemple #7
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,
            };

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

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

            RemoveMenu();
        }
Exemple #8
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);

			RemoveMenu();
		}
Exemple #9
0
        public static int Label(this MemoryStream ms, LabelInfo li, int nlabels, string code)
        {
            //MainLabel
            if (nlabels <= 0 || !Program.Printer.HasValue())
            {
                return(0);
            }
            var sw = new StreamWriter(ms);

            string lorg = "";

            if (li.location.HasValue())
            {
                if (!li.org.StartsWith(li.location))
                {
                    lorg = li.location + ", ";
                }
            }
            lorg += li.org;

            if (Program.Printer.Contains("ZDesigner"))
            {
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0406");
                sw.WriteLine("^LS0");
                sw.WriteLine(@"^FT29,75^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
                sw.WriteLine(@"^FT29,118^A0N,28,28^FH\^FD{0}^FS".Fmt(li.last));
                sw.WriteLine(@"^FT29,153^A0N,28,28^FH\^FD{0} |{1}{2}{3}^FS".Fmt(li.mv.Replace("V", "G"),
                                                                                li.allergies.HasValue() ? " A |" : "",
                                                                                li.transport ? " T |" : "",
                                                                                li.custody ? " C |" : ""));
                sw.WriteLine(@"^FT29,185^A0N,28,28^FH\^FD{0}^FS".Fmt(lorg));
                sw.WriteLine(@"^FT473,48^A0N,28,28^FH\^FD{0:d}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT474,77^A0N,28,28^FH\^FD{0:t}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT470,152^A0N,73,72^FH\^FD{0}^FS".Fmt(code));
                sw.WriteLine("^PQ{0},0,1,Y^XZ".Fmt(nlabels));
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A1800500010" + li.first);
                sw.WriteLine("1911A1000350011" + li.last);
                sw.WriteLine("1911A1000190011{0} |{1}{2}{3}".Fmt(li.mv.Replace("V", "G"),
                                                                 li.allergies.HasValue() ? " A |" : "",
                                                                 li.transport ? " T |" : "",
                                                                 li.custody ? " C |" : ""));
                sw.WriteLine("1911A1000020011" + lorg);
                sw.WriteLine("1911A1000610222{0:d}".Fmt(li.hour));
                sw.WriteLine("1911A1000470222{0:t}".Fmt(li.hour));
                sw.WriteLine("1911A2400140219" + code);

                sw.WriteLine("Q" + nlabels.ToString("0000"));
                sw.WriteLine("E");
            }
            sw.Flush();
            return(nlabels);
        }
Exemple #10
0
        public static void LabelKiosk(this MemoryStream ms, LabelInfo li)
        {
            if (!Program.Printer.HasValue())
            {
                return;
            }
            var sw = new StreamWriter(ms);

            if (Program.Printer.Contains("ZDesigner"))
            {
                //sw.WriteLine("CT~~CD,~CC^~CT~");
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0203");
                sw.WriteLine("^LS0");
                sw.WriteLine(string.Format(@"^FT592,122^A0I,79,79^FH\^FD{0}^FS", li.first));
                sw.WriteLine(string.Format(@"^FT583,69^A0I,34,33^FH\^FD{0}^FS", li.last));
                var al = "na";
                if (li.allergies.HasValue())
                {
                    al = li.allergies;
                }
                sw.WriteLine(string.Format(@"^FT585,26^A0I,23,24^FH\^FD{0}, ({1})^FS", li.org, al));
                sw.WriteLine(string.Format(@"^^FT133,65^A0I,51,50^FH\^FD{0}^FS", li.location));
                sw.WriteLine(string.Format("^PQ{0},0,1,Y^XZ", li.n));
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A2400490006" + li.first);
                sw.WriteLine("1911A1200280008" + li.last);
                sw.WriteLine(string.Format("1911A0800050007{0}, ({1})", li.org, li.allergies));
                sw.WriteLine("1911A2400280190" + li.location);
                sw.WriteLine("Q" + li.n.ToString("0000"));
                sw.WriteLine("E");
            }
            else
            {
                sw.WriteLine(li.first);
                sw.WriteLine(li.last);
                sw.WriteLine(string.Format("{0}, ({1})", li.org, li.allergies));
                sw.WriteLine(li.location);
            }

            sw.Flush();
            ms.BlankLabel(true);
        }
Exemple #11
0
 public static int LocationLabel(this MemoryStream ms, LabelInfo li)
 {
     if (li.n == 0 || !Program.Printer.HasValue())
         return 0;
     if (!li.mv.Replace("V", "G").Contains("G") || !li.location.HasValue())
         return 0;
     var sw = new StreamWriter(ms);
     if (Program.Printer.Contains("ZDesigner"))
     {
         sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
         sw.WriteLine("^XA");
         sw.WriteLine("^MMT");
         sw.WriteLine("^PW609");
         sw.WriteLine("^LL0406");
         sw.WriteLine("^LS0");
         sw.WriteLine(@"^FT29,83^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
         sw.WriteLine(@"^FT30,155^A0N,45,45^FH\^FDLocation/time: {0}, {1:h:mm tt}^FS"
             .Fmt(li.location, li.hour));
         sw.WriteLine("^PQ1,0,1,Y^XZ");
     }
     else if (Program.Printer.Contains("Datamax"))
     {
         sw.WriteLine("\x02n");
         sw.WriteLine("\x02M0500");
         sw.WriteLine("\x02O0220");
         sw.WriteLine("\x02V0");
         sw.WriteLine("\x02SG");
         sw.WriteLine("\x02d");
         sw.WriteLine("\x01D");
         sw.WriteLine("\x02L");
         sw.WriteLine("D11");
         sw.WriteLine("PG");
         sw.WriteLine("pC");
         sw.WriteLine("SG");
         sw.WriteLine("ySPM");
         sw.WriteLine("A2");
         sw.WriteLine("1911A1800450014" + li.first);
         sw.WriteLine("1911A1400120013Location: {0}, {1:h:mm tt}"
             .Fmt(li.location, li.hour));
         sw.WriteLine("Q0001");
         sw.WriteLine("E");
     }
     sw.Flush();
     return 1;
 }
Exemple #12
0
 public static void LabelKiosk2(this MemoryStream ms, LabelInfo li)
 {
     if (!Program.Printer.HasValue())
         return;
     var sw = new StreamWriter(ms);
     if (Program.Printer.Contains("Godex"))
     {
         StartGodexLabel(sw, 1);
         sw.WriteLine("AH,18,0,1,1,0,0," + li.first);
         sw.WriteLine("AE,18,84,1,1,0,0," + li.last);
         var al = li.allergies;
         if (!al.HasValue())
             al = "na";
         sw.WriteLine("AC,18,133,1,1,0,0,(" + al + ")");
         sw.WriteLine("AC,19,191,1,1,0,0" + li.org);
         sw.WriteLine("AC,19,227,1,1,0,0," + li.location);
         sw.WriteLine("E");
     }
     sw.Flush();
 }
Exemple #13
0
        public static void LabelKiosk(this MemoryStream ms, LabelInfo li)
        {
            if (!Program.Printer.HasValue())
                return;
            var sw = new StreamWriter(ms);
            if (Program.Printer.Contains("ZDesigner"))
            {
                //sw.WriteLine("CT~~CD,~CC^~CT~");
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0203");
                sw.WriteLine("^LS0");
                sw.WriteLine(string.Format(@"^FT592,122^A0I,79,79^FH\^FD{0}^FS", li.first));
                sw.WriteLine(string.Format(@"^FT583,69^A0I,34,33^FH\^FD{0}^FS", li.last));
                var al = "na";
                if (li.allergies.HasValue())
                    al = li.allergies;
                sw.WriteLine(string.Format(@"^FT585,26^A0I,23,24^FH\^FD{0}, ({1})^FS", li.org, al));
                sw.WriteLine(string.Format(@"^^FT133,65^A0I,51,50^FH\^FD{0}^FS", li.location));
                sw.WriteLine(string.Format("^PQ{0},0,1,Y^XZ", li.n));
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A2400490006" + li.first);
                sw.WriteLine("1911A1200280008" + li.last);
                sw.WriteLine(string.Format("1911A0800050007{0}, ({1})", li.org, li.allergies));
                sw.WriteLine("1911A2400280190" + li.location);
                sw.WriteLine("Q" + li.n.ToString("0000"));
                sw.WriteLine("E");
            }
            else
            {
                sw.WriteLine(li.first);
                sw.WriteLine(li.last);
                sw.WriteLine(string.Format("{0}, ({1})", li.org, li.allergies));
                sw.WriteLine(li.location);
            }

            sw.Flush();
            ms.BlankLabel(true);
        }
Exemple #14
0
        public static int Label(this MemoryStream ms, LabelInfo li, int nlabels, string code)
        {
            //MainLabel
            if (nlabels <= 0 || !Program.Printer.HasValue())
                return 0;
            var sw = new StreamWriter(ms);

            string lorg = "";
            if (li.location.HasValue())
                if (!li.org.StartsWith(li.location))
                    lorg = li.location + ", ";
            lorg += li.org;

            if (Program.Printer.Contains("ZDesigner"))
            {
                sw.WriteLine("^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ");
                sw.WriteLine("^XA");
                sw.WriteLine("^MMT");
                sw.WriteLine("^PW609");
                sw.WriteLine("^LL0406");
                sw.WriteLine("^LS0");
                sw.WriteLine(@"^FT29,75^A0N,62,62^FH\^FD{0}^FS".Fmt(li.first));
                sw.WriteLine(@"^FT29,118^A0N,28,28^FH\^FD{0}^FS".Fmt(li.last));
                sw.WriteLine(@"^FT29,153^A0N,28,28^FH\^FD{0} |{1}{2}{3}^FS".Fmt(li.mv.Replace("V", "G"),
                    li.allergies.HasValue() ? " A |" : "",
                    li.transport ? " T |" : "",
                    li.custody ? " C |" : ""));
                sw.WriteLine(@"^FT29,185^A0N,28,28^FH\^FD{0}^FS".Fmt(lorg));
                sw.WriteLine(@"^FT473,48^A0N,28,28^FH\^FD{0:d}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT474,77^A0N,28,28^FH\^FD{0:t}^FS".Fmt(li.hour));
                sw.WriteLine(@"^FT470,152^A0N,73,72^FH\^FD{0}^FS".Fmt(code));
                sw.WriteLine("^PQ{0},0,1,Y^XZ".Fmt(nlabels));
            }
            else if (Program.Printer.Contains("Datamax"))
            {
                sw.WriteLine("\x02n");
                sw.WriteLine("\x02M0500");
                sw.WriteLine("\x02O0220");
                sw.WriteLine("\x02V0");
                sw.WriteLine("\x02SG");
                sw.WriteLine("\x02d");
                sw.WriteLine("\x01D");
                sw.WriteLine("\x02L");
                sw.WriteLine("D11");
                sw.WriteLine("PG");
                sw.WriteLine("pC");
                sw.WriteLine("SG");
                sw.WriteLine("ySPM");
                sw.WriteLine("A2");
                sw.WriteLine("1911A1800500010" + li.first);
                sw.WriteLine("1911A1000350011" + li.last);
                sw.WriteLine("1911A1000190011{0} |{1}{2}{3}".Fmt(li.mv.Replace("V", "G"),
                    li.allergies.HasValue() ? " A |" : "",
                    li.transport ? " T |" : "",
                    li.custody ? " C |" : ""));
                sw.WriteLine("1911A1000020011" + lorg);
                sw.WriteLine("1911A1000610222{0:d}".Fmt(li.hour));
                sw.WriteLine("1911A1000470222{0:t}".Fmt(li.hour));
                sw.WriteLine("1911A2400140219" + code);

                sw.WriteLine("Q" + nlabels.ToString("0000"));
                sw.WriteLine("E");
            }
            sw.Flush();
            return nlabels;
        }