123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using DevExpress.XtraEditors;
- using Uninpho.DBOperation.Model;
- using System.IO;
- using Uninpho.DBOperation.Operation;
- using System.Text.RegularExpressions;
- using System.Reflection;
- using Uninpho.Tools.components.DWForm;
- using Uninpho.Tools.components.DataAnalysis;
- using DevExpress.XtraGrid.Views.Grid;
- namespace Uninpho.Tools.components.DWForm
- {
- public partial class ImportGLdatamanageForm : DevExpress.XtraEditors.XtraForm
- {
-
- GridView grid;
- string lx;
- public ImportGLdatamanageForm(GridView GV,string type)
- {
- InitializeComponent();
-
- grid = GV;
- lx = type;
- }
-
- /// 浏览文件目录
- private void simpleButton2_Click(object sender, EventArgs e)
- {
- if (xianlumingText.Text==""||zhanmingText.Text=="")
- {
- XtraMessageBox.Show("请选择线路和车站", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
- }
- else
- {
- if (lx == "gl")
- {
- DWCommon.OpenFile("txt", grid, xianlumingText.Text, zhanmingText.Text);
- txtindir.Text = DWCommon.lj;
- }
- else if (lx == "qk")
- {
- DWQKCommon.OpenFile("txt", grid, xianlumingText.Text, zhanmingText.Text);
- txtindir.Text = DWQKCommon.lj;
- }
- }
-
- }
- /// 导入数据
- private void newCreateBtnSon_Click(object sender, EventArgs e)
- {
- if (lx == "gl")
- {
- DWCommon.AddFile();
- }
- else if (lx == "qk")
- {
- DWQKCommon.AddFile();
- }
- this.Close();
- }
- ///取消
- private void NewcancelBtn_Click(object sender, EventArgs e)
- {
- if (lx == "gl")
- {
- DWCommon.CancelAddFile();
- }
- else if (lx == "qk")
- {
- DWQKCommon.CancelAddFile();
- }
-
- this.Close();
- }
- ///关联数据库
-
- private void xianlumingText_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- ///初始界面加载
- ///
- List<T_daocha_account> daochaData = new List<T_daocha_account>();
- private void ImportGLdatamanageForm_Load(object sender, EventArgs e)
- {
- daochaData = DBOperation.Operation.DataAnalysisToPG.QueryDCTZALL();
- //整理线路名集合
- var listtgXLMALL = daochaData.GroupBy(c => c.Xlm).Select(c => c.First()).ToList();
- foreach (var item in listtgXLMALL)
- {
- xianlumingText.Properties.Items.Add(item.Xlm);
- }
- }
- ///线路名下拉选择
- private void xianlumingText_EditValueChanged(object sender, EventArgs e)
- {
- zhanmingText.Properties.Items.Clear();
- var isInputTrueXLM = daochaData.FindAll(delegate (T_daocha_account dc)
- {
- return dc.Xlm == xianlumingText.Text;
- });
- //线路名
- if (isInputTrueXLM.Count != 0)
- {
- var listtg = isInputTrueXLM.GroupBy(c => c.Czm).Select(c => c.First()).ToList();
- foreach (var item in listtg)
- {
- zhanmingText.Properties.Items.Add(item.Czm);
- }
- zhanmingText.Enabled = true;
- }
- else
- {
- zhanmingText.Enabled = false;
- }
- zhanmingText.Text = "";
- }
-
- }
- }
|