⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zkshow.cs

📁 煤矿信息管理系统是基于SuperMap Object
💻 CS
📖 第 1 页 / 共 4 页
字号:
			this.label1.TabIndex = 18;
			this.label1.Text = "钻孔编号";
			// 
			// txt_No
			// 
			this.txt_No.Location = new System.Drawing.Point(80, 23);
			this.txt_No.Name = "txt_No";
			this.txt_No.ReadOnly = true;
			this.txt_No.Size = new System.Drawing.Size(114, 21);
			this.txt_No.TabIndex = 27;
			this.txt_No.Text = "";
			// 
			// txt_lay
			// 
			this.txt_lay.Location = new System.Drawing.Point(264, 48);
			this.txt_lay.Name = "txt_lay";
			this.txt_lay.Size = new System.Drawing.Size(128, 21);
			this.txt_lay.TabIndex = 30;
			this.txt_lay.Text = "";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(208, 54);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(56, 16);
			this.label5.TabIndex = 22;
			this.label5.Text = "终孔层位";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(14, 53);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(66, 17);
			this.label7.TabIndex = 24;
			this.label7.Text = "孔口坐标X";
			// 
			// toolBarButton_xiao
			// 
			this.toolBarButton_xiao.ImageIndex = 1;
			this.toolBarButton_xiao.ToolTipText = "缩小";
			// 
			// toolBarButton_da
			// 
			this.toolBarButton_da.ImageIndex = 0;
			this.toolBarButton_da.ToolTipText = "放大";
			// 
			// toolBarButton_pan
			// 
			this.toolBarButton_pan.ImageIndex = 2;
			this.toolBarButton_pan.ToolTipText = "平移";
			// 
			// imageList_tool
			// 
			this.imageList_tool.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList_tool.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList_tool.ImageStream")));
			this.imageList_tool.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// groupBox_ceng
			// 
			this.groupBox_ceng.Controls.Add(this.dataGrid_lay);
			this.groupBox_ceng.Location = new System.Drawing.Point(8, 200);
			this.groupBox_ceng.Name = "groupBox_ceng";
			this.groupBox_ceng.Size = new System.Drawing.Size(408, 192);
			this.groupBox_ceng.TabIndex = 5;
			this.groupBox_ceng.TabStop = false;
			this.groupBox_ceng.Text = "钻孔煤层信息";
			// 
			// dataGrid_lay
			// 
			this.dataGrid_lay.AlternatingBackColor = System.Drawing.SystemColors.Info;
			this.dataGrid_lay.CaptionText = "F  ";
			this.dataGrid_lay.CaptionVisible = false;
			this.dataGrid_lay.DataMember = "";
			this.dataGrid_lay.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dataGrid_lay.FlatMode = true;
			this.dataGrid_lay.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None;
			this.dataGrid_lay.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid_lay.Location = new System.Drawing.Point(3, 17);
			this.dataGrid_lay.Name = "dataGrid_lay";
			this.dataGrid_lay.Size = new System.Drawing.Size(402, 172);
			this.dataGrid_lay.TabIndex = 0;
			// 
			// toolBarButton_full
			// 
			this.toolBarButton_full.ImageIndex = 3;
			this.toolBarButton_full.ToolTipText = "全屏";
			// 
			// groupBox_pou
			// 
			this.groupBox_pou.Controls.Add(this.axSuperMap1);
			this.groupBox_pou.Controls.Add(this.panel1);
			this.groupBox_pou.Controls.Add(this.axSuperWorkspace1);
			this.groupBox_pou.Location = new System.Drawing.Point(420, 8);
			this.groupBox_pou.Name = "groupBox_pou";
			this.groupBox_pou.Size = new System.Drawing.Size(320, 409);
			this.groupBox_pou.TabIndex = 6;
			this.groupBox_pou.TabStop = false;
			this.groupBox_pou.Text = "钻孔剖面示意图";
			// 
			// axSuperMap1
			// 
			this.axSuperMap1.ContainingControl = this;
			this.axSuperMap1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.axSuperMap1.Enabled = true;
			this.axSuperMap1.Location = new System.Drawing.Point(3, 48);
			this.axSuperMap1.Name = "axSuperMap1";
			this.axSuperMap1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSuperMap1.OcxState")));
			this.axSuperMap1.Size = new System.Drawing.Size(314, 358);
			this.axSuperMap1.TabIndex = 1;
			this.axSuperMap1.MouseWheelEvent += new AxSuperMapLib._DSuperMapEvents_MouseWheelEventHandler(this.axSuperMap1_MouseWheelEvent);
			// 
			// panel1
			// 
			this.panel1.Controls.Add(this.toolBar_tool);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
			this.panel1.Location = new System.Drawing.Point(3, 17);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(314, 31);
			this.panel1.TabIndex = 3;
			// 
			// toolBar_tool
			// 
			this.toolBar_tool.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.toolBar_tool.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.toolBar_tool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																							this.toolBarButton_da,
																							this.toolBarButton_xiao,
																							this.toolBarButton_pan,
																							this.toolBarButton_full});
			this.toolBar_tool.ButtonSize = new System.Drawing.Size(16, 16);
			this.toolBar_tool.DropDownArrows = true;
			this.toolBar_tool.ImageList = this.imageList_tool;
			this.toolBar_tool.Location = new System.Drawing.Point(0, 0);
			this.toolBar_tool.Name = "toolBar_tool";
			this.toolBar_tool.ShowToolTips = true;
			this.toolBar_tool.Size = new System.Drawing.Size(314, 29);
			this.toolBar_tool.TabIndex = 2;
			this.toolBar_tool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_tool_ButtonClick);
			// 
			// axSuperWorkspace1
			// 
			this.axSuperWorkspace1.ContainingControl = this;
			this.axSuperWorkspace1.Enabled = true;
			this.axSuperWorkspace1.Location = new System.Drawing.Point(64, 128);
			this.axSuperWorkspace1.Name = "axSuperWorkspace1";
			this.axSuperWorkspace1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSuperWorkspace1.OcxState")));
			this.axSuperWorkspace1.Size = new System.Drawing.Size(32, 32);
			this.axSuperWorkspace1.TabIndex = 4;
			// 
			// btn_ok
			// 
			this.btn_ok.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btn_ok.Location = new System.Drawing.Point(337, 396);
			this.btn_ok.Name = "btn_ok";
			this.btn_ok.Size = new System.Drawing.Size(71, 25);
			this.btn_ok.TabIndex = 7;
			this.btn_ok.Text = "提交修改";
			this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
			// 
			// label10
			// 
			this.label10.Location = new System.Drawing.Point(8, 403);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(328, 23);
			this.label10.TabIndex = 8;
			this.label10.Text = "系统提示:如果您修改了有关数据,请单击右边的按钮提交";
			// 
			// ZKShow
			// 
			this.AcceptButton = this.btn_ok;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(746, 421);
			this.Controls.Add(this.label10);
			this.Controls.Add(this.btn_ok);
			this.Controls.Add(this.groupBox_kong);
			this.Controls.Add(this.groupBox_ceng);
			this.Controls.Add(this.groupBox_pou);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "ZKShow";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "钻孔详细信息";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.ZKShow_Closing);
			this.Load += new System.EventHandler(this.ZKShow_Load);
			this.groupBox_kong.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown_h)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown_z)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown_y)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown_x)).EndInit();
			this.groupBox_ceng.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid_lay)).EndInit();
			this.groupBox_pou.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.axSuperMap1)).EndInit();
			this.panel1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.axSuperWorkspace1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void ZKShow_Load(object sender, System.EventArgs e)
		{
			if(App.u_flag!=(int)flag.admin)
			{
				user_admin();
			}
			get_fill_file();
		 	get_kong_info(k_id);
			get_ceng_info(k_id);
			Draw_lay(Ceng_DataSet);
			theme();
			this.axSuperMap1.ViewEntire();
			this.axSuperMap1.CtlRefresh();
		}


		private void toolBar_tool_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			switch(this.toolBar_tool.Buttons.IndexOf(e.Button))
			{
				case 0:
					this.axSuperMap1.Action = SuperMapLib.seAction.scaZoomIn;
					break;
				case 1:
					this.axSuperMap1.Action = SuperMapLib.seAction.scaZoomOut;
					break;
				case 2:
					this.axSuperMap1.Action = SuperMapLib.seAction.scaPan;
					break;
				case 3:
					this.axSuperMap1.ViewEntire();;
					break;
			}
		}


		private void axSuperMap1_MouseWheelEvent(object sender, AxSuperMapLib._DSuperMapEvents_MouseWheelEvent e)
		{
			if((int)e.zDelta > 0 )
			{
				this.axSuperMap1.Zoom(1.2);
				this.axSuperMap1.CtlRefresh();
			}
			else
			{
				this.axSuperMap1.Zoom(0.8);
				this.axSuperMap1.CtlRefresh();
			}
		}


		private void ZKShow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			this.axSuperMap1.Disconnect();
			this.axSuperWorkspace1.Close();
		}


		private void btn_ok_Click(object sender, System.EventArgs e)
		{
			get_value();//先得到需要的信息
			if(kong_change() && lay_change())
			{
				MessageBox.Show("钻孔信息修改成功!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		#region 根据传递过来的钻孔编号得到钻孔的基本信息
		/// <summary>
		/// 得到钻孔的基本信息
		/// </summary>
		/// <param name="k_id">钻孔的文字标号</param>
		private void get_kong_info(string k_id)
		{
			DataBase myDB = new DataBase();
			SqlDataReader myReader;
			SqlParameter[] myParamers={new SqlParameter("@k_id",SqlDbType.Char,10)} ;
			myParamers[0].Value = k_id;
			myReader = myDB.RunProcedure("up_get_kong_info",myParamers);
			if(myReader!=null)
			{
				//开始填充相关地图  
				if(myReader.HasRows == true)
				{   
					myReader.Read();
					this.kong_id = Convert.ToInt32(myReader["序号"]);
					this.txt_other.Text = myReader["备注"].ToString().Trim();
					this.txt_No.Text = myReader["钻孔编号"].ToString().Trim();
					this.txt_lay.Text = myReader["终孔层位"].ToString().Trim();
					this.txt_com.Text = myReader["施工单位"].ToString().Trim();
					this.numericUpDown_x.Value = Convert.ToDecimal(myReader["孔口X坐标"]);
					this.numericUpDown_y.Value = Convert.ToDecimal(myReader["孔口Y坐标"]);
					this.numericUpDown_z.Value = Convert.ToDecimal(myReader["孔口Z坐标"]);
					this.numericUpDown_h.Value = Convert.ToDecimal(myReader["终孔深度"]);
					this.dateTimePicker_data.Value = (DateTime)myReader["施工时间"];
					myReader.Close();
				}
				else
				{
					MessageBox.Show("没有该钻孔的相关信息","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Warning);
				}
			}
		}


		/// <summary>
		/// 显示相关钻孔的煤层信息,填充datagrid
		/// </summary>
		/// <param name="k_id"></param>
		private void get_ceng_info(string k_id)
		{
			DataBase myDB = new DataBase();
			Ceng_DataSet = new DataSet();
			SqlParameter[] myParamers={new SqlParameter("@k_id",SqlDbType.Char,10)} ;
			myParamers[0].Value = k_id;
			Ceng_DataSet = myDB.RunProcedure("up_get_ceng_info",myParamers,"cenginfo");
			if(Ceng_DataSet!=null)
			{
				this.Ceng_DataSet.Tables[0].Columns["钻孔序号"].DefaultValue = this.kong_id;
				addstyle(Ceng_DataSet);
				this.dataGrid_lay.SetDataBinding(Ceng_DataSet,"cenginfo");
			}		
			else
			{
				MessageBox.Show("没有该钻孔的相关信息");
			}
		}


		/// <summary>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -