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

📄 archievementform.h

📁 这是一个用VC++编写的人事工资管理系统,开发平台为VS2005,是开发企业管理程序的程序员的很好参考!
💻 H
📖 第 1 页 / 共 3 页
字号:
			// 专长描述RichTextBox
			// 
			this->专长描述RichTextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->工作业绩BindingSource, L"专长描述", true)));
			this->专长描述RichTextBox->Location = System::Drawing::Point(428, 126);
			this->专长描述RichTextBox->Name = L"专长描述RichTextBox";
			this->专长描述RichTextBox->Size = System::Drawing::Size(109, 75);
			this->专长描述RichTextBox->TabIndex = 48;
			this->专长描述RichTextBox->Text = L"";
			// 
			// 说明Label
			// 
			说明Label->AutoSize = true;
			说明Label->Location = System::Drawing::Point(2, 210);
			说明Label->Name = L"说明Label";
			说明Label->Size = System::Drawing::Size(35, 12);
			说明Label->TabIndex = 49;
			说明Label->Text = L"说明:";
			// 
			// 说明TextBox
			// 
			this->说明TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->工作业绩BindingSource, L"说明", true)));
			this->说明TextBox->Location = System::Drawing::Point(43, 207);
			this->说明TextBox->Name = L"说明TextBox";
			this->说明TextBox->Size = System::Drawing::Size(494, 21);
			this->说明TextBox->TabIndex = 50;
			// 
			// 基本档案DataGridView
			// 
			this->基本档案DataGridView->AllowUserToAddRows = false;
			this->基本档案DataGridView->AllowUserToDeleteRows = false;
			this->基本档案DataGridView->AllowUserToResizeRows = false;
			this->基本档案DataGridView->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->基本档案DataGridView->BackgroundColor = System::Drawing::SystemColors::ActiveCaption;
			this->基本档案DataGridView->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
			this->基本档案DataGridView->Location = System::Drawing::Point(4, 29);
			this->基本档案DataGridView->MultiSelect = false;
			this->基本档案DataGridView->Name = L"基本档案DataGridView";
			this->基本档案DataGridView->ReadOnly = true;
			this->基本档案DataGridView->RowHeadersVisible = false;
			dataGridViewCellStyle1->BackColor = System::Drawing::Color::Green;
			dataGridViewCellStyle1->ForeColor = System::Drawing::Color::Yellow;
			this->基本档案DataGridView->RowsDefaultCellStyle = dataGridViewCellStyle1;
			this->基本档案DataGridView->RowTemplate->Height = 23;
			this->基本档案DataGridView->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
			this->基本档案DataGridView->Size = System::Drawing::Size(533, 93);
			this->基本档案DataGridView->TabIndex = 38;
			this->基本档案DataGridView->SelectionChanged += gcnew System::EventHandler(this, &ArchievementForm::基本档案DataGridView_SelectionChanged);
			this->基本档案DataGridView->Click += gcnew System::EventHandler(this, &ArchievementForm::基本档案DataGridView_Click);
			// 
			// 工作业绩DataGridView
			// 
			this->工作业绩DataGridView->AllowUserToAddRows = false;
			this->工作业绩DataGridView->AllowUserToDeleteRows = false;
			this->工作业绩DataGridView->AllowUserToResizeRows = false;
			this->工作业绩DataGridView->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 
				| System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->工作业绩DataGridView->AutoGenerateColumns = false;
			this->工作业绩DataGridView->BackgroundColor = System::Drawing::SystemColors::ActiveCaption;
			this->工作业绩DataGridView->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^  >(6) {this->dataGridViewTextBoxColumn1, 
				this->dataGridViewTextBoxColumn2, this->dataGridViewTextBoxColumn3, this->dataGridViewTextBoxColumn4, this->dataGridViewTextBoxColumn5, 
				this->dataGridViewTextBoxColumn6});
			this->工作业绩DataGridView->DataSource = this->工作业绩BindingSource;
			dataGridViewCellStyle2->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
			dataGridViewCellStyle2->BackColor = System::Drawing::Color::Green;
			dataGridViewCellStyle2->Font = (gcnew System::Drawing::Font(L"宋体", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			dataGridViewCellStyle2->ForeColor = System::Drawing::Color::Yellow;
			dataGridViewCellStyle2->SelectionBackColor = System::Drawing::SystemColors::Highlight;
			dataGridViewCellStyle2->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
			dataGridViewCellStyle2->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
			this->工作业绩DataGridView->DefaultCellStyle = dataGridViewCellStyle2;
			this->工作业绩DataGridView->Location = System::Drawing::Point(4, 233);
			this->工作业绩DataGridView->MultiSelect = false;
			this->工作业绩DataGridView->Name = L"工作业绩DataGridView";
			this->工作业绩DataGridView->RowHeadersVisible = false;
			this->工作业绩DataGridView->RowTemplate->Height = 23;
			this->工作业绩DataGridView->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
			this->工作业绩DataGridView->Size = System::Drawing::Size(533, 179);
			this->工作业绩DataGridView->TabIndex = 37;
			// 
			// ArchievementForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)), 
				static_cast<System::Int32>(static_cast<System::Byte>(192)));
			this->ClientSize = System::Drawing::Size(542, 416);
			this->Controls->Add(自编号Label);
			this->Controls->Add(this->自编号TextBox);
			this->Controls->Add(员工编号Label);
			this->Controls->Add(this->员工编号TextBox);
			this->Controls->Add(员工姓名Label);
			this->Controls->Add(this->员工姓名TextBox);
			this->Controls->Add(工作业绩Label);
			this->Controls->Add(this->工作业绩RichTextBox);
			this->Controls->Add(专长描述Label);
			this->Controls->Add(this->专长描述RichTextBox);
			this->Controls->Add(说明Label);
			this->Controls->Add(this->说明TextBox);
			this->Controls->Add(this->基本档案DataGridView);
			this->Controls->Add(this->工作业绩DataGridView);
			this->Controls->Add(this->工作业绩BindingNavigator);
			this->Name = L"ArchievementForm";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
			this->Text = L"员工工作业绩维护";
			this->Load += gcnew System::EventHandler(this, &ArchievementForm::ArchievementForm_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->MyPersonnelDataSet))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->工作业绩BindingSource))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->工作业绩BindingNavigator))->EndInit();
			this->工作业绩BindingNavigator->ResumeLayout(false);
			this->工作业绩BindingNavigator->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->基本档案DataGridView))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->工作业绩DataGridView))->EndInit();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
		private: static String^ MyPersonnelConnectionString= L"Data Source=.;Initial Catalog=MyPersonnel;Integrated Security=True;Pooling=False";
		private: System::Void 工作业绩BindingNavigatorSaveItem_Click(System::Object^  sender, System::EventArgs^  e) {
			 this->Validate();
			 this->工作业绩BindingSource->EndEdit();
			 this->工作业绩TableAdapter->Update(this->MyPersonnelDataSet->工作业绩);
		 }
		private: System::Void ArchievementForm_Load(System::Object^  sender, System::EventArgs^  e) {
			 // TODO: 这行代码将数据加载到表“MyPersonnelDataSet.工作业绩”中。您可以根据需要移动或移除它。
			 this->工作业绩TableAdapter->Fill(this->MyPersonnelDataSet->工作业绩);
		 }
		private: System::Void bindingNavigatorAddNewItem_Click(System::Object^  sender, System::EventArgs^  e) {
			//自动计算自编号
            String^ MySQLConnectionString = MyPersonnelConnectionString;
            SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
            MyConnection->Open();
            SqlCommand^ MyCommand = MyConnection->CreateCommand();
            MyCommand->CommandText = "Select max(自编号) 最大编号 From 工作业绩";
			System::Object^ MyResult = MyCommand->ExecuteScalar();
			System::Int64  MyID = 1;
			if (MyResult != System::DBNull::Value)
            {
                String^ MyMaxID = MyResult->ToString()->Trim();
                MyMaxID = MyMaxID->Substring(2, MyMaxID->Length - 2);
				MyID = Convert::ToInt64(MyMaxID) + 1;
            }
            int MyLength = MyID.ToString()->Length;
            String^ MyNewID = "";
            switch (MyLength)
            {
                case 1:
                    MyNewID = "YJ0000000" + MyID.ToString();
                    break;
                case 2:
                    MyNewID = "YJ000000" + MyID.ToString();
                    break;
                case 3:
                    MyNewID = "YJ00000" + MyID.ToString();
                    break;
                case 4:
                    MyNewID = "YJ0000" + MyID.ToString();
                    break;
                case 5:
                    MyNewID = "YJ000" + MyID.ToString();
                    break;
                case 6:
                    MyNewID = "YJ00" + MyID.ToString();
                    break;
                case 7:
                    MyNewID = "YJ0" + MyID.ToString();
                    break;
            }
            if (MyConnection->State == ConnectionState::Open)
            {
                MyConnection->Close();
            }
            this->自编号TextBox->Text = MyNewID;       
		}
		private: System::Void 查询ToolStripButton_Click(System::Object^  sender, System::EventArgs^  e) {
            String^ MySQLConnectionString = MyPersonnelConnectionString;
            SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
            MyConnection->Open();
            String^ MySQL = "Select * From 基本档案 Where 姓名 LIKE '" + this->员工姓名ToolStripTextBox->Text + "' AND (员工编号 NOT IN(SELECT 员工编号 FROM 离职管理))";
			System::Data::DataTable^ MyPersonnelTable = gcnew System::Data::DataTable();
            SqlDataAdapter^ MyDataAdapter = gcnew SqlDataAdapter(MySQL, MyConnection);
            MyDataAdapter->Fill(MyPersonnelTable);
            this->基本档案DataGridView->DataSource = MyPersonnelTable;
            if (MyConnection->State == ConnectionState::Open)
            {
                MyConnection->Close();
            }
		 }
		private: System::Void 基本档案DataGridView_Click(System::Object^  sender, System::EventArgs^  e) {
			this->员工编号TextBox->Text = this->基本档案DataGridView->CurrentRow->Cells[1]->Value->ToString();
            this->员工姓名TextBox->Text = this->基本档案DataGridView->CurrentRow->Cells[3]->Value->ToString();
		 }
		private: System::Void 基本档案DataGridView_SelectionChanged(System::Object^  sender, System::EventArgs^  e) {
	        String^ My员工姓名 = this->基本档案DataGridView->CurrentRow->Cells[3]->Value->ToString();
            try
            {
                this->工作业绩TableAdapter->FillBy(this->MyPersonnelDataSet->工作业绩, My员工姓名);
            }
			catch (System::Exception^ ex)
            {
				System::Windows::Forms::MessageBox::Show(ex->Message);
            }
		 }
};
}

⌨️ 快捷键说明

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