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

📄 requireplan.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 3 页
字号:
#pragma once

#include "LinkDataBase.h"
#include "DataGridNoActiveCellColumn.h"
#include "SelectMaterials.h"
#include "FactorySchedule.h"

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 My
{
	/// <summary> 
	/// RequirePlan 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class RequirePlan : public System::Windows::Forms::Form
	{
		//--------------------成员声明------------------------
	private:
		LinkDataBase* MyDataBase;	//数据库连接类
		DataSet* ds;				
		String* strSQL;
		CurrencyManager* cmRequire;
		String* SubjectID;
		String* SubjectName;		
		SqlDataAdapter* DemandAdapter;
	private: System::Windows::Forms::ComboBox *  cmbStatus;
	private: System::Windows::Forms::TextBox *  tBoxDemand;
	private: System::Data::SqlClient::SqlCommand *  DemandInsertSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  DemandDeleteSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  DemandUpdateSqlCmd;
			 bool IsModifyDetail;
	public: 
		RequirePlan(void)
		{
			InitializeComponent();
			this->MyDataBase = new LinkDataBase();			
			this->DemandAdapter = new SqlDataAdapter();
			this->ds = new DataSet();

			this->DemandAdapter->InsertCommand = this->DemandInsertSqlCmd;
			this->DemandAdapter->UpdateCommand = this->DemandUpdateSqlCmd;
			this->DemandAdapter->DeleteCommand = this->DemandDeleteSqlCmd;
			this->DemandAdapter->InsertCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->UpdateCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->DeleteCommand->Connection = this->MyDataBase->myConnection;


			//查询主需求计划表
			this->strSQL = S"SELECT 编号, 主需求计划.物料编号, 物料主文件.物料名称, 年份, 计划期, 开始日期, 结束日期, 需求数量, 记帐人, 修改日期, 状态, 备注 FROM 主需求计划  INNER JOIN 物料主文件 ON 主需求计划.物料编号 = 物料主文件.物料编号";
			this->MyDataBase->SelectDataBase(this->DemandAdapter,this->ds,this->strSQL,S"主需求计划表");
			this->cmRequire = __try_cast<CurrencyManager*>(this->BindingContext->Item[this->ds->Tables->Item[S"主需求计划表"]]);
			this->DataBidings();
			this->dgrdRequirePlan->DataSource = this->ds->Tables->Item[S"主需求计划表"];
			this->DataGridStateControl();
			this->SetModify(false);
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::GroupBox *  groupBox2;
	private: System::Windows::Forms::TextBox *  tBoxEndedDate;
	private: System::Windows::Forms::Label *  label9;
	private: System::Windows::Forms::TextBox *  tBoxMemo;
	private: System::Windows::Forms::Label *  label10;
	private: System::Windows::Forms::TextBox *  tBoxPlanDateDisplay;
	private: System::Windows::Forms::TextBox *  tBoxYearDisplay;
	private: System::Windows::Forms::Label *  label5;
	private: System::Windows::Forms::TextBox *  tBoxBeginDate;
	private: System::Windows::Forms::Label *  label6;
	private: System::Windows::Forms::Label *  label7;
	private: System::Windows::Forms::GroupBox *  groupBox1;
	private: System::Windows::Forms::TextBox *  tBoxPlanDate;
	private: System::Windows::Forms::Label *  label2;
	private: System::Windows::Forms::TextBox *  tBoxYear;
	private: System::Windows::Forms::Label *  label1;
	private: System::Windows::Forms::Button *  btnSearch;
	private: System::Windows::Forms::TextBox *  tBoxMaterialName;
	private: System::Windows::Forms::TextBox *  tBoxMaterialIDShow;
	private: System::Windows::Forms::TextBox *  tBoxMaterialID;
	private: System::Windows::Forms::DataGrid *  dgrdRequirePlan;
	private: System::Windows::Forms::ToolBar *  toolBar1;
	private: System::Windows::Forms::ToolBarButton *  tBtnFirstRecord;


	private: System::Windows::Forms::ToolBarButton *  tBtnLastRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnNewRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnModifyRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnDeleteRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnPostModified;
	private: System::Windows::Forms::ToolBarButton *  tBtnCancleModified;
	private: System::Windows::Forms::ToolBarButton *  tBtnQuit;


	private: System::Windows::Forms::Label *  label3;


	private: System::Windows::Forms::Label *  label4;
	private: System::Windows::Forms::Label *  label8;

	private: System::Windows::Forms::Label *  label11;

	private: System::Windows::Forms::Label *  label12;
	private: System::Windows::Forms::ToolBarButton *  tBtnPreviousRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnNextRecord;
	private: System::Windows::Forms::ImageList *  imageList1;
	private: System::Windows::Forms::Button *  btnSelectMaterial;
	private: System::Windows::Forms::Button *  btnSelectSchedule;
	private: System::ComponentModel::IContainer *  components;

	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>


		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		void InitializeComponent(void)
		{
			this->components = new System::ComponentModel::Container();
			System::Resources::ResourceManager *  resources = new System::Resources::ResourceManager(__typeof(My::RequirePlan));
			this->groupBox2 = new System::Windows::Forms::GroupBox();
			this->btnSelectSchedule = new System::Windows::Forms::Button();
			this->imageList1 = new System::Windows::Forms::ImageList(this->components);
			this->btnSelectMaterial = new System::Windows::Forms::Button();
			this->label12 = new System::Windows::Forms::Label();
			this->cmbStatus = new System::Windows::Forms::ComboBox();
			this->tBoxDemand = new System::Windows::Forms::TextBox();
			this->label11 = new System::Windows::Forms::Label();
			this->tBoxMaterialName = new System::Windows::Forms::TextBox();
			this->tBoxMaterialIDShow = new System::Windows::Forms::TextBox();
			this->label4 = new System::Windows::Forms::Label();
			this->label8 = new System::Windows::Forms::Label();
			this->tBoxEndedDate = new System::Windows::Forms::TextBox();
			this->label9 = new System::Windows::Forms::Label();
			this->tBoxMemo = new System::Windows::Forms::TextBox();
			this->label10 = new System::Windows::Forms::Label();
			this->tBoxPlanDateDisplay = new System::Windows::Forms::TextBox();
			this->tBoxYearDisplay = new System::Windows::Forms::TextBox();
			this->label5 = new System::Windows::Forms::Label();
			this->tBoxBeginDate = new System::Windows::Forms::TextBox();
			this->label6 = new System::Windows::Forms::Label();
			this->label7 = new System::Windows::Forms::Label();
			this->groupBox1 = new System::Windows::Forms::GroupBox();
			this->tBoxMaterialID = new System::Windows::Forms::TextBox();
			this->label3 = new System::Windows::Forms::Label();
			this->tBoxPlanDate = new System::Windows::Forms::TextBox();
			this->label2 = new System::Windows::Forms::Label();
			this->tBoxYear = new System::Windows::Forms::TextBox();
			this->label1 = new System::Windows::Forms::Label();
			this->btnSearch = new System::Windows::Forms::Button();
			this->toolBar1 = new System::Windows::Forms::ToolBar();
			this->tBtnFirstRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnPreviousRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnNextRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnLastRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnNewRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnModifyRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnDeleteRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnPostModified = new System::Windows::Forms::ToolBarButton();
			this->tBtnCancleModified = new System::Windows::Forms::ToolBarButton();
			this->tBtnQuit = new System::Windows::Forms::ToolBarButton();
			this->dgrdRequirePlan = new System::Windows::Forms::DataGrid();
			this->DemandInsertSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandDeleteSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandUpdateSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->groupBox2->SuspendLayout();
			this->groupBox1->SuspendLayout();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dgrdRequirePlan))->BeginInit();
			this->SuspendLayout();
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->btnSelectSchedule);
			this->groupBox2->Controls->Add(this->btnSelectMaterial);
			this->groupBox2->Controls->Add(this->label12);
			this->groupBox2->Controls->Add(this->cmbStatus);
			this->groupBox2->Controls->Add(this->tBoxDemand);
			this->groupBox2->Controls->Add(this->label11);
			this->groupBox2->Controls->Add(this->tBoxMaterialName);
			this->groupBox2->Controls->Add(this->tBoxMaterialIDShow);
			this->groupBox2->Controls->Add(this->label4);
			this->groupBox2->Controls->Add(this->label8);
			this->groupBox2->Controls->Add(this->tBoxEndedDate);
			this->groupBox2->Controls->Add(this->label9);
			this->groupBox2->Controls->Add(this->tBoxMemo);
			this->groupBox2->Controls->Add(this->label10);
			this->groupBox2->Controls->Add(this->tBoxPlanDateDisplay);
			this->groupBox2->Controls->Add(this->tBoxYearDisplay);
			this->groupBox2->Controls->Add(this->label5);
			this->groupBox2->Controls->Add(this->tBoxBeginDate);
			this->groupBox2->Controls->Add(this->label6);
			this->groupBox2->Controls->Add(this->label7);
			this->groupBox2->Dock = System::Windows::Forms::DockStyle::Right;
			this->groupBox2->Location = System::Drawing::Point(472, 120);
			this->groupBox2->Name = S"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(296, 509);
			this->groupBox2->TabIndex = 8;
			this->groupBox2->TabStop = false;
			// 
			// btnSelectSchedule
			// 
			this->btnSelectSchedule->ImageIndex = 11;
			this->btnSelectSchedule->ImageList = this->imageList1;
			this->btnSelectSchedule->Location = System::Drawing::Point(208, 128);
			this->btnSelectSchedule->Name = S"btnSelectSchedule";
			this->btnSelectSchedule->Size = System::Drawing::Size(24, 24);
			this->btnSelectSchedule->TabIndex = 24;
			this->btnSelectSchedule->Click += new System::EventHandler(this, btnSelectSchedule_Click);
			// 
			// imageList1
			// 
			this->imageList1->ImageSize = System::Drawing::Size(16, 16);
			this->imageList1->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer *  >(resources->GetObject(S"imageList1.ImageStream")));
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
			// 
			// btnSelectMaterial
			// 
			this->btnSelectMaterial->ImageIndex = 11;
			this->btnSelectMaterial->ImageList = this->imageList1;
			this->btnSelectMaterial->Location = System::Drawing::Point(208, 40);
			this->btnSelectMaterial->Name = S"btnSelectMaterial";
			this->btnSelectMaterial->Size = System::Drawing::Size(24, 24);
			this->btnSelectMaterial->TabIndex = 23;
			this->btnSelectMaterial->Click += new System::EventHandler(this, btnSelectMaterial_Click);
			// 
			// label12
			// 
			this->label12->Location = System::Drawing::Point(64, 352);
			this->label12->Name = S"label12";
			this->label12->Size = System::Drawing::Size(56, 11);
			this->label12->TabIndex = 22;
			this->label12->Text = S"状态";
			// 
			// cmbStatus
			// 
			this->cmbStatus->Location = System::Drawing::Point(64, 368);
			this->cmbStatus->Name = S"cmbStatus";
			this->cmbStatus->Size = System::Drawing::Size(136, 20);
			this->cmbStatus->TabIndex = 21;
			// 
			// tBoxDemand
			// 
			this->tBoxDemand->Location = System::Drawing::Point(64, 320);
			this->tBoxDemand->Name = S"tBoxDemand";
			this->tBoxDemand->Size = System::Drawing::Size(136, 21);
			this->tBoxDemand->TabIndex = 20;
			this->tBoxDemand->Text = S"";
			// 
			// label11
			// 
			this->label11->Location = System::Drawing::Point(64, 304);
			this->label11->Name = S"label11";
			this->label11->Size = System::Drawing::Size(56, 11);
			this->label11->TabIndex = 19;
			this->label11->Text = S"需求数量";
			// 
			// tBoxMaterialName
			// 
			this->tBoxMaterialName->Location = System::Drawing::Point(64, 88);
			this->tBoxMaterialName->Name = S"tBoxMaterialName";
			this->tBoxMaterialName->Size = System::Drawing::Size(136, 21);
			this->tBoxMaterialName->TabIndex = 18;
			this->tBoxMaterialName->Text = S"";
			// 
			// tBoxMaterialIDShow
			// 
			this->tBoxMaterialIDShow->Location = System::Drawing::Point(64, 40);
			this->tBoxMaterialIDShow->Name = S"tBoxMaterialIDShow";
			this->tBoxMaterialIDShow->Size = System::Drawing::Size(136, 21);
			this->tBoxMaterialIDShow->TabIndex = 16;
			this->tBoxMaterialIDShow->Text = S"";
			// 
			// label4

⌨️ 快捷键说明

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