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

📄 produceplan.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 5 页
字号:
#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> 
	/// ProducePlan 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class ProducePlan : public System::Windows::Forms::Form
	{
	//--------------------成员声明------------------------
	private:
		LinkDataBase* MyDataBase;	//数据库连接类
		DataSet* ds;				
		String* strSQL;
		CurrencyManager* cmProduce;
		String* SubjectID;
		String* SubjectName;
		SqlDataAdapter* ProduceAdapter;
		SqlDataAdapter* DemandAdapter;
	private: System::Data::SqlClient::SqlCommand *  ProduceDeleteSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  ProduceInsertSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  ProduceUpdateSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  DemandDeleteSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  DemandInsertSqlCmd;
	private: System::Data::SqlClient::SqlCommand *  DemandUpdateSqlCmd;
	private: System::Windows::Forms::ImageList *  imageList1;
	private: System::Data::SqlClient::SqlConnection *  sqlConnection1;
	private: System::Windows::Forms::Label *  label18;
	private: System::Windows::Forms::TextBox *  tBoxYear;
			 bool IsModifyDetail;
	//-------------------成员声明结束-----------------------
	public: 
		ProducePlan(void)
		{
			InitializeComponent();
			this->MyDataBase = new LinkDataBase();
			this->ProduceAdapter = new SqlDataAdapter();
			this->DemandAdapter = new SqlDataAdapter();
			this->ds = new DataSet();

			this->ProduceAdapter->SelectCommand = this->ProduceSelectSqlCmd;
			this->ProduceAdapter->InsertCommand = this->ProduceInsertSqlCmd;
			this->ProduceAdapter->UpdateCommand = this->ProduceUpdateSqlCmd;
			this->ProduceAdapter->DeleteCommand = this->ProduceDeleteSqlCmd;

			this->ProduceAdapter->SelectCommand->Connection = this->MyDataBase->myConnection;
			this->ProduceAdapter->InsertCommand->Connection = this->MyDataBase->myConnection;
			this->ProduceAdapter->UpdateCommand->Connection = this->MyDataBase->myConnection;
			this->ProduceAdapter->DeleteCommand->Connection = this->MyDataBase->myConnection;
			
			this->ProduceAdapter->SelectCommand->CommandText = S"SELECT 物料主文件.物料名称,主生产计划.* FROM 主生产计划 INNER JOIN 物料主文件 ON 主生产计划.物料编号 = 物料主文件.物料编号";

			this->DemandAdapter->SelectCommand = this->DemandSelectSqlCmd;
			this->DemandAdapter->InsertCommand = this->DemandInsertSqlCmd;
			this->DemandAdapter->UpdateCommand = this->DemandUpdateSqlCmd;
			this->DemandAdapter->DeleteCommand = this->DemandDeleteSqlCmd;

			this->DemandAdapter->SelectCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->InsertCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->UpdateCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->DeleteCommand->Connection = this->MyDataBase->myConnection;

						
			this->ProduceAdapter->Fill(this->ds,S"主生产计划表");
			this->DemandAdapter->Fill(this->ds,S"主需求计划表");
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::ToolBarButton *  tBtnCancelModify;
	private: System::Windows::Forms::GroupBox *  groupBox1;
	private: System::Windows::Forms::Label *  label4;
	private: System::Windows::Forms::Label *  label6;
	private: System::Windows::Forms::Label *  label7;
	private: System::Windows::Forms::Label *  label8;
	private: System::Windows::Forms::Label *  label3;
	private: System::Windows::Forms::Label *  label2;
	private: System::Windows::Forms::Label *  label1;
	private: System::Windows::Forms::ToolBarButton *  tBtnNextRecord;
	private: System::Windows::Forms::GroupBox *  groupBox2;
	private: System::Windows::Forms::Button *  btnSearch;
	private: System::Windows::Forms::Label *  label10;

	private: System::Windows::Forms::ToolBarButton *  tBtnModifyRecord;
	private: System::Windows::Forms::ToolBar *  toolBar1;
	private: System::Windows::Forms::ToolBarButton *  tBtnFirstRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnPreviousRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnLastRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnAddRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnModify;
	private: System::Windows::Forms::ToolBarButton *  tBtnDeleteRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnQuit;
	private: System::Windows::Forms::GroupBox *  groupBox3;
	private: System::Windows::Forms::Button *  btnImport;
	private: System::Windows::Forms::Label *  label11;
	private: System::Windows::Forms::Label *  label12;
	private: System::Windows::Forms::Label *  label13;
	private: System::Windows::Forms::Label *  label5;
	private: System::Windows::Forms::Label *  label14;
	private: System::Windows::Forms::Label *  label15;
	private: System::Windows::Forms::Button *  btnSearchID;
	private: System::Windows::Forms::Button *  btnSearchYear;
	private: System::Windows::Forms::Label *  label16;

	private: System::Windows::Forms::TextBox *  tBoxMaterialID;
	private: System::Windows::Forms::TextBox *  tBoxPlanDate;
	private: System::Windows::Forms::TextBox *  tBoxEndDate;
	private: System::Windows::Forms::TextBox *  tBoxPlanDateShow;
	private: System::Windows::Forms::TextBox *  tBoxMaterialName;
	private: System::Windows::Forms::TextBox *  tBoxDemond;
	private: System::Windows::Forms::TextBox *  tBoxMPS;
	private: System::Windows::Forms::TextBox *  tBoxInitStorage;
	private: System::Windows::Forms::TextBox *  tBoxPlanningStorage;
	private: System::Windows::Forms::TextBox *  tBoxMemo;
	private: System::Windows::Forms::TextBox *  tBoxStatus;
	private: System::Windows::Forms::TextBox *  tBoxProduceOrder;
	private: System::Windows::Forms::TextBox *  tBoxBeginDate;
	private: System::Windows::Forms::TextBox *  tBoxYearShow;
	private: System::Windows::Forms::TextBox *  tBoxMaterialIDShow;
	private: System::Windows::Forms::DataGrid *  dgrdProducePlan;
	private: System::Windows::Forms::DataGrid *  dgrdDemondPlan;
	private: System::Data::SqlClient::SqlCommand *  ProduceSelectSqlCmd;






	private: System::Data::SqlClient::SqlCommand *  DemandSelectSqlCmd;
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::ProducePlan));
			this->tBtnCancelModify = new System::Windows::Forms::ToolBarButton();
			this->groupBox1 = new System::Windows::Forms::GroupBox();
			this->btnSearchYear = new System::Windows::Forms::Button();
			this->imageList1 = new System::Windows::Forms::ImageList(this->components);
			this->btnSearchID = new System::Windows::Forms::Button();
			this->label5 = new System::Windows::Forms::Label();
			this->label14 = new System::Windows::Forms::Label();
			this->label15 = new System::Windows::Forms::Label();
			this->tBoxEndDate = new System::Windows::Forms::TextBox();
			this->tBoxPlanDateShow = new System::Windows::Forms::TextBox();
			this->tBoxMaterialName = new System::Windows::Forms::TextBox();
			this->tBoxDemond = new System::Windows::Forms::TextBox();
			this->label11 = new System::Windows::Forms::Label();
			this->label12 = new System::Windows::Forms::Label();
			this->label13 = new System::Windows::Forms::Label();
			this->tBoxMPS = new System::Windows::Forms::TextBox();
			this->tBoxInitStorage = new System::Windows::Forms::TextBox();
			this->tBoxPlanningStorage = new System::Windows::Forms::TextBox();
			this->label4 = new System::Windows::Forms::Label();
			this->label6 = new System::Windows::Forms::Label();
			this->label7 = new System::Windows::Forms::Label();
			this->label8 = new System::Windows::Forms::Label();
			this->tBoxMemo = new System::Windows::Forms::TextBox();
			this->tBoxStatus = new System::Windows::Forms::TextBox();
			this->tBoxProduceOrder = new System::Windows::Forms::TextBox();
			this->label3 = new System::Windows::Forms::Label();
			this->label2 = new System::Windows::Forms::Label();
			this->label1 = new System::Windows::Forms::Label();
			this->tBoxBeginDate = new System::Windows::Forms::TextBox();
			this->tBoxYearShow = new System::Windows::Forms::TextBox();
			this->tBoxMaterialIDShow = new System::Windows::Forms::TextBox();
			this->tBtnNextRecord = new System::Windows::Forms::ToolBarButton();
			this->groupBox2 = new System::Windows::Forms::GroupBox();
			this->label16 = new System::Windows::Forms::Label();
			this->tBoxPlanDate = new System::Windows::Forms::TextBox();
			this->btnSearch = new System::Windows::Forms::Button();
			this->label18 = new System::Windows::Forms::Label();
			this->label10 = new System::Windows::Forms::Label();
			this->tBoxYear = new System::Windows::Forms::TextBox();
			this->tBoxMaterialID = new System::Windows::Forms::TextBox();
			this->tBtnModifyRecord = new System::Windows::Forms::ToolBarButton();
			this->toolBar1 = new System::Windows::Forms::ToolBar();
			this->tBtnFirstRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnPreviousRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnLastRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnAddRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnModify = new System::Windows::Forms::ToolBarButton();
			this->tBtnDeleteRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnQuit = new System::Windows::Forms::ToolBarButton();
			this->dgrdProducePlan = new System::Windows::Forms::DataGrid();
			this->groupBox3 = new System::Windows::Forms::GroupBox();
			this->btnImport = new System::Windows::Forms::Button();
			this->dgrdDemondPlan = new System::Windows::Forms::DataGrid();
			this->ProduceDeleteSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->ProduceInsertSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->sqlConnection1 = new System::Data::SqlClient::SqlConnection();
			this->ProduceSelectSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->ProduceUpdateSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandDeleteSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandInsertSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandSelectSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->DemandUpdateSqlCmd = new System::Data::SqlClient::SqlCommand();
			this->groupBox1->SuspendLayout();

⌨️ 快捷键说明

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