Esempio n. 1
0
        /// <summary>
        /// 上传批次记录
        /// </summary>
        public static void UploadBatchTable()
        {
            try
            {
                LBatchNoDAL ldal = new LBatchNoDAL();
                //获取本地批次信息
                DataTable table = ldal.GetList("").Tables[0];
                if (table == null || table.Rows.Count == 0)
                {
                    return;
                }
                BatchNoDAL dal = new BatchNoDAL();

                string IDs = dal.Upload(table);

                if (!string.IsNullOrEmpty(IDs))
                {
                    ldal.DeleteList(IDs);//上传后删除本地数据
                    CLog.WriteStationLog("Sys", "UploadBatchTable:TID->{" + IDs + "},Time:{" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "}");
                    //string[] str = IDs.Split(',');
                }
            }
            catch (Exception ex)
            {
                CLog.WriteErrLog(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 上传批次记录
        /// </summary>
        private void UploadBatchTable()
        {
            this.Invoke((EventHandler) delegate
            {
                try
                {
                    Cursor.Current      = Cursors.WaitCursor;
                    progressBar.Value   = 0;
                    progressBar.Maximum = 1;
                    //上传本地批次历史信息
                    #region   本地批次历史信息
                    //获取本地批次历史信息
                    DataTable table = lBatchDAL.GetList("").Tables[0];

                    string IDs = BatchDAL.Upload(table);

                    if (!string.IsNullOrEmpty(IDs))
                    {
                        lBatchDAL.DeleteList(IDs);//上传后删除本地数据
                        string[] str = IDs.Split(',');
                        uploadnum   += str.Length;
                    }
                    ProgressTip(1);//更新进度
                    Cursor.Current = Cursors.Default;
                    #endregion
                }
                catch (Exception ex)
                {
                    CLog.WriteErrLog(ex.Message);
                }
            });
        }