private void ShowLoginingTopForm(object sValue) { try { WaitForm waitForm = new WaitForm() { Text = string.Concat(Variable.sTitle, Variable.sVersion) }; waitForm.seSkin.SkinFile = Variable.sSkinFiles[Convert.ToInt32(Variable.sSkinDataIndex)]; waitForm.Show(); while (this.bShow) { waitForm.lblText.Text = WaitForm.sText; Thread.Sleep(100); waitForm.TopMost = true; Application.DoEvents(); } waitForm.Close(); waitForm = null; } catch (ThreadAbortException threadAbortException) { Thread.Sleep(300); Thread.ResetAbort(); } catch (Exception exception) { Record.execFileRecord("ShowLoginingTopForm", exception.Message); } }
private void doWorker() { if (this.dtText.Rows.Count == 0) { this.iNodeCnt = MainForm.myCarList.tvList.hasCarPath.Count; } else { this.iNodeCnt = this.dtText.Rows.Count; } WaitForm.Show("正在生成文本信息...", this); if (this.dgvCarTextList.DataSource != null) { this.dtText.Rows.Clear(); } if (worker == null) { try { worker = new BackgroundWorker(); worker.DoWork += new DoWorkEventHandler(this.worder_DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.worder_RunWorkerCompleted); worker.ProgressChanged += new ProgressChangedEventHandler(this.worker_ProgressChanged); worker.WorkerReportsProgress = true; worker.RunWorkerAsync(); } catch (Exception exception) { Record.execFileRecord("文本位置->异步加载", exception.Message); } } }
private void btnOk_Clicked(object Ol111O, EventArgs O) { if (this.FilterData()) { string format = "delete from GpsPathRegionShowInfo where UserId = '{0}' and Type = '{2}';insert into GpsPathRegionShowInfo(UserId, Type, DotValue) values('{0}', '{2}', '{1}') "; //执行Sql,删除旧配置,添加新配置 if (RemotingClient.ExecNoQuery(string.Format(format, Variable.sUserId, this.sLines, this.pathType)).ResultCode != 0L) { MessageBox.Show("参数保存数据库错误,请重新尝试。"); } else { //显示线路 if (this.pathType == 1) { WaitForm.Show("正在更新地图路线信息,请稍候...", this); MainForm.myMap.showPathMap(this.gisMap); } //显示区域 else { WaitForm.Show("正在更新地图区域信息,请稍候...", this); MainForm.myMap.showRegionMap(this.gisMap); } base.DialogResult = DialogResult.OK; } } }
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 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 doWorker() { WaitForm.Show("正在加载车辆信息...", this); if (this.worker == null) { try { this.worker = new BackgroundWorker(); this.worker.DoWork += new DoWorkEventHandler(this.worder_DoWork); this.worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.worder_RunWorkerCompleted); this.worker.ProgressChanged += new ProgressChangedEventHandler(this.worker_ProgressChanged); this.worker.WorkerReportsProgress = true; this.worker.RunWorkerAsync(); } catch (Exception exception) { Record.execFileRecord("多路图像查询->异步加载", exception.Message); } } }
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 getCarFormParam() { this.setCarValue(); try { if (base.Controls.Count > 2) { if (this.myWorker == null) { this.myWorker = new BackgroundWorker(); this.myWorker.DoWork += new DoWorkEventHandler(this.myWorker_DoWork); this.myWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.myWorker_RunWorkerCompleted); } WaitForm.Show("正在初始化参数,请稍候...", this); this.setControlEnable(false); this.myWorker.RunWorkerAsync(); } } catch (Exception exception) { Record.execFileRecord("取得界面参数异步", exception.Message); } }
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 ShowLoginingTopForm(object sValue) { try { WaitForm waitForm = new WaitForm() { Text = string.Concat(Variable.sTitle, Variable.sVersion) }; waitForm.seSkin.SkinFile = Variable.sSkinFiles[Convert.ToInt32(Variable.sSkinDataIndex)]; waitForm.Show(); while (this.bShow) { waitForm.lblText.Text = WaitForm.sText; Thread.Sleep(100); waitForm.TopMost = true; Application.DoEvents(); } waitForm.Close(); waitForm = null; } catch (ThreadAbortException threadAbortException) { Thread.Sleep(300); Thread.ResetAbort(); } catch (Exception exception) { Record.execFileRecord("ShowLoginingTopForm", exception.Message); } }