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

📄 selectselfcompany.cs

📁 机械制造业信息管理系统(含源码) 是为一个粮仪厂开发的
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using System.Data;
using System.Data.OleDb;

namespace Eboer.MIS.MF.WinForm
{
	/// <summary>
	/// SelectSelfCompany 的摘要说明。
	/// </summary>
	public class SelectSelfCompany : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.ComboBox corp;
		private System.Windows.Forms.Button button1;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public SelectSelfCompany()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			this.LoadSelfCorp();
		}

		/// <summary>
		/// 本单位
		/// </summary>
		private void LoadSelfCorp(){
			try{
				string sql = "select * from CorpColl where comType = 'SELF'";
				OleDbDataAdapter ad = new OleDbDataAdapter(sql,Public.conn);
				DataSet ds  = new DataSet();
				ad.Fill(ds,"corp");
				for(int i=0;i<ds.Tables[0].Rows.Count;i++){
					DataRow row = ds.Tables[0].Rows[i];
					this.corp.Items.Add(row["corName"].ToString() + "("+ row["sign"].ToString() +")");

					if(Public.currentSelfCorp.Equals(row["sign"].ToString())){
						this.corp.Text = row["corName"].ToString() + "("+ row["sign"].ToString() +")";
					}
				}
			}catch(Exception ex){
				MessageBox.Show(ex.Message.ToString());
				//
			}
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.corp = new System.Windows.Forms.ComboBox();
			this.button1 = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.corp);
			this.groupBox1.Location = new System.Drawing.Point(8, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(368, 48);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			// 
			// corp
			// 
			this.corp.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.corp.Location = new System.Drawing.Point(8, 16);
			this.corp.Name = "corp";
			this.corp.Size = new System.Drawing.Size(352, 20);
			this.corp.TabIndex = 0;
			this.corp.SelectedIndexChanged += new System.EventHandler(this.corp_SelectedIndexChanged);
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(296, 64);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(80, 23);
			this.button1.TabIndex = 1;
			this.button1.Text = "确 定";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// SelectSelfCompany
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(386, 95);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "SelectSelfCompany";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "请选择一个单位";
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		///选择后
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void corp_SelectedIndexChanged(object sender, System.EventArgs e) {
			//
		}

		/// <summary>
		/// 选好
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void button1_Click(object sender, System.EventArgs e) {
			Public.currentSelfCorp = Public.CutCorString(this.corp.Text,1);
			this.Close();
		}
	}
}

⌨️ 快捷键说明

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