Ejemplo n.º 1
0
        public static List <SagawaLabel> getSagawaLableByShengXinNo(string shengXinNo)
        {
            List <SagawaLabel> sagawaLableList = new List <SagawaLabel>();
            string             data            = ApiHelper.Get("/sxn/printFileDownload?order=" + shengXinNo, null);

            if (!string.IsNullOrEmpty(data))
            {
                data = ApiHelper.DeserializeJson <Dictionary <string, string> >(data)["pInfo"];
                //将分割后的数据放入数组中
                string[] tmpData = data.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var item in tmpData)
                {
                    SagawaLabel sagawaLabel = new SagawaLabel();
                    sagawaLabel.parsing(item);
                    sagawaLableList.Add(sagawaLabel);
                }
            }
            return(sagawaLableList);
        }
Ejemplo n.º 2
0
        private void printOffline(string path)
        {
            if (File.Exists(path))
            {
                offLineList = new List <SagawaLabel>();
                //如果文件存在读文件里的内容
                StreamReader lineText = new StreamReader(path, Encoding.UTF8);
                string       line     = "";
                while ((line = lineText.ReadLine()) != null)
                {
                    printPrivewOfflineTabLable.Text += line + "\n\n";
                    //System.Diagnostics.Debug.WriteLine(line);
                    SagawaLabel sagawaLabel = new SagawaLabel();
                    sagawaLabel.parsing(line);
                    offLineList.Add(sagawaLabel);
                }
                //取消自动打印,只保留读取文件操作  By Zhangsong

                /* if (offLineList != null && offLineList.Count > 0)
                 *   foreach (var item in offLineList)
                 *   {
                 *       if (item != null)
                 *       {
                 *           switch (item.LabelType)
                 *           {
                 *               case "sagawa":
                 *                   ArgoxPrintUtil.SagawaLablePrint(item);
                 *                   break;
                 *               default: break;
                 *           }
                 *       }
                 *   }*/
            }
            else
            {
                MessageBox.Show("文件不存在");
            }
        }