private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if ((this.dtFlag == null) || (this.dtFlag.Rows.Count <= 0)) { this.cmbFlagType.addItems("(无)", 0); } else { foreach (DataRow row in this.dtFlag.Rows) { this.cmbFlagType.addItems(row["name"].ToString(), row["id"].ToString()); } this.cmbFlagType.SelectedIndex = 0; } if ((this.dtArea != null) && (this.dtArea.Rows.Count > 0)) { this.dtArea.Columns["AreaName"].ColumnName = "Display"; this.dtArea.Columns["AreaCode"].ColumnName = "Value"; this.cmbArea.DataSource = this.dtArea; } this.btnOK.Enabled = true; } catch (Exception exception) { MessageBox.Show(exception.Message); Record.execFileRecord("MapFlag->异步加裁完成事件", exception.StackTrace); } finally { this.grpPoint.Enabled = true; WaitForm.Hide(); } }
private void excelWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null) { MessageBox.Show(e.Result.ToString()); } WaitForm.Hide(); }
private void btnOK_Click(object sender, EventArgs e) { WaitForm.Show("正在更新地图标注,请稍候...", this); MainForm.POITypes = this.getCheckFlagTypeName(); MainForm.myMap.execClearAllFlag(); MainForm.myMap.showSelectedFlagMap(this.m_CurrentMap); WaitForm.Hide(); base.DialogResult = DialogResult.OK; }
private void btnOK_Click(object sender, EventArgs e) { if ((this.cmbFlagType.SelectedValue == null) || (this.cmbArea.SelectedValue == null)) { MessageBox.Show("标注类别或所属区域不能为空!"); } else { string source = this.txtAddress.Text.Trim(); string s = this.numLon.Value.ToString(); string str2 = this.numLat.Value.ToString(); string str4 = this.cmbFlagType.SelectedValue.ToString(); string areaCode = this.cmbArea.SelectedValue.ToString(); if (source == "") { MessageBox.Show("名称不能为空!"); } else if (this.cmbFlagType.Text == "(无)") { MessageBox.Show("标注类别非法,请确定你是否有添加标注的权限!"); } else { if (chkString(source)) { if (source.Length >= 50) { MessageBox.Show("字符长度不能超过50个!"); this.txtAddress.Focus(); return; } WaitForm.Show("正在更新地图标注,请稍候...", this); if (RemotingClient.MapFlag_AddFlagMap(float.Parse(s), float.Parse(str2), source, areaCode, int.Parse(str4)) <= 0) { WaitForm.Hide(); MessageBox.Show("名称已存在!"); this.txtAddress.Focus(); return; } MainForm.myMap.showFlagMap(this.m_CurrentMap); WaitForm.Hide(); base.DialogResult = DialogResult.OK; } else { MessageBox.Show("不许输入特殊字符!"); this.txtAddress.Focus(); return; } base.DialogResult = DialogResult.OK; } } }
private void btnExportExcel_Click(object sender, EventArgs e) { try { this.ExportExcel(); } catch (Exception exception) { WaitForm.Hide(); MessageBox.Show(exception.Message + "\r\n原因:文件可能已打开!"); Record.execFileRecord("文本界面->导出到Excel", exception.Message); } }
private void ExportExcel() { int num = 0; foreach (DataGridViewRow row in (IEnumerable) this.dgvCarTextList.Rows) { DataGridViewCheckBoxCell cell = row.Cells["colSelect"] as DataGridViewCheckBoxCell; if (((cell != null) && (cell.Value != null)) && bool.Parse(cell.FormattedValue.ToString())) { num++; } } if (num > 0) { SaveFileDialog dialog = new SaveFileDialog { Filter = "Execl files (*.xls)|*.xls", FilterIndex = 0, RestoreDirectory = true, CreatePrompt = true, FileName = "文本位置-" + DateTime.Now.ToString("yyyy-MM-dd"), Title = "导出文件保存路径" }; string fileName = ""; if (dialog.ShowDialog() != DialogResult.OK) { return; } fileName = dialog.FileName; if (string.IsNullOrEmpty(fileName)) { return; } WaitForm.Show("正在导出数据...", this); try { excelWorker = new BackgroundWorker(); excelWorker.DoWork += new DoWorkEventHandler(this.excelWorker_DoWork); excelWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.excelWorker_RunWorkerCompleted); excelWorker.RunWorkerAsync(fileName); return; } catch (Exception exception) { WaitForm.Hide(); MessageBox.Show(exception.Message + "\r\n原因:文件可能已打开!"); Record.execFileRecord("文本界面->导出到Excel", exception.Message); return; } } MessageBox.Show("没有数据可供导出,请先选中要导出的数据!"); }
private void myWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (e.Result != null && !string.IsNullOrEmpty(e.Result.ToString())) { this.setParam(e.Result.ToString()); } } catch { } this.setControlEnable(true); WaitForm.Hide(); }
private void btnLoad_Click(object sender, EventArgs e) { if (this.dgvQueryResult.Rows.Count <= 0) { MessageBox.Show("日期查车结果为空,无数据可供导出!"); } else { SaveFileDialog dialog = new SaveFileDialog { Filter = "Execl files (*.xls)|*.xls", FilterIndex = 0, RestoreDirectory = true, CreatePrompt = true, FileName = "日期查车报表-" + DateTime.Now.ToString("yyyy-MM-dd"), Title = "导出文件保存路径" }; string fileName = ""; if (dialog.ShowDialog() == DialogResult.OK) { fileName = dialog.FileName; if (!string.IsNullOrEmpty(fileName)) { WaitForm.Show("正在导出数据...", this); try { this.excelWorker = new BackgroundWorker(); this.excelWorker.DoWork += new DoWorkEventHandler(this.excelWorker_DoWork); this.excelWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.excelWorker_RunWorkerCompleted); this.excelWorker.RunWorkerAsync(fileName); } catch (Exception exception) { WaitForm.Hide(); MessageBox.Show(exception.Message + "\r\n原因:文件可能已打开!"); Record.execFileRecord("日期查车->导出到Excel", exception.Message); } } } } }
private void MapFlag_Load(object sender, EventArgs e) { this.btnOK.Enabled = false; this.dtArea = new DataTable(); this.dtArea.Columns.Add("AreaName", typeof(string)); this.dtArea.Columns.Add("AreaCode", typeof(string)); this.grpPoint.Enabled = false; base.Show(); WaitForm.Show("正在加载类别与所属区域信息...", this); try { this.worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.worker_RunWorkerCompleted); this.worker.DoWork += new DoWorkEventHandler(this.worker_DoWork); this.worker.WorkerReportsProgress = true; this.worker.RunWorkerAsync(); } catch (Exception exception) { WaitForm.Hide(); Record.execFileRecord("MapFlag->初期化", exception.ToString()); } }
private void worder_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { this.cmbCar.DataSource = this.source; this.worker.DoWork -= new DoWorkEventHandler(this.worder_DoWork); this.worker.RunWorkerCompleted -= new RunWorkerCompletedEventHandler(this.worder_RunWorkerCompleted); this.worker = null; } catch (Exception exception) { Record.execFileRecord("文本位置->异步处理完成事件", exception.Message); } finally { WaitForm.Hide(); if (this.cmbCar.Items.Count > 0) { this.btnQuery_Click(null, null); } } }
private void worder_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (this.dgvCarTextList.DataSource == null) { this.source.DataSource = this.dtText; this.dgvCarTextList.DataSource = this.source; } if ((this.dtText != null) && (this.dtText.Rows.Count > 0)) { this.refleshData(); this.cboxAccOn.Checked = !this.cboxAccOn.Checked; this.cboxAccOn.Checked = !this.cboxAccOn.Checked; this.lblDGVRowCount.Text = string.Format("总共 {0} 条记录", this.source.List.Count.ToString()); } else { this.lblDGVRowCount.Text = ""; } worker.DoWork -= new DoWorkEventHandler(this.worder_DoWork); worker.RunWorkerCompleted -= new RunWorkerCompletedEventHandler(this.worder_RunWorkerCompleted); worker = null; this.dgvCarTextList.ClearSelection(); this.dgvCarTextList.CurrentCell = this.dgvCarTextList.Rows[0].Cells[this.dgvCarTextList.FirstDisplayedCell.ColumnIndex]; this.dgvCarTextList.FirstDisplayedScrollingRowIndex = 0; this.dgvCarTextList.EndEdit(); this.dgvCarTextList.Refresh(); } catch (Exception exception) { Record.execFileRecord("文本位置->异步处理完成事件", exception.Message); } finally { WaitForm.Hide(); } }
private void btnRefresh_Click(object sender, EventArgs e) { try { this.btnRefresh.Enabled = false; MainForm.myMap.execStopPlayTrackLine(this.sQueryTypeValue); this.iCurrentCnt = 0; this.bRefresh = true; this.cboxSelectedAll.Checked = false; WaitForm.Show("正在刷新文本信息...", this); this.BindCarTextList(); this.refleshData(); this.lblDGVRowCount.Text = string.Format("总共 {0} 条记录", this.source.List.Count.ToString()); } catch { } finally { this.btnRefresh.Enabled = true; WaitForm.Hide(); } }
private void CarTextList_Load(object sender, EventArgs e) { try { this.dgvCarTextList.AutoGenerateColumns = false; this.initClomun(); this.initDataTable(); this.doWorker(); MainForm.myMap.execStopPlayTrackLine(this.sQueryTypeValue); this.tGetQueryTrackInfo = new System.Timers.Timer(2000.0); this.tGetQueryTrackInfo.Elapsed += new ElapsedEventHandler(this.tGetQueryTrackInfo_Elapsed); this.tGetQueryTrackInfo.Enabled = true; this.myGetTrackQueryInfo = new dGetTrackQueryInfo(this.getAddress); } catch (Exception exception) { Record.execFileRecord("文本界面->初期化", exception.ToString()); } finally { WaitForm.Hide(); } }
private void setText(object sender, ProgressChangedEventArgs e) { string str = e.UserState.ToString(); string str2 = "6"; if (Variable.sShippingEnable.Equals("1")) { str2 = "7"; } switch (str) { case "-100": WaitForm.Hide(); base.Close(); return; case "-1": this.m_iLoginCnt++; if (this.m_iLoginCnt >= 3) { MessageBox.Show("超过最大登录次数,系统退出!"); Record.execFileRecord("用户登录", "超过最大登录次数,系统退出!"); base.Close(); } this.pbPicWait.Visible = false; this.lblWaitText.Visible = false; WaitForm.Hide(); this.btnOK.Enabled = true; this.btnSetParam.Enabled = true; this.btnChangePwd.Enabled = true; this.btnCancel.Enabled = true; this.txtPassword.Enabled = true; this.txtUser.Enabled = true; this.txtAdc.Enabled = true; this.txtValidateCode.Enabled = true; this.btnSendValidateCode.Enabled = this.iCurrentCountDown <= 0; return; case "0": this.lblWaitText.Text = string.Format("1/{0} 正在验证用户信息,请稍候...", str2); return; case "1": this.lblWaitText.Text = string.Format("2/{0} 正在进行授权验证,请稍候...", str2); return; case "2": this.lblWaitText.Text = string.Format("3/{0} 正在下载报警列表,请稍候...", str2); return; case "3": this.lblWaitText.Text = string.Format("4/{0} 正在下载区域列表,请稍候...", str2); return; case "4": this.lblWaitText.Text = string.Format("5/{0} 正在下载车辆列表,请稍候...", str2); return; case "5": this.lblWaitText.Text = string.Format("{0}/{0} 正在创建车辆列表,请稍候...", str2); return; case "6": this.lblWaitText.Text = string.Format("6/{0} 正在下载运单列表,请稍候...", str2); return; } }
private void excelWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { WaitForm.Hide(); }
private void WebSystem_Click(object sender, HtmlElementEventArgs e) { this._main.LoadWebSystem.Set(); WaitForm.Hide(); }