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

📄 jinhuoxinxi.h

📁 采用VC++.net做的超市收银管理系统
💻 H
字号:
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace ruanjian
{
	/// <summary> 
	/// jinhuoxinxi 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class jinhuoxinxi : public System::Windows::Forms::Form
	{
	public: 
		jinhuoxinxi(void)
		{
			InitializeComponent();
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::Label *  label1;
	private: System::Data::OleDb::OleDbCommand *  oleDbSelectCommand1;
	private: System::Data::OleDb::OleDbConnection *  oleDbConnection1;
	private: System::Data::OleDb::OleDbCommand *  oleDbUpdateCommand1;
	private: System::Windows::Forms::Label *  label2;
	private: System::Data::OleDb::OleDbCommand *  oleDbDeleteCommand1;
	private: System::Data::OleDb::OleDbDataAdapter *  oleDbDataAdapter1;
	private: System::Data::OleDb::OleDbCommand *  oleDbInsertCommand1;
	private: System::Windows::Forms::Label *  label3;
	private: System::Windows::Forms::TextBox *  textBox2;
	private: System::Windows::Forms::DataGrid *  dataGrid1;
	private: System::Windows::Forms::Button *  button2;
	private: System::Windows::Forms::Label *  label7;
	private: System::Windows::Forms::Button *  button1;
	private: System::Windows::Forms::TextBox *  textBox1;

	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		System::ComponentModel::Container* components;

		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		void InitializeComponent(void)
		{
			this->label1 = new System::Windows::Forms::Label();
			this->oleDbSelectCommand1 = new System::Data::OleDb::OleDbCommand();
			this->oleDbConnection1 = new System::Data::OleDb::OleDbConnection();
			this->oleDbUpdateCommand1 = new System::Data::OleDb::OleDbCommand();
			this->label2 = new System::Windows::Forms::Label();
			this->oleDbDeleteCommand1 = new System::Data::OleDb::OleDbCommand();
			this->oleDbDataAdapter1 = new System::Data::OleDb::OleDbDataAdapter();
			this->oleDbInsertCommand1 = new System::Data::OleDb::OleDbCommand();
			this->label3 = new System::Windows::Forms::Label();
			this->textBox2 = new System::Windows::Forms::TextBox();
			this->dataGrid1 = new System::Windows::Forms::DataGrid();
			this->button2 = new System::Windows::Forms::Button();
			this->label7 = new System::Windows::Forms::Label();
			this->button1 = new System::Windows::Forms::Button();
			this->textBox1 = new System::Windows::Forms::TextBox();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dataGrid1))->BeginInit();
			this->SuspendLayout();
			// 
			// label1
			// 
			this->label1->Font = new System::Drawing::Font(S"宋体", 10.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
			this->label1->Location = System::Drawing::Point(32, 8);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(80, 23);
			this->label1->TabIndex = 43;
			this->label1->Text = S"进货信息:";
			this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
			// 
			// oleDbSelectCommand1
			// 
			this->oleDbSelectCommand1->CommandText = S"SELECT IID, INAME, IPROFUCER, ISTOCKPRICE, DATES FROM 进货表";
			this->oleDbSelectCommand1->Connection = this->oleDbConnection1;
			// 
			// oleDbConnection1
			// 
			this->oleDbConnection1->ConnectionString = S"Integrated Security=SSPI;Packet Size=4096;Data Source=4B2E371A2A9F47E;Tag with co" 
				S"lumn collation when possible=False;Initial Catalog=超市收银数据库;Use Procedure for Pre" 
				S"pare=1;Auto Translate=True;Persist Security Info=False;Provider=\"SQLOLEDB.1\";Wor" 
				S"kstation ID=4B2E371A2A9F47E;Use Encryption for Data=False";
			// 
			// oleDbUpdateCommand1
			// 
			this->oleDbUpdateCommand1->CommandText = S"UPDATE 进货表 SET IID = \?, INAME = \?, IPROFUCER = \?, ISTOCKPRICE = \?, DATES = \? WHER" 
				S"E (IID = \?)";
			this->oleDbUpdateCommand1->Connection = this->oleDbConnection1;
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"IID", System::Data::OleDb::OleDbType::VarChar, 10, S"IID"));
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"INAME", System::Data::OleDb::OleDbType::VarChar, 20, S"INAME"));
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"IPROFUCER", System::Data::OleDb::OleDbType::VarChar, 20, S"IPROFUCER"));
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"ISTOCKPRICE", System::Data::OleDb::OleDbType::Double, 8, S"ISTOCKPRICE"));
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"DATES", System::Data::OleDb::OleDbType::VarChar, 10, S"DATES"));
			this->oleDbUpdateCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"Original_IID", System::Data::OleDb::OleDbType::VarChar, 10, System::Data::ParameterDirection::Input, false, (System::Byte)0, (System::Byte)0, S"IID", System::Data::DataRowVersion::Original, 0));
			// 
			// label2
			// 
			this->label2->Font = new System::Drawing::Font(S"宋体", 10.5F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
			this->label2->Location = System::Drawing::Point(24, 40);
			this->label2->Name = S"label2";
			this->label2->Size = System::Drawing::Size(64, 24);
			this->label2->TabIndex = 44;
			this->label2->Text = S"物品ID:";
			// 
			// oleDbDeleteCommand1
			// 
			this->oleDbDeleteCommand1->CommandText = S"DELETE FROM 进货表 WHERE (IID = \?)";
			this->oleDbDeleteCommand1->Connection = this->oleDbConnection1;
			this->oleDbDeleteCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"Original_IID", System::Data::OleDb::OleDbType::VarChar, 10, System::Data::ParameterDirection::Input, false, (System::Byte)0, (System::Byte)0, S"IID", System::Data::DataRowVersion::Original, 0));
			// 
			// oleDbDataAdapter1
			// 
			this->oleDbDataAdapter1->DeleteCommand = this->oleDbDeleteCommand1;
			this->oleDbDataAdapter1->InsertCommand = this->oleDbInsertCommand1;
			this->oleDbDataAdapter1->SelectCommand = this->oleDbSelectCommand1;
			System::Data::Common::DataTableMapping* __mcTemp__1[] = new System::Data::Common::DataTableMapping*[1];
			System::Data::Common::DataColumnMapping* __mcTemp__2[] = new System::Data::Common::DataColumnMapping*[5];
			__mcTemp__2[0] = new System::Data::Common::DataColumnMapping(S"IID", S"IID");
			__mcTemp__2[1] = new System::Data::Common::DataColumnMapping(S"INAME", S"INAME");
			__mcTemp__2[2] = new System::Data::Common::DataColumnMapping(S"IPROFUCER", S"IPROFUCER");
			__mcTemp__2[3] = new System::Data::Common::DataColumnMapping(S"ISTOCKPRICE", S"ISTOCKPRICE");
			__mcTemp__2[4] = new System::Data::Common::DataColumnMapping(S"DATES", S"DATES");
			__mcTemp__1[0] = new System::Data::Common::DataTableMapping(S"Table", S"进货表", __mcTemp__2);
			this->oleDbDataAdapter1->TableMappings->AddRange(__mcTemp__1);
			this->oleDbDataAdapter1->UpdateCommand = this->oleDbUpdateCommand1;
			// 
			// oleDbInsertCommand1
			// 
			this->oleDbInsertCommand1->CommandText = S"INSERT INTO 进货表(IID, INAME, IPROFUCER, ISTOCKPRICE, DATES) VALUES (\?, \?, \?, \?, \?)" 
				S"";
			this->oleDbInsertCommand1->Connection = this->oleDbConnection1;
			this->oleDbInsertCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"IID", System::Data::OleDb::OleDbType::VarChar, 10, S"IID"));
			this->oleDbInsertCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"INAME", System::Data::OleDb::OleDbType::VarChar, 20, S"INAME"));
			this->oleDbInsertCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"IPROFUCER", System::Data::OleDb::OleDbType::VarChar, 20, S"IPROFUCER"));
			this->oleDbInsertCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"ISTOCKPRICE", System::Data::OleDb::OleDbType::Double, 8, S"ISTOCKPRICE"));
			this->oleDbInsertCommand1->Parameters->Add(new System::Data::OleDb::OleDbParameter(S"DATES", System::Data::OleDb::OleDbType::VarChar, 10, S"DATES"));
			// 
			// label3
			// 
			this->label3->Location = System::Drawing::Point(224, 80);
			this->label3->Name = S"label3";
			this->label3->Size = System::Drawing::Size(104, 23);
			this->label3->TabIndex = 51;
			this->label3->Text = S"(如:1900-1-1)";
			// 
			// textBox2
			// 
			this->textBox2->Location = System::Drawing::Point(88, 80);
			this->textBox2->Name = S"textBox2";
			this->textBox2->Size = System::Drawing::Size(120, 21);
			this->textBox2->TabIndex = 50;
			this->textBox2->Text = S"";
			// 
			// dataGrid1
			// 
			this->dataGrid1->DataMember = S"";
			this->dataGrid1->HeaderForeColor = System::Drawing::SystemColors::ControlText;
			this->dataGrid1->Location = System::Drawing::Point(8, 112);
			this->dataGrid1->Name = S"dataGrid1";
			this->dataGrid1->Size = System::Drawing::Size(544, 288);
			this->dataGrid1->TabIndex = 49;
			// 
			// button2
			// 
			this->button2->Font = new System::Drawing::Font(S"宋体", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
			this->button2->Location = System::Drawing::Point(336, 80);
			this->button2->Name = S"button2";
			this->button2->Size = System::Drawing::Size(48, 24);
			this->button2->TabIndex = 48;
			this->button2->Text = S"查询";
			this->button2->Click += new System::EventHandler(this, button2_Click);
			// 
			// label7
			// 
			this->label7->Font = new System::Drawing::Font(S"宋体", 10.5F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
			this->label7->Location = System::Drawing::Point(40, 80);
			this->label7->Name = S"label7";
			this->label7->Size = System::Drawing::Size(56, 23);
			this->label7->TabIndex = 47;
			this->label7->Text = S"日期:";
			// 
			// button1
			// 
			this->button1->Font = new System::Drawing::Font(S"宋体", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
			this->button1->Location = System::Drawing::Point(232, 40);
			this->button1->Name = S"button1";
			this->button1->Size = System::Drawing::Size(48, 24);
			this->button1->TabIndex = 46;
			this->button1->Text = S"查询";
			this->button1->Click += new System::EventHandler(this, button1_Click);
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(88, 40);
			this->textBox1->Name = S"textBox1";
			this->textBox1->Size = System::Drawing::Size(120, 21);
			this->textBox1->TabIndex = 45;
			this->textBox1->Text = S"";
			// 
			// jinhuoxinxi
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
			this->ClientSize = System::Drawing::Size(560, 406);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->textBox2);
			this->Controls->Add(this->dataGrid1);
			this->Controls->Add(this->button2);
			this->Controls->Add(this->label7);
			this->Controls->Add(this->button1);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->label1);
			this->Name = S"jinhuoxinxi";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = S"进货信息";
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dataGrid1))->EndInit();
			this->ResumeLayout(false);

		}		
	private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
			 {String *IID=this->textBox1->Text->Trim();
		 oleDbSelectCommand1->CommandText=String::Concat(S"select IID as 物品ID,INAME as 名称,IPRODUCER as 生产商,ISTOCKPRICE as 进货价格,DATES as 日期 from  进货表 where ",S"IID='",IID,S"'" );
         oleDbConnection1->Open();
		 oleDbSelectCommand1->ExecuteNonQuery();
		 oleDbConnection1->Close();
		 DataTable *table1=new DataTable();
            oleDbDataAdapter1->Fill(table1);
			this->dataGrid1->DataSource=table1;
			 }

private: System::Void button2_Click(System::Object *  sender, System::EventArgs *  e)
		 {String *DATES=this->textBox2->Text->Trim();
		 oleDbSelectCommand1->CommandText=String::Concat(S"select IID as 物品ID,INAME as 名称,IPRODUCER as 生产商,ISTOCKPRICE as 进货价格,DATES as 日期 from  进货表 where ",S"DATES='",DATES,S"'");
         oleDbConnection1->Open();
		 oleDbSelectCommand1->ExecuteNonQuery();
		 oleDbConnection1->Close();
		 DataTable *table1=new DataTable();
            oleDbDataAdapter1->Fill(table1);
			this->dataGrid1->DataSource=table1;
		 }

};
}

⌨️ 快捷键说明

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