Example #1
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="pn">编号</param>
        /// <param name="ct"></param>
        public void AddProductItem(int seq, string unitid, string pn, string code, int count, int op)
        {
            try
            {
                SubUnit unit = new SubUnit();
                unit.COUNT  = count;
                unit.Seq    = seq;
                unit.PN     = pn;
                unit.OP     = op;
                unit.CODE   = code;
                unit.UNITID = unitid;


                this.units.Add(unit);

                this.CODE += code + ",";

                pncode += pn + "\r\n";

                if (pncode.Length >= 16)
                {
                    pncode = pncode.Substring(0, 16);
                }
            }
            catch
            {
                throw;
            }
        }
Example #2
0
        public void AddProductItem(int seq, string unitid, string pn, int count, int seconds, int op, TimeRange range, DateTime upTime)
        {
            SubUnit unit = new SubUnit();

            unit.COUNT  = count;
            unit.Seq    = seq;
            unit.PN     = pn;
            unit.OP     = op;
            unit.UNITID = unitid;

            unit.SECONDS = seconds;
            this.units.Add(unit);
            pncode    = pn;
            this.code = pncode;

            if (this.EndTime != null)
            {
                TimeSpan span = range.EndTime - this.EndTime;

                if (span.TotalMilliseconds > 1)
                {
                    this.EndTime = range.EndTime;
                }
            }
            else
            {
                this.EndTime = range.EndTime;
            }


            this.StartTime = range.StartTime;

            if (this.UpDateTime != null)
            {
                TimeSpan span1 = upTime - this.UpDateTime;

                if (span1.TotalMilliseconds > 1)
                {
                    this.UpDateTime = upTime;
                }
            }
            else
            {
                this.UpDateTime = upTime;
            }
            // pncode += pn + "\r\n";

            if (pncode.Length >= 16)
            {
                pncode = pncode.Substring(0, 16);
            }
        }