示例#1
0
        private void EnqueueUploadData(YKBoxInfo data)
        {
            SqliteUploadDataInfo ud = new SqliteUploadDataInfo();

            ud.Guid       = Guid.NewGuid().ToString();
            ud.Data       = data;
            ud.IsUpload   = 0;
            ud.CreateTime = DateTime.Now;
            YKBoxSqliteService.InsertUploadData(ud);
            UploadServer.GetInstance().CurrentUploadQueue.Push(ud);
        }
示例#2
0
        void uploadSap(YKBoxInfo box)
        {
            try
            {
                SqliteUploadDataInfo ud = new SqliteUploadDataInfo();
                ud.Guid       = Guid.NewGuid().ToString();
                ud.Data       = box;
                ud.IsUpload   = 0;
                ud.CreateTime = DateTime.Now;
                YKBoxSqliteService.InsertUploadData(ud);

                SapResult result = SAPDataService.UploadYKBoxInfo(SysConfig.LGNUM, box);
                box.SapRemark = result.MSG;
                box.SapStatus = result.STATUS;
                bool xdSaveResult = YKBoxService.SaveBox(box);
                YKBoxSqliteService.SetUploaded(ud.Guid);
            }
            catch (Exception e)
            {
                Log4netHelper.LogError(e);
            }
        }
示例#3
0
        private void uploadAgainButton_Click(object sender, EventArgs e)
        {
            List <YKBoxInfo> rowBoxList = new List <YKBoxInfo>();

            List <DataGridViewRow> rows = GetCheckedRows();

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

            foreach (YKBoxInfo data in rowBoxList)
            {
                SqliteUploadDataInfo ud = new SqliteUploadDataInfo();
                ud.Guid       = Guid.NewGuid().ToString();
                ud.Data       = data;
                ud.IsUpload   = 0;
                ud.CreateTime = DateTime.Now;
                YKBoxSqliteService.InsertUploadData(ud);
                UploadServer.GetInstance().CurrentUploadQueue.Push(ud);
            }

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