public void OnReportDelete(object sender, TEventArg <NetTransferNotifyMsg> arg)
        {
            bool invokeRequired = base.InvokeRequired;

            if (invokeRequired)
            {
                base.Invoke(new Action <object, TEventArg <NetTransferNotifyMsg> >(this.OnReportDelete), new object[]
                {
                    sender,
                    arg
                });
            }
            else
            {
                bool flag = arg.Arg.Status == ENetTransferStatus.Start;
                if (flag)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 10;
                    this.label3.Text = arg.Arg.Msg;
                    this.radWaitingBar1.StartWaiting();
                    this.SetUIStatus(false);
                }
                bool flag2 = arg.Arg.Status == ENetTransferStatus.OnProgress;
                if (flag2)
                {
                    this.label3.Text = arg.Arg.Msg;
                }
                bool flag3 = arg.Arg.Status == ENetTransferStatus.Error;
                if (flag3)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 0;
                    this.label3.Text      = arg.Arg.Msg;
                    this.label3.ForeColor = Color.Red;
                    this.radWaitingBar1.EndWaiting();
                    this.SetUIStatus(true);
                }
                bool flag4 = arg.Arg.Status == ENetTransferStatus.Success;
                if (flag4)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 0;
                    this.radWaitingBar1.EndWaiting();
                    this.label3.Text = "删除成功" + arg.Arg.Msg;
                    UploadedBatchLogger.Del_Old(this.txtBox_BatchNO.Text);
                    this.DeleteItemFromListView(this.txtBox_BatchNO.Text);
                    this.txtBox_BatchNO.Text = "";
                    this.SetUIStatus(true);
                }
            }
        }
        public FormDelBatch(UCNavigatorBar p)
        {
            this.InitializeComponent();
            this.Text        = "删除批次";
            this._naparent   = p;
            this.label3.Text = "";
            UploadedBatchLogger localUploaded = UploadedBatchLogger.GetLocalUploaded();
            bool flag = localUploaded != null;

            if (flag)
            {
                foreach (UploadedBatchInfo current in localUploaded.BatchNos)
                {
                    this.listView1.Items.Add(current.BatchNo);
                }
            }
        }
 public static void Del_Old(string batchno)
 {
     if (FunctionSetting.GetInstance().AllowLogUploaded)
     {
         UploadedBatchLogger localUploaded = UploadedBatchLogger.GetLocalUploaded();
         foreach (UploadedBatchInfo info in localUploaded.BatchNos)
         {
             if (info.BatchNo == batchno)
             {
                 localUploaded.BatchNos.RemoveAll(o => o.BatchNo == batchno);
                 string fname = SystemHelper.GetAssemblesDirectory() + _localuploadebatchsfname;
                 SerializeHelper.SerializeToXML <UploadedBatchLogger>(localUploaded, fname);
                 break;
             }
         }
     }
 }
示例#4
0
        private void ListView1_MouseClick(object sender, MouseEventArgs e)
        {
            bool flag = e.Button == MouseButtons.Right && this.listView1.SelectedItems.Count > 0;

            if (flag)
            {
                ContextMenu contextMenu = new ContextMenu();
                MenuItem    menuItem    = new MenuItem();
                menuItem.Text   = "删除记录";
                menuItem.Click += delegate(object senderx, EventArgs ee)
                {
                    UploadedBatchLogger.Del_Old(this.listView1.SelectedItems[0].Text);
                    this.listView1.Items.RemoveAt(this.listView1.SelectedIndices[0]);
                };
                contextMenu.MenuItems.Add(menuItem);
                contextMenu.Show(this.listView1, e.Location);
            }
        }
示例#5
0
        public UCQueryBatch()
        {
            this.InitializeComponent();
            this.Text        = "查询批次";
            this.label3.Text = "";
            this.textBox1.Focus();
            UploadedBatchLogger localUploaded = UploadedBatchLogger.GetLocalUploaded();
            bool flag = localUploaded != null;

            if (flag)
            {
                foreach (UploadedBatchInfo current in localUploaded.BatchNos)
                {
                    ListViewItem listViewItem = this.listView1.Items.Add(current.BatchNo);
                    listViewItem.SubItems.Add(current.Time.ToLongDateString());
                }
            }
            this.listView1.MouseClick += new MouseEventHandler(this.ListView1_MouseClick);
        }
 public static void Add_New(UploadedBatchInfo newBatchNos)
 {
     if (FunctionSetting.GetInstance().AllowLogUploaded)
     {
         UploadedBatchLogger localUploaded = UploadedBatchLogger.GetLocalUploaded();
         bool flag2 = localUploaded.BatchNos.Find((UploadedBatchInfo o) => o.BatchNo == newBatchNos.BatchNo) == null;
         if (flag2)
         {
             localUploaded.BatchNos.Insert(0, newBatchNos);
         }
         string fname = SystemHelper.GetAssemblesDirectory() + UploadedBatchLogger._localuploadebatchsfname;
         try
         {
             SerializeHelper.SerializeToXML <UploadedBatchLogger>(localUploaded, fname);
         }
         catch
         {
         }
     }
 }
        public static UploadedBatchLogger GetLocalUploaded()
        {
            string text = SystemHelper.GetAssemblesDirectory() + UploadedBatchLogger._localuploadebatchsfname;
            bool   flag = File.Exists(text);
            UploadedBatchLogger result;

            if (flag)
            {
                try
                {
                    UploadedBatchLogger uploadedBatchLogger = SerializeHelper.DeSerializeFromXML <UploadedBatchLogger>(text);
                    result = uploadedBatchLogger;
                    return(result);
                }
                catch
                {
                    File.Delete(text);
                }
            }
            UploadedBatchLogger uploadedBatchLogger2 = new UploadedBatchLogger();

            result = uploadedBatchLogger2;
            return(result);
        }
        public void OnTransferNotify(object sender, TEventArg <NetTransferNotifyMsg> arg)
        {
            bool invokeRequired = base.InvokeRequired;

            if (invokeRequired)
            {
                base.Invoke(new Action <object, TEventArg <NetTransferNotifyMsg> >(this.OnTransferNotify), new object[]
                {
                    sender,
                    arg
                });
            }
            else
            {
                bool flag = arg.Arg.Status == ENetTransferStatus.Start;
                if (flag)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 10;
                    this.labelStatus.Text = arg.Arg.Msg;
                    this.radWaitingBar1.StartWaiting();
                    this.SetUIStatus(false);
                    ListViewItem listViewItem = this.FindItem(arg.Arg.Msg);
                    bool         flag2        = listViewItem != null;
                    if (flag2)
                    {
                        listViewItem.SubItems[1].Text = arg.Arg.Msg;
                    }
                }
                bool flag3 = arg.Arg.Status == ENetTransferStatus.Error;
                if (flag3)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 0;
                    this.labelStatus.Text      = arg.Arg.Msg;
                    this.labelStatus.ForeColor = Color.Red;
                    ListViewItem listViewItem2 = this.FindItem(arg.Arg.CurBatchNO);
                    bool         flag4         = listViewItem2 != null;
                    if (flag4)
                    {
                        listViewItem2.SubItems[1].Text = "失败" + arg.Arg.Msg;
                    }
                    this.radWaitingBar1.EndWaiting();
                    this.SetUIStatus(true);
                }
                bool flag5 = arg.Arg.Status == ENetTransferStatus.OnProgress;
                if (flag5)
                {
                    this.labelStatus.Text = arg.Arg.Msg;
                }
                bool flag6 = arg.Arg.Status == ENetTransferStatus.Success;
                if (flag6)
                {
                    this.radWaitingBar1.WaitingIndicatorWidth = 0;
                    this.radWaitingBar1.EndWaiting();
                    this.labelStatus.Text = "提交批次成功" + arg.Arg.CurBatchNO;
                    this.SetUIStatus(true);
                    this._uploadSuccessedbatchs.Add(arg.Arg.CurBatchNO);
                    UploadedBatchLogger.Add_New(new UploadedBatchInfo(arg.Arg.CurBatchNO));
                    ListViewItem listViewItem3 = this.FindItem(arg.Arg.Msg);
                    bool         flag7         = listViewItem3 != null;
                    if (flag7)
                    {
                        listViewItem3.SubItems[1].Text = "成功";
                    }
                }
            }
        }