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

📄 stocktable.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 4 页
字号:
			this->tBoxTotal->TabIndex = 41;
			this->tBoxTotal->Text = S"";
			// 
			// toolBar1
			// 
			System::Windows::Forms::ToolBarButton* __mcTemp__1[] = new System::Windows::Forms::ToolBarButton*[5];
			__mcTemp__1[0] = this->tbarNew;
			__mcTemp__1[1] = this->tbarSearch;
			__mcTemp__1[2] = this->tbarSave;
			__mcTemp__1[3] = this->tbarDelete;
			__mcTemp__1[4] = this->tbarPrint;
			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(752, 41);
			this->toolBar1->TabIndex = 43;
			this->toolBar1->ButtonClick += new System::Windows::Forms::ToolBarButtonClickEventHandler(this, toolBar1_ButtonClick);
			// 
			// tbarNew
			// 
			this->tbarNew->ImageIndex = 3;
			this->tbarNew->Text = S"新建";
			this->tbarNew->ToolTipText = S"新建";
			this->tbarNew->Visible = false;
			// 
			// tbarSearch
			// 
			this->tbarSearch->ImageIndex = 4;
			this->tbarSearch->Text = S"查看";
			this->tbarSearch->ToolTipText = S"查看";
			this->tbarSearch->Visible = false;
			// 
			// tbarSave
			// 
			this->tbarSave->ImageIndex = 0;
			this->tbarSave->Text = S"保存";
			this->tbarSave->ToolTipText = S"保存修改";
			// 
			// tbarDelete
			// 
			this->tbarDelete->ImageIndex = 1;
			this->tbarDelete->Text = S"删除";
			this->tbarDelete->ToolTipText = S"删除";
			// 
			// tbarPrint
			// 
			this->tbarPrint->ImageIndex = 6;
			this->tbarPrint->Text = S"打印";
			this->tbarPrint->ToolTipText = S"打印";
			// 
			// 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::Fuchsia;
			// 
			// dgrdImportTable
			// 
			this->dgrdImportTable->CaptionVisible = false;
			this->dgrdImportTable->DataMember = S"";
			this->dgrdImportTable->Dock = System::Windows::Forms::DockStyle::Fill;
			this->dgrdImportTable->HeaderForeColor = System::Drawing::SystemColors::ControlText;
			this->dgrdImportTable->Location = System::Drawing::Point(0, 176);
			this->dgrdImportTable->Name = S"dgrdImportTable";
			this->dgrdImportTable->Size = System::Drawing::Size(752, 181);
			this->dgrdImportTable->TabIndex = 42;
			this->dgrdImportTable->MouseHover += new System::EventHandler(this, dgrdImportTable_MouseHover);
			this->dgrdImportTable->MouseMove += new System::Windows::Forms::MouseEventHandler(this, dgrdImportTable_MouseMove);
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->label6);
			this->groupBox1->Controls->Add(this->tBoxStorage);
			this->groupBox1->Controls->Add(this->label5);
			this->groupBox1->Controls->Add(this->tBoxWareID);
			this->groupBox1->Controls->Add(this->tBoxStockerID);
			this->groupBox1->Controls->Add(this->button1);
			this->groupBox1->Controls->Add(this->label3);
			this->groupBox1->Controls->Add(this->cmbOperator);
			this->groupBox1->Controls->Add(this->label2);
			this->groupBox1->Controls->Add(this->tBoxMaker);
			this->groupBox1->Controls->Add(this->label1);
			this->groupBox1->Controls->Add(this->tBoxImportDate);
			this->groupBox1->Controls->Add(this->tBoxStockerName);
			this->groupBox1->Dock = System::Windows::Forms::DockStyle::Top;
			this->groupBox1->Location = System::Drawing::Point(0, 41);
			this->groupBox1->Name = S"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(752, 135);
			this->groupBox1->TabIndex = 44;
			this->groupBox1->TabStop = false;
			// 
			// label6
			// 
			this->label6->Location = System::Drawing::Point(270, 110);
			this->label6->Name = S"label6";
			this->label6->Size = System::Drawing::Size(57, 16);
			this->label6->TabIndex = 47;
			this->label6->Text = S"当前库存";
			// 
			// tBoxStorage
			// 
			this->tBoxStorage->Location = System::Drawing::Point(342, 109);
			this->tBoxStorage->Name = S"tBoxStorage";
			this->tBoxStorage->ReadOnly = true;
			this->tBoxStorage->Size = System::Drawing::Size(144, 21);
			this->tBoxStorage->TabIndex = 48;
			this->tBoxStorage->Text = S"";
			// 
			// label5
			// 
			this->label5->Location = System::Drawing::Point(26, 114);
			this->label5->Name = S"label5";
			this->label5->Size = System::Drawing::Size(57, 16);
			this->label5->TabIndex = 45;
			this->label5->Text = S"货号";
			// 
			// tBoxWareID
			// 
			this->tBoxWareID->Location = System::Drawing::Point(102, 109);
			this->tBoxWareID->Name = S"tBoxWareID";
			this->tBoxWareID->ReadOnly = true;
			this->tBoxWareID->Size = System::Drawing::Size(144, 21);
			this->tBoxWareID->TabIndex = 46;
			this->tBoxWareID->Text = S"";
			// 
			// tBoxStockerID
			// 
			this->tBoxStockerID->Location = System::Drawing::Point(102, 77);
			this->tBoxStockerID->Name = S"tBoxStockerID";
			this->tBoxStockerID->ReadOnly = true;
			this->tBoxStockerID->Size = System::Drawing::Size(144, 21);
			this->tBoxStockerID->TabIndex = 44;
			this->tBoxStockerID->Text = S"";
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(8, 76);
			this->button1->Name = S"button1";
			this->button1->Size = System::Drawing::Size(80, 24);
			this->button1->TabIndex = 43;
			this->button1->Text = S"选择供货商";
			this->button1->Click += new System::EventHandler(this, button1_Click);
			// 
			// label3
			// 
			this->label3->Location = System::Drawing::Point(478, 39);
			this->label3->Name = S"label3";
			this->label3->Size = System::Drawing::Size(57, 16);
			this->label3->TabIndex = 41;
			this->label3->Text = S"业务员";
			// 
			// cmbOperator
			// 
			this->cmbOperator->Location = System::Drawing::Point(546, 37);
			this->cmbOperator->Name = S"cmbOperator";
			this->cmbOperator->Size = System::Drawing::Size(176, 20);
			this->cmbOperator->TabIndex = 40;
			// 
			// label2
			// 
			this->label2->Location = System::Drawing::Point(270, 42);
			this->label2->Name = S"label2";
			this->label2->Size = System::Drawing::Size(57, 16);
			this->label2->TabIndex = 38;
			this->label2->Text = S"制单人";
			// 
			// tBoxMaker
			// 
			this->tBoxMaker->Location = System::Drawing::Point(334, 37);
			this->tBoxMaker->Name = S"tBoxMaker";
			this->tBoxMaker->Size = System::Drawing::Size(80, 21);
			this->tBoxMaker->TabIndex = 39;
			this->tBoxMaker->Text = S"";
			// 
			// label1
			// 
			this->label1->Location = System::Drawing::Point(22, 44);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(57, 16);
			this->label1->TabIndex = 36;
			this->label1->Text = S"进货日期";
			// 
			// tBoxImportDate
			// 
			this->tBoxImportDate->Location = System::Drawing::Point(102, 38);
			this->tBoxImportDate->Name = S"tBoxImportDate";
			this->tBoxImportDate->Size = System::Drawing::Size(144, 21);
			this->tBoxImportDate->TabIndex = 37;
			this->tBoxImportDate->Text = S"";
			// 
			// tBoxStockerName
			// 
			this->tBoxStockerName->Location = System::Drawing::Point(270, 77);
			this->tBoxStockerName->Name = S"tBoxStockerName";
			this->tBoxStockerName->ReadOnly = true;
			this->tBoxStockerName->Size = System::Drawing::Size(448, 21);
			this->tBoxStockerName->TabIndex = 42;
			this->tBoxStockerName->Text = S"";
			// 
			// StockTable
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
			this->ClientSize = System::Drawing::Size(752, 453);
			this->Controls->Add(this->dgrdImportTable);
			this->Controls->Add(this->groupBox1);
			this->Controls->Add(this->toolBar1);
			this->Controls->Add(this->groupBox2);
			this->Name = S"StockTable";
			this->Text = S"进货单";
			this->groupBox2->ResumeLayout(false);
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->dgrdImportTable))->EndInit();
			this->groupBox1->ResumeLayout(false);
			this->ResumeLayout(false);

		}		
		//--------------------成员方法------------------------
	private:
		//-------------------设置供货商号和供货商名称--------------------------
		void SetStocker()
		{
			StokerDataManage* tempFrm = new StokerDataManage(false);
			tempFrm->SetDataGridReadOnly(true);	
			if(tempFrm->ShowDialog(this) == DialogResult::OK)
			{
				this->InputStockerID = tempFrm->SendStockerID;
				this->InputStockerName = tempFrm->SendStockerName;
				this->tBoxStockerID->Text = String::Format(S"供货商号:{0}",this->InputStockerID);
				this->tBoxStockerName->Text = String::Format(S"供货商:{0}",this->InputStockerName);
			}
		}
		//-------------------向业务员下拉列表框中添加选项---------------------
		void SetcmbOperator()
		{
			DateTime tempDate = System::DateTime::Today;
			this->tBoxImportDate->Text = tempDate.ToShortDateString();
			String* tempSQL = "select distinct 姓名 from 用户清单";
			DataSet* tempDataSet = this->MyDataBase->SelectDataBase(tempSQL);
			DataTable* tempDataTable = tempDataSet->Tables->Item[0];

			this->cmbOperator->DataSource = tempDataTable;
			this->cmbOperator->DisplayMember = S"姓名";
			this->cmbOperator->ValueMember = S"姓名";
			this->cmbOperator->SelectedIndex = 0;
		}
		//------------------绑定数据并设置明细表格各列的属性------------------
		void DataGridStateControl(int isModifiable)
		{

			DataGridTableStyle* ts = new DataGridTableStyle();
			//必须填写,否则样式表不起作用
			ts->MappingName = this->ds->Tables->Item[S"进货单明细"]->TableName;			
			ts->AllowSorting = false;
			ts->AlternatingBackColor = Color::LightGray;
			
	
			//设置进货单号
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[1]->DefaultValue = intImportID.ToString();			
            //设置编号
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[0]->DefaultValue = S"自动";	
			//设置扣率
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[6]->DefaultValue = __box(1);
			//设置进价
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[8]->Expression = S"税价合计 - 税额";
			//设置税率
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[7]->DefaultValue = __box(0.15);
			//设置税额
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[9]->Expression = S"税价合计 * 税率";
			//设置税价合计
			this->ds->Tables->Item[S"进货单明细"]->Columns->Item[5]->Expression = S"(进货数量 * 进价) * 扣率";

			//设置库存
			this->ds->Tables->Item[S"库存"]->Columns->Item[S"库存金额"]->Expression = S"库存数量 * 库存单价";
			

			int numCols = this->ds->Tables->Item[S"进货单明细"]->Columns->Count;
			if(isModifiable)
			{
				DataGridTextBoxColumn* aColumnTextColumn;
				for(int i = 0;i < numCols;i++)
				{				
					aColumnTextColumn = new DataGridTextBoxColumn();				

⌨️ 快捷键说明

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