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

📄 hortationmanage.h

📁 Visual C++.net数据库开发经典案例
💻 H
📖 第 1 页 / 共 2 页
字号:
			this->groupBox1->Controls->Add(this->label1);
			this->groupBox1->Controls->Add(this->tBoxIsInSalary);
			this->groupBox1->Controls->Add(this->tBoxBonusDate);
			this->groupBox1->Controls->Add(this->tBoxBonus);
			this->groupBox1->Controls->Add(this->tBoxBonusType);
			this->groupBox1->Controls->Add(this->tBoxStaffID);
			this->groupBox1->Dock = System::Windows::Forms::DockStyle::Fill;
			this->groupBox1->Location = System::Drawing::Point(0, 41);
			this->groupBox1->Name = S"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(552, 300);
			this->groupBox1->TabIndex = 2;
			this->groupBox1->TabStop = false;
			// 
			// label4
			// 
			this->label4->Location = System::Drawing::Point(144, 112);
			this->label4->Name = S"label4";
			this->label4->Size = System::Drawing::Size(56, 16);
			this->label4->TabIndex = 46;
			this->label4->Text = S"奖励日期";
			// 
			// label3
			// 
			this->label3->Location = System::Drawing::Point(48, 112);
			this->label3->Name = S"label3";
			this->label3->Size = System::Drawing::Size(56, 16);
			this->label3->TabIndex = 45;
			this->label3->Text = S"奖励金额";
			// 
			// label12
			// 
			this->label12->Location = System::Drawing::Point(296, 168);
			this->label12->Name = S"label12";
			this->label12->Size = System::Drawing::Size(56, 16);
			this->label12->TabIndex = 44;
			this->label12->Text = S"部门意见";
			// 
			// label11
			// 
			this->label11->Location = System::Drawing::Point(48, 168);
			this->label11->Name = S"label11";
			this->label11->Size = System::Drawing::Size(56, 16);
			this->label11->TabIndex = 43;
			this->label11->Text = S"奖励原因";
			// 
			// label9
			// 
			this->label9->Location = System::Drawing::Point(328, 112);
			this->label9->Name = S"label9";
			this->label9->Size = System::Drawing::Size(96, 16);
			this->label9->TabIndex = 42;
			this->label9->Text = S"是否计入工资";
			// 
			// label2
			// 
			this->label2->Location = System::Drawing::Point(144, 56);
			this->label2->Name = S"label2";
			this->label2->Size = System::Drawing::Size(56, 16);
			this->label2->TabIndex = 41;
			this->label2->Text = S"奖励类型";
			// 
			// tBoxDepartmentComment
			// 
			this->tBoxDepartmentComment->Location = System::Drawing::Point(296, 192);
			this->tBoxDepartmentComment->Name = S"tBoxDepartmentComment";
			this->tBoxDepartmentComment->Size = System::Drawing::Size(208, 21);
			this->tBoxDepartmentComment->TabIndex = 40;
			this->tBoxDepartmentComment->Text = S"";
			// 
			// tBoxCause
			// 
			this->tBoxCause->Location = System::Drawing::Point(48, 192);
			this->tBoxCause->Name = S"tBoxCause";
			this->tBoxCause->Size = System::Drawing::Size(224, 21);
			this->tBoxCause->TabIndex = 39;
			this->tBoxCause->Text = S"";
			// 
			// label1
			// 
			this->label1->Location = System::Drawing::Point(48, 56);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(56, 16);
			this->label1->TabIndex = 38;
			this->label1->Text = S"职员编号";
			// 
			// tBoxIsInSalary
			// 
			this->tBoxIsInSalary->Location = System::Drawing::Point(328, 136);
			this->tBoxIsInSalary->Name = S"tBoxIsInSalary";
			this->tBoxIsInSalary->Size = System::Drawing::Size(176, 21);
			this->tBoxIsInSalary->TabIndex = 37;
			this->tBoxIsInSalary->Text = S"";
			// 
			// tBoxBonusDate
			// 
			this->tBoxBonusDate->Location = System::Drawing::Point(144, 136);
			this->tBoxBonusDate->Name = S"tBoxBonusDate";
			this->tBoxBonusDate->Size = System::Drawing::Size(152, 21);
			this->tBoxBonusDate->TabIndex = 36;
			this->tBoxBonusDate->Text = S"";
			// 
			// tBoxBonus
			// 
			this->tBoxBonus->Location = System::Drawing::Point(48, 136);
			this->tBoxBonus->Name = S"tBoxBonus";
			this->tBoxBonus->Size = System::Drawing::Size(80, 21);
			this->tBoxBonus->TabIndex = 35;
			this->tBoxBonus->Text = S"";
			// 
			// tBoxBonusType
			// 
			this->tBoxBonusType->Location = System::Drawing::Point(144, 80);
			this->tBoxBonusType->Name = S"tBoxBonusType";
			this->tBoxBonusType->Size = System::Drawing::Size(360, 21);
			this->tBoxBonusType->TabIndex = 34;
			this->tBoxBonusType->Text = S"";
			// 
			// tBoxStaffID
			// 
			this->tBoxStaffID->Location = System::Drawing::Point(48, 80);
			this->tBoxStaffID->Name = S"tBoxStaffID";
			this->tBoxStaffID->Size = System::Drawing::Size(80, 21);
			this->tBoxStaffID->TabIndex = 33;
			this->tBoxStaffID->Text = S"";
			// 
			// HortationManage
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
			this->ClientSize = System::Drawing::Size(552, 341);
			this->Controls->Add(this->groupBox1);
			this->Controls->Add(this->toolBar1);
			this->Name = S"HortationManage";
			this->Text = S"职员奖励管理";
			this->groupBox1->ResumeLayout(false);
			this->ResumeLayout(false);

		}				
		//------------------设置数据绑定----------------------
        void DataBidings()
		{
			this->tBoxStaffID->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"职员编号");
			this->tBoxBonusType->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"奖励类型");
			this->tBoxBonus->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"奖励金额");
			this->tBoxBonusDate->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"奖励日期");
			this->tBoxIsInSalary->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"是否计入工资");
			this->tBoxCause->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"奖励原因");
			this->tBoxDepartmentComment->DataBindings->Add("Text",this->ds->Tables->Item[S"职员奖励表"],"部门意见");
			
		}
	private: 
		System::Void toolBar1_ButtonClick(System::Object *  sender, System::Windows::Forms::ToolBarButtonClickEventArgs *  e)
		 {
			 if(String::Compare(e->Button->ToolTipText->Trim(),S"首记录") == 0)
			 {				 
				 this->cmHortation->Position = 0;	
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"上一记录") == 0)
			 {
				 if(this->cmHortation->Position > 0)
				 {					
					 this->cmHortation->Position--;
				 }
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"下一记录") == 0)
			 {
				 if(this->cmHortation->Position < this->cmHortation->Count - 1)
				 {				
					 this->cmHortation->Position++;
				 }
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"尾记录") == 0)
			 {
				 this->cmHortation->Position = this->cmHortation->Count - 1;
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"新增记录") == 0)
			 {
				 //检查新记录
				 if(this->tBoxStaffID->Text->Trim() == S"")
				 {
					 MessageBox::Show(S"职员编号不能为空",S"提示");
					 return;
				 }				
				 //提交修改
				 this->cmHortation->AddNew();				 
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"删除记录") == 0)
			 {
				 //修改数据库
				 String* tempSQL = String::Format(S"Delete from 职员奖励表 where 职员编号 = '{0}' AND 奖励类型 = '{1}' AND 奖励日期 = '{2}'",this->tBoxStaffID->Text,this->tBoxBonusType->Text,this->tBoxBonusDate->Text);
				 this->MyDataBase->SQLOperate(tempSQL);
				 //修改数据集
				 this->cmHortation->RemoveAt(this->cmHortation->Position);
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"保存修改") == 0)
			 {
				 //检查新记录
				 if(this->tBoxStaffID->Text->Trim() == S"")
				 {
					 MessageBox::Show(S"职员编号不能为空",S"提示");
					 return;
				 }
				 if(this->tBoxBonus->Text->Trim() == S"")
				 {
					 MessageBox::Show(S"奖励金额不能为空!",S"提示");
					 return;
				 }
				 //提交修改
				 this->cmHortation->EndCurrentEdit();
				 //更新数据库
				 this->MyDataBase->UpdateDataBase(this->ds,S"职员奖励表");
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"取消修改") == 0)
			 {
				 this->cmHortation->CancelCurrentEdit();
			 }
			 else if(String::Compare(e->Button->ToolTipText->Trim(),S"退出") == 0)
			 {
				 this->Close();
			 }
		}

};
}

⌨️ 快捷键说明

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