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

📄 workunitmanage.h

📁 这是一个工厂的生产线的仓库管理.有计划,实绩,库存等
💻 H
字号:
#pragma once

#include "DBBase.h"
#include "infClass.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 FAP
{
	/// <summary> 
	/// Summary for WorkUnitManage
	///
	/// WARNING: If you change the name of this class, you will need to change the 
	///          'Resource File Name' property for the managed resource compiler tool 
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public __gc class WorkUnitManage : public System::Windows::Forms::Form
	{
	public: 
		WorkUnitManage(void)
		{
			InitializeComponent();
		}
		WorkUnitManage(infClass * infClsTmp)
		{
			InitializeComponent();
			oInf = infClsTmp;
			iLanguage	= oInf->intLang;
			sFactory	= oInf->strFactoryCode;
			sLine		= oInf->strLine;
			sProcess	= oInf->strProcess;
			iGroup		= oInf->intGroup;
			cShift		= oInf->strShift;
			
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::DataGrid *  dataGrid1;
	private: System::Windows::Forms::Label *  label1;
	private: System::Windows::Forms::Button *  btnReturn;
	private: System::Windows::Forms::Button *  button1;

	private: int 			iLanguage;
			 String*		sFactory;
			 String*		sLine;
			 String*		sProcess;
			 int 		    iGroup;
			 String*		cShift;
			 infClass*		oInf;

	private:DBBase             *oDB;
            DataGridTableStyle *oTableStyle;
		    DataSet			   *oDataSet;
			DataTable		   *oDataTable;
			DataView           *oDataView;

	private: void SetValueDataGrid(void);
             void InitGridDataGrid(void);
			 bool UpdateGrid();
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container* components;

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			System::Resources::ResourceManager *  resources = new System::Resources::ResourceManager(__typeof(FAP::WorkUnitManage));
			this->dataGrid1 = new System::Windows::Forms::DataGrid();
			this->label1 = new System::Windows::Forms::Label();
			this->btnReturn = new System::Windows::Forms::Button();
			this->button1 = new System::Windows::Forms::Button();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dataGrid1))->BeginInit();
			this->SuspendLayout();
			// 
			// dataGrid1
			// 
			this->dataGrid1->AccessibleDescription = resources->GetString(S"dataGrid1.AccessibleDescription");
			this->dataGrid1->AccessibleName = resources->GetString(S"dataGrid1.AccessibleName");
			this->dataGrid1->Anchor = (*__try_cast<__box System::Windows::Forms::AnchorStyles *  >(resources->GetObject(S"dataGrid1.Anchor")));
			this->dataGrid1->BackgroundImage = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"dataGrid1.BackgroundImage")));
			this->dataGrid1->CaptionFont = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"dataGrid1.CaptionFont")));
			this->dataGrid1->CaptionText = resources->GetString(S"dataGrid1.CaptionText");
			this->dataGrid1->CaptionVisible = false;
			this->dataGrid1->DataMember = S"";
			this->dataGrid1->Dock = (*__try_cast<__box System::Windows::Forms::DockStyle *  >(resources->GetObject(S"dataGrid1.Dock")));
			this->dataGrid1->Enabled = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"dataGrid1.Enabled")));
			this->dataGrid1->Font = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"dataGrid1.Font")));
			this->dataGrid1->HeaderForeColor = System::Drawing::SystemColors::ControlText;
			this->dataGrid1->ImeMode = (*__try_cast<__box System::Windows::Forms::ImeMode *  >(resources->GetObject(S"dataGrid1.ImeMode")));
			this->dataGrid1->Location = (*__try_cast<__box System::Drawing::Point *  >(resources->GetObject(S"dataGrid1.Location")));
			this->dataGrid1->Name = S"dataGrid1";
			this->dataGrid1->RightToLeft = (*__try_cast<__box System::Windows::Forms::RightToLeft *  >(resources->GetObject(S"dataGrid1.RightToLeft")));
			this->dataGrid1->Size = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"dataGrid1.Size")));
			this->dataGrid1->TabIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"dataGrid1.TabIndex")));
			this->dataGrid1->Visible = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"dataGrid1.Visible")));
			// 
			// label1
			// 
			this->label1->AccessibleDescription = resources->GetString(S"label1.AccessibleDescription");
			this->label1->AccessibleName = resources->GetString(S"label1.AccessibleName");
			this->label1->Anchor = (*__try_cast<__box System::Windows::Forms::AnchorStyles *  >(resources->GetObject(S"label1.Anchor")));
			this->label1->AutoSize = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"label1.AutoSize")));
			this->label1->Dock = (*__try_cast<__box System::Windows::Forms::DockStyle *  >(resources->GetObject(S"label1.Dock")));
			this->label1->Enabled = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"label1.Enabled")));
			this->label1->Font = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"label1.Font")));
			this->label1->Image = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"label1.Image")));
			this->label1->ImageAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"label1.ImageAlign")));
			this->label1->ImageIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"label1.ImageIndex")));
			this->label1->ImeMode = (*__try_cast<__box System::Windows::Forms::ImeMode *  >(resources->GetObject(S"label1.ImeMode")));
			this->label1->Location = (*__try_cast<__box System::Drawing::Point *  >(resources->GetObject(S"label1.Location")));
			this->label1->Name = S"label1";
			this->label1->RightToLeft = (*__try_cast<__box System::Windows::Forms::RightToLeft *  >(resources->GetObject(S"label1.RightToLeft")));
			this->label1->Size = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"label1.Size")));
			this->label1->TabIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"label1.TabIndex")));
			this->label1->Text = resources->GetString(S"label1.Text");
			this->label1->TextAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"label1.TextAlign")));
			this->label1->Visible = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"label1.Visible")));
			// 
			// btnReturn
			// 
			this->btnReturn->AccessibleDescription = resources->GetString(S"btnReturn.AccessibleDescription");
			this->btnReturn->AccessibleName = resources->GetString(S"btnReturn.AccessibleName");
			this->btnReturn->Anchor = (*__try_cast<__box System::Windows::Forms::AnchorStyles *  >(resources->GetObject(S"btnReturn.Anchor")));
			this->btnReturn->BackgroundImage = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"btnReturn.BackgroundImage")));
			this->btnReturn->Dock = (*__try_cast<__box System::Windows::Forms::DockStyle *  >(resources->GetObject(S"btnReturn.Dock")));
			this->btnReturn->Enabled = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"btnReturn.Enabled")));
			this->btnReturn->FlatStyle = (*__try_cast<__box System::Windows::Forms::FlatStyle *  >(resources->GetObject(S"btnReturn.FlatStyle")));
			this->btnReturn->Font = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"btnReturn.Font")));
			this->btnReturn->Image = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"btnReturn.Image")));
			this->btnReturn->ImageAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"btnReturn.ImageAlign")));
			this->btnReturn->ImageIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"btnReturn.ImageIndex")));
			this->btnReturn->ImeMode = (*__try_cast<__box System::Windows::Forms::ImeMode *  >(resources->GetObject(S"btnReturn.ImeMode")));
			this->btnReturn->Location = (*__try_cast<__box System::Drawing::Point *  >(resources->GetObject(S"btnReturn.Location")));
			this->btnReturn->Name = S"btnReturn";
			this->btnReturn->RightToLeft = (*__try_cast<__box System::Windows::Forms::RightToLeft *  >(resources->GetObject(S"btnReturn.RightToLeft")));
			this->btnReturn->Size = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"btnReturn.Size")));
			this->btnReturn->TabIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"btnReturn.TabIndex")));
			this->btnReturn->Text = resources->GetString(S"btnReturn.Text");
			this->btnReturn->TextAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"btnReturn.TextAlign")));
			this->btnReturn->Visible = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"btnReturn.Visible")));
			this->btnReturn->Click += new System::EventHandler(this, btnReturn_Click);
			// 
			// button1
			// 
			this->button1->AccessibleDescription = resources->GetString(S"button1.AccessibleDescription");
			this->button1->AccessibleName = resources->GetString(S"button1.AccessibleName");
			this->button1->Anchor = (*__try_cast<__box System::Windows::Forms::AnchorStyles *  >(resources->GetObject(S"button1.Anchor")));
			this->button1->BackgroundImage = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"button1.BackgroundImage")));
			this->button1->Dock = (*__try_cast<__box System::Windows::Forms::DockStyle *  >(resources->GetObject(S"button1.Dock")));
			this->button1->Enabled = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"button1.Enabled")));
			this->button1->FlatStyle = (*__try_cast<__box System::Windows::Forms::FlatStyle *  >(resources->GetObject(S"button1.FlatStyle")));
			this->button1->Font = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"button1.Font")));
			this->button1->Image = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"button1.Image")));
			this->button1->ImageAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"button1.ImageAlign")));
			this->button1->ImageIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"button1.ImageIndex")));
			this->button1->ImeMode = (*__try_cast<__box System::Windows::Forms::ImeMode *  >(resources->GetObject(S"button1.ImeMode")));
			this->button1->Location = (*__try_cast<__box System::Drawing::Point *  >(resources->GetObject(S"button1.Location")));
			this->button1->Name = S"button1";
			this->button1->RightToLeft = (*__try_cast<__box System::Windows::Forms::RightToLeft *  >(resources->GetObject(S"button1.RightToLeft")));
			this->button1->Size = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"button1.Size")));
			this->button1->TabIndex = (*__try_cast<__box System::Int32 *  >(resources->GetObject(S"button1.TabIndex")));
			this->button1->Text = resources->GetString(S"button1.Text");
			this->button1->TextAlign = (*__try_cast<__box System::Drawing::ContentAlignment *  >(resources->GetObject(S"button1.TextAlign")));
			this->button1->Visible = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"button1.Visible")));
			this->button1->Click += new System::EventHandler(this, button1_Click);
			// 
			// WorkUnitManage
			// 
			this->AccessibleDescription = resources->GetString(S"$this.AccessibleDescription");
			this->AccessibleName = resources->GetString(S"$this.AccessibleName");
			this->AutoScaleBaseSize = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.AutoScaleBaseSize")));
			this->AutoScroll = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"$this.AutoScroll")));
			this->AutoScrollMargin = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.AutoScrollMargin")));
			this->AutoScrollMinSize = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.AutoScrollMinSize")));
			this->BackgroundImage = (__try_cast<System::Drawing::Image *  >(resources->GetObject(S"$this.BackgroundImage")));
			this->ClientSize = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.ClientSize")));
			this->Controls->Add(this->btnReturn);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->dataGrid1);
			this->Controls->Add(this->button1);
			this->Enabled = (*__try_cast<__box System::Boolean *  >(resources->GetObject(S"$this.Enabled")));
			this->Font = (__try_cast<System::Drawing::Font *  >(resources->GetObject(S"$this.Font")));
			this->Icon = (__try_cast<System::Drawing::Icon *  >(resources->GetObject(S"$this.Icon")));
			this->ImeMode = (*__try_cast<__box System::Windows::Forms::ImeMode *  >(resources->GetObject(S"$this.ImeMode")));
			this->Location = (*__try_cast<__box System::Drawing::Point *  >(resources->GetObject(S"$this.Location")));
			this->MaximizeBox = false;
			this->MaximumSize = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.MaximumSize")));
			this->MinimumSize = (*__try_cast<__box System::Drawing::Size *  >(resources->GetObject(S"$this.MinimumSize")));
			this->Name = S"WorkUnitManage";
			this->RightToLeft = (*__try_cast<__box System::Windows::Forms::RightToLeft *  >(resources->GetObject(S"$this.RightToLeft")));
			this->StartPosition = (*__try_cast<__box System::Windows::Forms::FormStartPosition *  >(resources->GetObject(S"$this.StartPosition")));
			this->Text = resources->GetString(S"$this.Text");
			this->Load += new System::EventHandler(this, WorkUnitManage_Load);
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dataGrid1))->EndInit();
			this->ResumeLayout(false);

		}		
	private: System::Void WorkUnitManage_Load(System::Object *  sender, System::EventArgs *  e)
			 {
				 oDB = new DBBase();
				 oDB->blnCnnOpen();
				 InitGridDataGrid();
				 SetValueDataGrid();
				 oDB->blnCnnClose();
				
			 }

private: System::Void btnReturn_Click(System::Object *  sender, System::EventArgs *  e)
		 {
			 this->Close();
		 }

private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
		 {
			  oDB->blnCnnOpen();

			 oDB->blnBeginTrans();

			
			 if (UpdateGrid()){
				 oDB->blnCommit();
				 String *msg[]={S"更新成功!!",S"更新に成功しました!!",S"Success To Update!!"};
				 MessageBox::Show(msg[iLanguage]);
			 }
			 else{
			String *msg[]={S"更新失败!!",S"更新に失敗しました!!",S"Fail To Update!!"};
				 MessageBox::Show(msg[iLanguage]);
				 oDB->blnRollBack();
			 }

			oDB->blnCnnClose();
		 }

};
}

⌨️ 快捷键说明

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