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

📄 insuranceform.h

📁 有关办公管理的系统
💻 H
📖 第 1 页 / 共 3 页
字号:
			// 
			this->保险额TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->财产投保管理BindingSource, L"保险额", true)));
			this->保险额TextBox->Location = System::Drawing::Point(201, 78);
			this->保险额TextBox->Name = L"保险额TextBox";
			this->保险额TextBox->Size = System::Drawing::Size(57, 21);
			this->保险额TextBox->TabIndex = 41;
			// 
			// 保险费TextBox
			// 
			this->保险费TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->财产投保管理BindingSource, L"保险费", true)));
			this->保险费TextBox->Location = System::Drawing::Point(316, 78);
			this->保险费TextBox->Name = L"保险费TextBox";
			this->保险费TextBox->Size = System::Drawing::Size(75, 21);
			this->保险费TextBox->TabIndex = 43;
			// 
			// 理赔电话TextBox
			// 
			this->理赔电话TextBox->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->理赔电话TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->财产投保管理BindingSource, L"理赔电话", true)));
			this->理赔电话TextBox->Location = System::Drawing::Point(462, 78);
			this->理赔电话TextBox->Name = L"理赔电话TextBox";
			this->理赔电话TextBox->Size = System::Drawing::Size(75, 21);
			this->理赔电话TextBox->TabIndex = 45;
			// 
			// 说明TextBox
			// 
			this->说明TextBox->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->说明TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->财产投保管理BindingSource, L"说明", true)));
			this->说明TextBox->Location = System::Drawing::Point(43, 105);
			this->说明TextBox->Name = L"说明TextBox";
			this->说明TextBox->Size = System::Drawing::Size(494, 21);
			this->说明TextBox->TabIndex = 47;
			// 
			// bindingNavigatorDeleteItem
			// 
			this->bindingNavigatorDeleteItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"bindingNavigatorDeleteItem.Image")));
			this->bindingNavigatorDeleteItem->Name = L"bindingNavigatorDeleteItem";
			this->bindingNavigatorDeleteItem->RightToLeftAutoMirrorImage = true;
			this->bindingNavigatorDeleteItem->Size = System::Drawing::Size(49, 22);
			this->bindingNavigatorDeleteItem->Text = L"删除";
			// 
			// bindingNavigatorAddNewItem
			// 
			this->bindingNavigatorAddNewItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"bindingNavigatorAddNewItem.Image")));
			this->bindingNavigatorAddNewItem->Name = L"bindingNavigatorAddNewItem";
			this->bindingNavigatorAddNewItem->RightToLeftAutoMirrorImage = true;
			this->bindingNavigatorAddNewItem->Size = System::Drawing::Size(49, 22);
			this->bindingNavigatorAddNewItem->Text = L"新增";
			this->bindingNavigatorAddNewItem->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &InsuranceForm::bindingNavigatorAddNewItem_MouseUp);
			// 
			// 开始日期ToolStripTextBox
			// 
			this->开始日期ToolStripTextBox->Name = L"开始日期ToolStripTextBox";
			this->开始日期ToolStripTextBox->Size = System::Drawing::Size(100, 25);
			this->开始日期ToolStripTextBox->Text = L"2000-1-1";
			// 
			// toolStripLabel1
			// 
			this->toolStripLabel1->Name = L"toolStripLabel1";
			this->toolStripLabel1->Size = System::Drawing::Size(59, 22);
			this->toolStripLabel1->Text = L"开始日期:";
			// 
			// 财产投保管理DataGridView
			// 
			this->财产投保管理DataGridView->AllowUserToAddRows = false;
			this->财产投保管理DataGridView->AllowUserToDeleteRows = 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->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
			this->财产投保管理DataGridView->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^  >(11) {this->dataGridViewTextBoxColumn1, 
				this->dataGridViewTextBoxColumn2, this->dataGridViewTextBoxColumn3, this->dataGridViewTextBoxColumn4, this->dataGridViewTextBoxColumn5, 
				this->dataGridViewTextBoxColumn6, this->dataGridViewTextBoxColumn7, this->dataGridViewTextBoxColumn8, this->dataGridViewTextBoxColumn9, 
				this->dataGridViewTextBoxColumn10, this->dataGridViewTextBoxColumn11});
			this->财产投保管理DataGridView->DataSource = this->财产投保管理BindingSource;
			this->财产投保管理DataGridView->Location = System::Drawing::Point(4, 131);
			this->财产投保管理DataGridView->MultiSelect = false;
			this->财产投保管理DataGridView->Name = L"财产投保管理DataGridView";
			this->财产投保管理DataGridView->ReadOnly = true;
			this->财产投保管理DataGridView->RowHeadersVisible = false;
			this->财产投保管理DataGridView->RowTemplate->Height = 23;
			this->财产投保管理DataGridView->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
			this->财产投保管理DataGridView->Size = System::Drawing::Size(533, 280);
			this->财产投保管理DataGridView->TabIndex = 25;
			// 
			// 财产投保管理BindingNavigator
			// 
			this->财产投保管理BindingNavigator->AddNewItem = this->bindingNavigatorAddNewItem;
			this->财产投保管理BindingNavigator->BindingSource = this->财产投保管理BindingSource;
			this->财产投保管理BindingNavigator->CountItem = nullptr;
			this->财产投保管理BindingNavigator->DeleteItem = this->bindingNavigatorDeleteItem;
			this->财产投保管理BindingNavigator->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(9) {this->toolStripLabel1, 
				this->开始日期ToolStripTextBox, this->toolStripLabel2, this->结束日期ToolStripTextBox, this->查询ToolStripButton, this->bindingNavigatorSeparator2, 
				this->bindingNavigatorAddNewItem, this->bindingNavigatorDeleteItem, this->财产投保管理BindingNavigatorSaveItem});
			this->财产投保管理BindingNavigator->Location = System::Drawing::Point(0, 0);
			this->财产投保管理BindingNavigator->MoveFirstItem = nullptr;
			this->财产投保管理BindingNavigator->MoveLastItem = nullptr;
			this->财产投保管理BindingNavigator->MoveNextItem = nullptr;
			this->财产投保管理BindingNavigator->MovePreviousItem = nullptr;
			this->财产投保管理BindingNavigator->Name = L"财产投保管理BindingNavigator";
			this->财产投保管理BindingNavigator->PositionItem = nullptr;
			this->财产投保管理BindingNavigator->Size = System::Drawing::Size(542, 25);
			this->财产投保管理BindingNavigator->TabIndex = 24;
			this->财产投保管理BindingNavigator->Text = L"bindingNavigator1";
			// 
			// InsuranceForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(542, 416);
			this->Controls->Add(自编号Label);
			this->Controls->Add(this->自编号TextBox);
			this->Controls->Add(日期Label);
			this->Controls->Add(this->日期DateTimePicker);
			this->Controls->Add(保险公司Label);
			this->Controls->Add(this->保险公司TextBox);
			this->Controls->Add(this->保单号码TextBox);
			this->Controls->Add(this->保险物品TextBox);
			this->Controls->Add(this->存放部门TextBox);
			this->Controls->Add(this->保险期限TextBox);
			this->Controls->Add(this->保险额TextBox);
			this->Controls->Add(this->保险费TextBox);
			this->Controls->Add(this->理赔电话TextBox);
			this->Controls->Add(this->说明TextBox);
			this->Controls->Add(保单号码Label);
			this->Controls->Add(保险物品Label);
			this->Controls->Add(存放部门Label);
			this->Controls->Add(保险期限Label);
			this->Controls->Add(保险额Label);
			this->Controls->Add(保险费Label);
			this->Controls->Add(理赔电话Label);
			this->Controls->Add(说明Label);
			this->Controls->Add(this->财产投保管理DataGridView);
			this->Controls->Add(this->财产投保管理BindingNavigator);
			this->Name = L"InsuranceForm";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
			this->Text = L"财产投保管理";
			this->Load += gcnew System::EventHandler(this, &InsuranceForm::InsuranceForm_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->MyOfficeDataSet))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->财产投保管理BindingSource))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->财产投保管理DataGridView))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->财产投保管理BindingNavigator))->EndInit();
			this->财产投保管理BindingNavigator->ResumeLayout(false);
			this->财产投保管理BindingNavigator->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
		private: static String^ MyOfficeConnectionString= L"Data Source=.;Initial Catalog=MyOffice;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->MyOfficeDataSet->财产投保管理);
		 }
		private: System::Void InsuranceForm_Load(System::Object^  sender, System::EventArgs^  e) {
			 // TODO: 这行代码将数据加载到表“MyOfficeDataSet.财产投保管理”中。您可以根据需要移动或移除它。
			 this->财产投保管理TableAdapter->Fill(this->MyOfficeDataSet->财产投保管理);
		 }
		private: System::Void 查询ToolStripButton_Click(System::Object^  sender, System::EventArgs^  e) {
			 try 
			 {
				 this->财产投保管理TableAdapter->FillBy(this->MyOfficeDataSet->财产投保管理, System::Nullable<System::DateTime >((*cli::safe_cast<System::DateTime^>(System::Convert::ChangeType(开始日期ToolStripTextBox->Text, 
					 System::DateTime::typeid)))), System::Nullable<System::DateTime >((*cli::safe_cast<System::DateTime^>(System::Convert::ChangeType(结束日期ToolStripTextBox->Text, System::DateTime::typeid)))));
			 }
			 catch (System::Exception^ ex) 
			 {
				 System::Windows::Forms::MessageBox::Show(ex->Message);
			 }
		 }
		private: System::Void bindingNavigatorAddNewItem_MouseUp(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
            //自动计算自编号            
            String^ MySQLConnectionString = MyOfficeConnectionString;
            SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
            MyConnection->Open();
            String^ MySQL = "Select max(自编号) 自编号 From 财产投保管理";
            SqlCommand^ MyCommand = gcnew SqlCommand(MySQL, MyConnection);
			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 = "TB0000000" + MyID.ToString();
                    break;
                case 2:
                    MyNewID = "TB000000" + MyID.ToString();
                    break;
                case 3:
                    MyNewID = "TB00000" + MyID.ToString();
                    break;
                case 4:
                    MyNewID = "TB0000" + MyID.ToString();
                    break;
                case 5:
                    MyNewID = "TB000" + MyID.ToString();
                    break;
                case 6:
                    MyNewID = "TB00" + MyID.ToString();
                    break;
                case 7:
                    MyNewID = "TB0" + MyID.ToString();
                    break;
            }
			if(MyConnection->State==ConnectionState::Open)
			{
				MyConnection->Close();
			}
            this->自编号TextBox->Text = MyNewID;
		 }
	};
}

⌨️ 快捷键说明

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