Example #1
0
        void PullCigarette(string stri)
        {
            MixInfos info = MixedClass.GetMixCig2(machineSeq, groupNo, 0)[0];

            WriteLog.GetLog().Write("扫到条码" + stri);
            if (info.CigCode.Trim().Contains(str) || info.CigCode.Trim() == str || info.CigCode.Trim().Substring(info.CigCode.Trim().Length - 7) == stri.Trim().Substring(info.CigCode.Trim().Length - 7) || info.CigCode.Trim().Contains(stri.Trim().Substring(info.CigCode.Trim().Length - 7)))
            {
                if (MixedClass.UpdatePullStatus2Put2(machineSeq, info.PokeID))
                {
                    WriteLog.GetLog().Write("<扫码放烟成功>");
                    GetData();
                    str = "";
                }
            }
            else
            {
                WriteLog.GetLog().Write("放烟品牌错误:扫描到条码" + str[0]);
                MessageBox.Show("放烟错误,请重放" + str);
                str = "";
            }
        }
Example #2
0
        void GetData()
        {
            //list = new List<MixInfos>();
            //foreach (var item in lbladded)
            //{
            UpdateLabel3(new List <MixInfos>(), 15, lbladded, Color.White);
            //    //item.Text = "";
            //}
            //foreach (var item in lbladd)
            //{
            UpdateLabel3(new List <MixInfos>(), 15, lbladd, Color.White);
            //    //item.Text = "";
            //    //item.BackColor = Color.White;
            //}

            try
            {
                list = MixedClass.GetMixCig2(machineSeq, groupNo, 0);
                int             length;
                List <MixInfos> lists = new List <MixInfos>();
                lists = GroupList(list);
                if (lists.Count > lbladded.Length)
                {
                    length = lbladded.Length;
                }
                else
                {
                    length = lists.Count;
                }
                UpdateLabel3(lists, length, lbladd, Color.White);
                try
                {
                    List <MixInfos> finish = new List <MixInfos>();
                    //UpdateLabel(finish, 15, lbladded);
                    finish = MixedClass.GetMixCig4(machineSeq, groupNo, 1).OrderByDescending(item => item.ThroughNum).OrderByDescending(item => item.SortNum).ToList();
                    int lengths;

                    List <MixInfos> finishs = new List <MixInfos>();
                    finishs = GroupList(finish).Take(15).OrderBy(item => item.ThroughNum).OrderBy(item => item.SortNum).ToList();
                    if (finishs.Count > lbladded.Length)
                    {
                        lengths = lbladded.Length;
                    }
                    else
                    {
                        lengths = finishs.Count;
                    }

                    UpdateLabel3(finishs, lengths, lbladded, Color.LightGreen);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            catch (Exception ex)
            {
                WriteLog.GetLog().Write("sp-03:数据获取失败!   ");
                //if (ex.Message == "基础提供程序在 Open 上失败。")
                //{
                databaselinkcheck("数据库连接失败!请检查网络,重新打开程序!");
                //}
            }
        }