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

📄 pda_start.cs

📁 windows mobile 2005 上可以运行的资产管理系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;


namespace PDA_test
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class PDA_start : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1;
		private System.Data.SqlClient.SqlConnection sql_conn;
		private System.Data.SqlClient.SqlDataAdapter sql_da;
		private System.Data.SqlClient.SqlCommandBuilder sql_cb;
		private System.Data.SqlClient.SqlCommand sql_cmd;
		private System.Data.SqlClient.SqlDataReader sql_dr;
		private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox textBox_ch;
		private System.Windows.Forms.TextBox textBox_tm;
		private System.Data.DataTable data_test;
		private PDA_test.SY_HSXC lc_syhscx; 
		private PDA_test.JZ_HSXC lc_jzhsxc;
		

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

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			base.Dispose( disposing );
		}
		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.button1 = new System.Windows.Forms.Button();
			this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
			this.textBox_ch = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.textBox_tm = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(72, 160);
			this.button1.Size = new System.Drawing.Size(96, 32);
			this.button1.Text = "查询";
			this.button1.Click += new System.EventHandler(this.button1_Click_1);
			// 
			// dataGridTextBoxColumn1
			// 
			this.dataGridTextBoxColumn1.NullText = "(null)";
			this.dataGridTextBoxColumn1.Width = 80;
			// 
			// textBox_ch
			// 
			this.textBox_ch.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular);
			this.textBox_ch.Location = new System.Drawing.Point(24, 104);
			this.textBox_ch.Size = new System.Drawing.Size(192, 23);
			this.textBox_ch.Text = "";
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular);
			this.label1.Location = new System.Drawing.Point(24, 80);
			this.label1.Text = "门诊号";
			this.label1.ParentChanged += new System.EventHandler(this.label1_ParentChanged);
			// 
			// textBox_tm
			// 
			this.textBox_tm.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular);
			this.textBox_tm.Location = new System.Drawing.Point(24, 40);
			this.textBox_tm.Size = new System.Drawing.Size(192, 23);
			this.textBox_tm.Text = "";
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular);
			this.label2.Location = new System.Drawing.Point(24, 16);
			this.label2.Text = "条形码";
			// 
			// PDA_start
			// 
			this.ClientSize = new System.Drawing.Size(234, 256);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.textBox_tm);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.textBox_ch);
			this.Controls.Add(this.button1);
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Text = "移动工作站";
			this.Load += new System.EventHandler(this.PDA_start_Load);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>

//		static void Main() 
//		{
//			Application.Run(new PDA_start());
//		}

		private void PDA_start_Load(object sender, System.EventArgs e)
		{
			
		string connSql="data source=172.16.10.19;user id=sa;password=1;initial catalog=FGYPDB";
			//string connSql="workstation id=FGSOFT\\FGHIS;packet size=4096;user id=sa;data source=FGSOFT\\FGHIS;persist security info=True;initial catalog=BGFGMZDB;password=";

			//;persist security info=True;packet size=4096
			try 
			{
//				sql_da = new SqlDataAdapter();
//				SqlCommandBuilder sql_cb=new SqlCommandBuilder ();
//				data_test=new DataTable();
				sql_conn = new SqlConnection( connSql );	
//				MessageBox.Show(sql_conn.ConnectionString.ToString());
//				this.sql_conn.Open();
//				this.sql_conn.Close();

			}
			catch (SqlException ex) 
			{
				MessageBox.Show( "Error connecting to the server: " + ex.Message );
			}
//			string connSql="workstation id=FUGLETEST;packet size=4096;user id=sa;data source=FUGLETEST;persist security info=True;initial catalog=Northwind;password=";
//			try 
//			{71009.94 62840.64 4.08465
//				sqlda = new SqlDataAdapter();
//				SqlCommandBuilder sqlcb=new SqlCommandBuilder ();
//				data_test=new DataTable();
//				lcsqlconn = new SqlConnection( connSql );
//
//				lcsqlconn.Open();
//				sqlda =new SqlDataAdapter("select * from EmployeeTerritories", lcsqlconn );
//				sqlcb =new SqlCommandBuilder( sqlda );
//				
//				//sqlda	( data_test );
//				
//				//this.dataGrid1.DataSource=data_test;
//				
//			}
//			catch (SqlException ex) 
//			{
//				MessageBox.Show( "Error connecting to the server: " + ex.Message );
//			}
		}

	

		

		private void button1_Click_1(object sender, System.EventArgs e)
		{
			
//			//string m_connectionString="workstation id=FUGLETEST;packet size=4096;user id=sa;data source=FUGLETEST;persist security info=True;initial catalog=Northwind;password=";
//			fugletest.Service1 service = new PDA_test.fugletest.Service1();
//						
//			service.SetDatabaseType("SQL Server");
//
//			service.SetDbConnectionString("");
//
//			service.Create();
//
//			DataSet ds = service.ExecuteDataSet("select * from EmployeeTerritories");
//
//			dataGrid1.DataSource = ds.Tables[0]; 


				//	床位信息查询
//						try 
//						{	
//							data_test=new DataTable();
//							string lc_cwh=this.textBox_ch.Text.ToString().Trim();
//							string lc_mzh="";
//							string lc_name="";
//
//							string lc_sql_cmd="select * from dbo.输液_输液登记表 where 床位号='"+lc_cwh+"' and 状态='2'";
//							sql_conn.Open();
//							sql_da =new SqlDataAdapter(lc_sql_cmd, sql_conn );
//							sql_cb =new SqlCommandBuilder( sql_da );
//							sql_da.Fill(data_test);						
//							//this.dataGrid1.DataSource=data_test;
//							int lc_rowcount=data_test.Rows.Count;
//							if (lc_rowcount==0)
//							{
//								MessageBox.Show("床位号码输入有误!!");
//							}
//							else
//							{
//                                string lc_cwzt=this.data_test.Rows[0]["状态"].ToString().Trim();
//								if (lc_cwzt=="2")
//								{
//									lc_mzh=this.data_test.Rows[0]["门诊号"].ToString().Trim();
//									lc_name=this.data_test.Rows[0]["姓名"].ToString().Trim();
//									//MessageBox.Show(lc_mzh.ToString()+"  "+lc_name.ToString());
//									//调用SY_HSXC界面
//									lc_syhscx=new SY_HSXC();
//									lc_syhscx.cf_no="18247";
//									lc_syhscx.br_jbxx=lc_mzh+","+lc_name;
//									lc_syhscx.mzh=lc_mzh.ToString().Trim();
//									lc_syhscx.ch=lc_cwh.ToString().Trim();
//									lc_syhscx.Sql_conn_str=this.sql_conn;
//									lc_syhscx.Show();
//
//									//
//								}
//								else
//								{
//									MessageBox.Show("该床位没有开放!");
//								}
//							}
//							
//							
//							sql_conn.Close();
//						}
//						catch (SqlException ex) 
//						{
//							MessageBox.Show( "Error connecting to the server: " + ex.Message );
//						}
				//床位信息查询结束

			//发票号码查询
			//MessageBox.Show(sql_conn.ConnectionString.ToString());
								try
									{	
										data_test=new DataTable();
										sql_cmd=new SqlCommand();
										sql_cmd.Connection=sql_conn;
										//string lc_mzh=this.textBox_ch.Text.ToString().Trim();
										string lc_mzh=this.textBox_ch.Text.ToString().Trim();
										string lc_name="";
										string lc_sex="";
										string lc_age="";
										string lc_jzdm="";
										string lc_sqlcmd="";
										int lcret=0;
			
									//	string lc_sql_cmd="select * from 治疗_任务记录 where 门诊编号='"+lc_cwh+"' and 状态='0'";
										string lc_sql_cmd="select 姓名,性别,出生日期,记帐代码 from  FGMZDB..门诊_病人基本信息 where 门诊号='"+lc_mzh+"'";
										sql_conn.Open();
										sql_da =new SqlDataAdapter(lc_sql_cmd, sql_conn );
										sql_cb =new SqlCommandBuilder( sql_da );
										sql_da.Fill(data_test);	
										sql_conn.Close();
										//this.dataGrid1.DataSource=data_test;
										int lc_rowcount=data_test.Rows.Count;
										if (lc_rowcount==0)
										{
											MessageBox.Show("门诊号有误!!");
										}
										else
										{
											
			                               //		lc_mzh=this.data_test.Rows[0]["门诊号"].ToString().Trim();
											lc_sqlcmd="exec pda_check_mzfph  '"+lc_mzh+"'";
											this.sql_conn.Open();
											//MessageBox.Show(up_cmd.ToString());
				
											sql_cmd.CommandText=lc_sqlcmd.ToString();
											lcret=sql_cmd.ExecuteNonQuery();
											this.sql_conn.Close();
											//MessageBox.Show(lcret.ToString());
												lc_name=this.data_test.Rows[0]["姓名"].ToString().Trim();
												lc_sex=this.data_test.Rows[0]["性别"].ToString().Trim();
												lc_age=this.data_test.Rows[0]["出生日期"].ToString().Trim();
												lc_jzdm=this.data_test.Rows[0]["记帐代码"].ToString().Trim();
												
												//MessageBox.Show(lc_mzh.ToString()+"  "+lc_name.ToString());
												//调用SY_HSXC界面
//												lc_jzhsxc=new JZ_HSXC();
//												lc_jzhsxc.br_jbxx=lc_name+","+lc_sex+","+lc_age;
//												lc_jzhsxc.mzh=lc_mzh;
//												lc_jzhsxc.Sql_conn_str=this.sql_conn;
//											    
//												//												lc_syhscx.cf_no="18247";
//												//												lc_syhscx.br_jbxx=lc_mzh+","+lc_name;
//												//												lc_syhscx.mzh=lc_mzh.ToString().Trim();
//												//												lc_syhscx.ch=lc_cwh.ToString().Trim();
//												//												lc_syhscx.Sql_conn_str=this.sql_conn;
//												lc_jzhsxc.Show();
											
											
											//MessageBox.Show(lc_mzh.ToString()+"数据读写错误----001!!!"+lcret.ToString());
											
										}
										
										
										//sql_conn.Close();
									}
									catch (SqlException ex) 
									{
										MessageBox.Show( "Error connecting to the server: " + ex.Message );
									}

			//发票号码结束

		}

		private void label1_ParentChanged(object sender, System.EventArgs e)
		{
		
		}

		private void button3_Click(object sender, System.EventArgs e)
		{
		
		}

	

	

	}
}

⌨️ 快捷键说明

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