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

📄 factoryschedule.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 3 页
字号:
#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> 
	/// FactorySchedule 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class FactorySchedule : public System::Windows::Forms::Form
	{
		//--------------------成员声明------------------------
	private:
		LinkDataBase* MyDataBase;	//数据库连接类
		DataSet* ds;
		String* strTableName;
		String* strSQL;
		CurrencyManager* cmOrders;
	public:
		String* Year;
		String* PlanDate;
		String* BeginDate;
		String* EndDate;
	private:
		//数据表备份
		DataTable* copyTable;
	private: System::Windows::Forms::ImageList *  imageList1;
	private: System::Data::SqlClient::SqlDataAdapter *  sqlDataAdapter1;




	private: System::Data::SqlClient::SqlConnection *  sqlConnection1;
	private: System::Data::SqlClient::SqlCommand *  sqlSelectCommand1;
	private: System::Data::SqlClient::SqlCommand *  sqlInsertCommand1;
	private: System::Data::SqlClient::SqlCommand *  sqlUpdateCommand1;
	private: System::Data::SqlClient::SqlCommand *  sqlDeleteCommand1;
			 //判断是否由其它窗口调用
		bool CallByOthers;
		//-------------------成员声明结束-----------------------
	public: 
		FactorySchedule(bool Called)
		{
			InitializeComponent();
			//初始化
			this->MyDataBase = new LinkDataBase();
			this->ds = new DataSet();
			//查询工厂日历
			this->strSQL = S"Select * from 工厂日历";
			this->strTableName = S"工厂日历";
			this->MyDataBase->SelectDataBase(this->ds,this->strSQL,this->strTableName);

			this->cmOrders = __try_cast<CurrencyManager*>(BindingContext->get_Item(ds,S"工厂日历"));

			this->copyTable = this->ds->Tables->Item[S"工厂日历"]->Copy();
			CallByOthers = Called;

			//设置DataGrid
			this->dgrdFactorySchedule->DataSource = this->ds->Tables->Item[S"工厂日历"];
			this->DataGridStateControl();

			//设置控件的数据邦定
			this->SetDataBindings();
			//设置控件ReadOnly属性
			this->SetModify(false);
			//设置工具栏属性
			this->SetToolBar(!Called);
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::ToolBar *  toolBar1;
	private: System::Windows::Forms::ToolBarButton *  tBtnFirstRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnNextRecord;
	private: System::Windows::Forms::ToolBarButton *  tBtnPreviousRecord;
	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::GroupBox *  groupBox1;
	private: System::Windows::Forms::Label *  label2;
	private: System::Windows::Forms::Label *  label1;
	private: System::Windows::Forms::Button *  btnSearch;
	private: System::Windows::Forms::GroupBox *  groupBox2;
	private: System::Windows::Forms::Label *  label9;
	private: System::Windows::Forms::Label *  label10;
	private: System::Windows::Forms::Label *  label5;
	private: System::Windows::Forms::Label *  label6;
	private: System::Windows::Forms::Label *  label7;
	private: System::Windows::Forms::TextBox *  tBoxEndedDate;
	private: System::Windows::Forms::TextBox *  tBoxBeginDate;
	private: System::Windows::Forms::TextBox *  tBoxMemo;
	private: System::Windows::Forms::TextBox *  tBoxYear;
	private: System::Windows::Forms::TextBox *  tBoxPlanDateDisplay;
	private: System::Windows::Forms::TextBox *  tBoxYearDisplay;
	private: System::Windows::Forms::TextBox *  tBoxPlanDate;
	private: System::Windows::Forms::DataGrid *  dgrdFactorySchedule;
	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::FactorySchedule));
			this->toolBar1 = new System::Windows::Forms::ToolBar();
			this->tBtnFirstRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnNextRecord = new System::Windows::Forms::ToolBarButton();
			this->tBtnPreviousRecord = 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->imageList1 = new System::Windows::Forms::ImageList(this->components);
			this->groupBox1 = new System::Windows::Forms::GroupBox();
			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->groupBox2 = new System::Windows::Forms::GroupBox();
			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->dgrdFactorySchedule = new System::Windows::Forms::DataGrid();
			this->sqlDataAdapter1 = new System::Data::SqlClient::SqlDataAdapter();
			this->sqlConnection1 = new System::Data::SqlClient::SqlConnection();
			this->sqlSelectCommand1 = new System::Data::SqlClient::SqlCommand();
			this->sqlInsertCommand1 = new System::Data::SqlClient::SqlCommand();
			this->sqlUpdateCommand1 = new System::Data::SqlClient::SqlCommand();
			this->sqlDeleteCommand1 = new System::Data::SqlClient::SqlCommand();
			this->groupBox1->SuspendLayout();
			this->groupBox2->SuspendLayout();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dgrdFactorySchedule))->BeginInit();
			this->SuspendLayout();
			// 
			// toolBar1
			// 
			System::Windows::Forms::ToolBarButton* __mcTemp__1[] = new System::Windows::Forms::ToolBarButton*[10];
			__mcTemp__1[0] = this->tBtnFirstRecord;
			__mcTemp__1[1] = this->tBtnNextRecord;
			__mcTemp__1[2] = this->tBtnPreviousRecord;
			__mcTemp__1[3] = this->tBtnLastRecord;
			__mcTemp__1[4] = this->tBtnNewRecord;
			__mcTemp__1[5] = this->tBtnModifyRecord;
			__mcTemp__1[6] = this->tBtnDeleteRecord;
			__mcTemp__1[7] = this->tBtnPostModified;
			__mcTemp__1[8] = this->tBtnCancleModified;
			__mcTemp__1[9] = this->tBtnQuit;
			this->toolBar1->Buttons->AddRange(__mcTemp__1);
			this->toolBar1->DropDownArrows = true;
			this->toolBar1->ImageList = this->imageList1;
			this->toolBar1->Location = System::Drawing::Point(0, 0);
			this->toolBar1->Name = S"toolBar1";
			this->toolBar1->ShowToolTips = true;
			this->toolBar1->Size = System::Drawing::Size(768, 41);
			this->toolBar1->TabIndex = 1;
			this->toolBar1->ButtonClick += new System::Windows::Forms::ToolBarButtonClickEventHandler(this, toolBar1_ButtonClick);
			// 
			// tBtnFirstRecord
			// 
			this->tBtnFirstRecord->ImageIndex = 5;
			this->tBtnFirstRecord->Text = S"首记录";
			this->tBtnFirstRecord->ToolTipText = S"首记录";
			// 
			// tBtnNextRecord
			// 
			this->tBtnNextRecord->ImageIndex = 4;
			this->tBtnNextRecord->Text = S"上一记录";
			this->tBtnNextRecord->ToolTipText = S"上一记录";
			// 
			// tBtnPreviousRecord
			// 
			this->tBtnPreviousRecord->ImageIndex = 8;
			this->tBtnPreviousRecord->Text = S"下一记录";
			this->tBtnPreviousRecord->ToolTipText = S"下一记录";
			// 
			// tBtnLastRecord
			// 
			this->tBtnLastRecord->ImageIndex = 7;
			this->tBtnLastRecord->Text = S"尾记录";
			this->tBtnLastRecord->ToolTipText = S"尾记录";
			// 
			// tBtnNewRecord
			// 
			this->tBtnNewRecord->ImageIndex = 9;
			this->tBtnNewRecord->Text = S"新增";
			this->tBtnNewRecord->ToolTipText = S"新增";
			// 
			// tBtnModifyRecord
			// 
			this->tBtnModifyRecord->ImageIndex = 10;
			this->tBtnModifyRecord->Text = S"修改";
			this->tBtnModifyRecord->ToolTipText = S"修改";
			// 
			// tBtnDeleteRecord
			// 
			this->tBtnDeleteRecord->ImageIndex = 3;
			this->tBtnDeleteRecord->Text = S"删除";
			this->tBtnDeleteRecord->ToolTipText = S"删除";
			// 
			// tBtnPostModified
			// 
			this->tBtnPostModified->ImageIndex = 0;
			this->tBtnPostModified->Text = S"提交";
			this->tBtnPostModified->ToolTipText = S"提交";
			// 
			// tBtnCancleModified
			// 
			this->tBtnCancleModified->ImageIndex = 2;
			this->tBtnCancleModified->Text = S"取消";
			this->tBtnCancleModified->ToolTipText = S"取消";
			// 
			// tBtnQuit
			// 
			this->tBtnQuit->ImageIndex = 12;
			this->tBtnQuit->Text = S"退出";
			this->tBtnQuit->ToolTipText = S"退出";
			// 

⌨️ 快捷键说明

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