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

📄 mrpcal.h

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

#include "LinkDataBase.h"
#include "DataGridNoActiveCellColumn.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> 
	/// MRPCal 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class MRPCal : public System::Windows::Forms::Form
	{
	//--------------------成员声明------------------------
	private:
		LinkDataBase* MyDataBase;	//数据库连接类
		DataSet* ds;
		String* strTableName;
	private: System::Windows::Forms::ImageList *  imageList1;
			 String* strSQL;
	//-------------------成员声明结束-----------------------
	public: 
		MRPCal(void)
		{
			InitializeComponent();
			//初始化
			this->MyDataBase = new LinkDataBase();
			this->ds = new DataSet();
			this->ProduceAdapter->SelectCommand->Connection = this->MyDataBase->myConnection;
			this->DemandAdapter->SelectCommand->Connection = this->MyDataBase->myConnection;
			//查询主生产计划
			this->strSQL = this->ProduceAdapter->SelectCommand->CommandText;
			this->strTableName = S"主生产计划";
			this->MyDataBase->SelectDataBase(this->ProduceAdapter,this->ds,this->strSQL,this->strTableName);
			//查询物料需求
			this->strSQL = this->DemandAdapter->SelectCommand->CommandText;
			this->strTableName = S"物料需求";
			this->MyDataBase->SelectDataBase(this->DemandAdapter,this->ds,this->strSQL,this->strTableName);
			//设置DataGrid
			this->dgrdProducePlan->DataSource = this->ds->Tables->Item[S"主生产计划"];
			this->DataGridStateProducePlan();
			this->dgrdMRP->DataSource = this->ds->Tables->Item[S"物料需求"];
			this->DataGridStateDemand();
			this->btnRelease->Enabled = false;
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::GroupBox *  groupBox1;
	private: System::Windows::Forms::GroupBox *  groupBox2;
	private: System::Windows::Forms::GroupBox *  groupBox3;
	private: System::Windows::Forms::CheckBox *  chkStorageAndOrders;
	private: System::Windows::Forms::CheckBox *  chkAhead;
	private: System::Windows::Forms::CheckBox *  chkWastage;
	private: System::Windows::Forms::Button *  btnCalculate;
	private: System::Windows::Forms::Button *  btnRelease;
	private: System::Windows::Forms::DataGrid *  dgrdProducePlan;
	private: System::Windows::Forms::DataGrid *  dgrdMRP;
    private: System::Data::SqlClient::SqlDataAdapter *  ProduceAdapter;
	private: System::Data::SqlClient::SqlDataAdapter *  DemandAdapter;
	private: System::Data::SqlClient::SqlCommand *  sqlSelectCommand2;
	private: System::Data::SqlClient::SqlCommand *  sqlSelectCommand1;
	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::MRPCal));
			this->groupBox1 = new System::Windows::Forms::GroupBox();
			this->btnRelease = new System::Windows::Forms::Button();
			this->imageList1 = new System::Windows::Forms::ImageList(this->components);
			this->btnCalculate = new System::Windows::Forms::Button();
			this->chkWastage = new System::Windows::Forms::CheckBox();
			this->chkAhead = new System::Windows::Forms::CheckBox();
			this->chkStorageAndOrders = new System::Windows::Forms::CheckBox();
			this->groupBox2 = new System::Windows::Forms::GroupBox();
			this->dgrdProducePlan = new System::Windows::Forms::DataGrid();
			this->groupBox3 = new System::Windows::Forms::GroupBox();
			this->dgrdMRP = new System::Windows::Forms::DataGrid();
			this->ProduceAdapter = new System::Data::SqlClient::SqlDataAdapter();
			this->sqlSelectCommand1 = new System::Data::SqlClient::SqlCommand();
			this->DemandAdapter = new System::Data::SqlClient::SqlDataAdapter();
			this->sqlSelectCommand2 = new System::Data::SqlClient::SqlCommand();
			this->groupBox1->SuspendLayout();
			this->groupBox2->SuspendLayout();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dgrdProducePlan))->BeginInit();
			this->groupBox3->SuspendLayout();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dgrdMRP))->BeginInit();
			this->SuspendLayout();
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->btnRelease);
			this->groupBox1->Controls->Add(this->btnCalculate);
			this->groupBox1->Controls->Add(this->chkWastage);
			this->groupBox1->Controls->Add(this->chkAhead);
			this->groupBox1->Controls->Add(this->chkStorageAndOrders);
			this->groupBox1->Dock = System::Windows::Forms::DockStyle::Top;
			this->groupBox1->Location = System::Drawing::Point(0, 0);
			this->groupBox1->Name = S"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(744, 104);
			this->groupBox1->TabIndex = 0;
			this->groupBox1->TabStop = false;
			// 
			// btnRelease
			// 
			this->btnRelease->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
			this->btnRelease->ImageIndex = 0;
			this->btnRelease->ImageList = this->imageList1;
			this->btnRelease->Location = System::Drawing::Point(632, 40);
			this->btnRelease->Name = S"btnRelease";
			this->btnRelease->Size = System::Drawing::Size(96, 24);
			this->btnRelease->TabIndex = 4;
			this->btnRelease->Text = S"结果发布";
			this->btnRelease->Click += new System::EventHandler(this, btnRelease_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;
			// 
			// btnCalculate
			// 
			this->btnCalculate->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
			this->btnCalculate->ImageIndex = 13;
			this->btnCalculate->ImageList = this->imageList1;
			this->btnCalculate->Location = System::Drawing::Point(536, 40);
			this->btnCalculate->Name = S"btnCalculate";
			this->btnCalculate->Size = System::Drawing::Size(72, 24);
			this->btnCalculate->TabIndex = 3;
			this->btnCalculate->Text = S"计算";
			this->btnCalculate->Click += new System::EventHandler(this, btnCalculate_Click);
			// 
			// chkWastage
			// 
			this->chkWastage->Location = System::Drawing::Point(368, 40);
			this->chkWastage->Name = S"chkWastage";
			this->chkWastage->Size = System::Drawing::Size(112, 24);
			this->chkWastage->TabIndex = 2;
			this->chkWastage->Text = S"考虑损耗";
			// 
			// chkAhead
			// 
			this->chkAhead->Location = System::Drawing::Point(240, 42);
			this->chkAhead->Name = S"chkAhead";
			this->chkAhead->Size = System::Drawing::Size(112, 24);
			this->chkAhead->TabIndex = 1;
			this->chkAhead->Text = S"考虑提前期";
			// 
			// chkStorageAndOrders
			// 
			this->chkStorageAndOrders->Location = System::Drawing::Point(40, 32);
			this->chkStorageAndOrders->Name = S"chkStorageAndOrders";
			this->chkStorageAndOrders->Size = System::Drawing::Size(192, 40);
			this->chkStorageAndOrders->TabIndex = 0;
			this->chkStorageAndOrders->Text = S"考虑库存,生产和采购订单";
			// 
			// groupBox2
			// 
			this->groupBox2->Controls->Add(this->dgrdProducePlan);
			this->groupBox2->Dock = System::Windows::Forms::DockStyle::Fill;
			this->groupBox2->Location = System::Drawing::Point(0, 104);
			this->groupBox2->Name = S"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(744, 149);
			this->groupBox2->TabIndex = 1;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = S"主生产计划";
			// 
			// dgrdProducePlan
			// 
			this->dgrdProducePlan->DataMember = S"";

⌨️ 快捷键说明

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