예제 #1
0
        private void EnqueueUploadData(UploadBoxInfo data)
        {
            SqliteUploadDataInfo ud = new SqliteUploadDataInfo();

            ud.Guid       = Guid.NewGuid().ToString();
            ud.Data       = data;
            ud.IsUpload   = 0;
            ud.CreateTime = DateTime.Now;
            PackingBoxSqliteService.InsertUploadData(ud);
            UploadServer.GetInstance().CurrentUploadQueue.Push(ud);
        }
예제 #2
0
        private void uploadAgainButton_Click(object sender, EventArgs e)
        {
            List <PBBoxInfo> rowBoxList = new List <PBBoxInfo>();

            List <DataGridViewRow> rows = GetCheckedRows();

            if (rows != null && rows.Count > 0)
            {
                foreach (DataGridViewRow row in rows)
                {
                    PBBoxInfo box = row.Tag as PBBoxInfo;
                    if (box != null)
                    {
                        if (!rowBoxList.Exists(r => r.HU == box.HU))
                        {
                            rowBoxList.Add(box);
                        }
                    }
                }
            }

            foreach (PBBoxInfo data in rowBoxList)
            {
                UploadBoxInfo box = new UploadBoxInfo();
                box.EQUIP_HLA = SysConfig.DeviceInfo.EQUIP_HLA;
                box.LGNUM     = SysConfig.LGNUM;
                box.LOUCENG   = SysConfig.DeviceInfo.LOUCENG;
                box.SUBUSER   = SysConfig.CurrentLoginUser.UserId;
                box.Box       = data;

                SqliteUploadDataInfo ud = new SqliteUploadDataInfo();
                ud.Guid       = Guid.NewGuid().ToString();
                ud.Data       = box;
                ud.IsUpload   = 0;
                ud.CreateTime = DateTime.Now;
                PackingBoxSqliteService.InsertUploadData(ud);
                UploadServer.GetInstance().CurrentUploadQueue.Push(ud);
            }

            if (rowBoxList.Count > 0)
            {
                MetroMessageBox.Show(this, "成功加入上传列表", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
        }