using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BarTenderPrint { public class BigLableManager { BigLable label; BigLableInfo labelinfo; public BigLableManager(BigLable bL) { this.label = bL; labelinfo = new BigLableInfo(); } public BigLableInfo ConfigBigLableInfo() { check(); getProductInfo(); return labelinfo; } //获取总的字符串 public string getProductInfo() { StringBuilder sb = new StringBuilder(); sb.Append(label.Supplier).Append(" "); sb.Append(label.partNum).Append(" "); sb.Append(labelinfo.DateString).Append(" "); sb.Append(label.serialNum).Append(" "); sb.Append(label.SoftVersion).Append(" "); sb.Append(label.yieldly).Append(" "); labelinfo.ProductInfo=sb.ToString(); labelinfo.barcode = labelinfo.ProductInfo.Replace(" ",""); return labelinfo.barcode; } #region 校验 private void check() { GetCheckCode(); //获取checklist List checkList = GetCheckCodeList(); int sum = 0; foreach(var c in checkList) { sum += c; } int ss = sum % 36; EncheckCode checkcode = (EncheckCode)ss; labelinfo.CheckCode = checkcode.ToString(); } public void GetCheckCode() { StringBuilder sb = new StringBuilder(); sb.Append(label.Supplier); sb.Append(label.partNum); labelinfo.DateString = getdateString(); sb.Append(labelinfo.DateString); labelinfo.CheckCodeString = sb.ToString().Replace("-", ""); } private List GetCheckCodeList() { string sub; List checkList = new List(); for(int i=0;i 9) { return ((Endate)day).ToString(); } else { return day.ToString(); } } #endregion } }