commonrepairform.h

来自「小区物业管理系统」· C头文件 代码 · 共 932 行 · 第 1/4 页

H
932
字号
			this->财产名称ComboBox->ValueMember = L"财产编号";
			this->财产名称ComboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &CommonRepairForm::财产名称ComboBox_SelectedIndexChanged);
			// 
			// 公共财产BindingSource
			// 
			this->公共财产BindingSource->DataMember = L"公共财产";
			this->公共财产BindingSource->DataSource = this->DBCommunityDataSet;
			// 
			// 报修日期DateTimePicker
			// 
			this->报修日期DateTimePicker->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Value", this->公共维修BindingSource, L"报修日期", 
				true)));
			this->报修日期DateTimePicker->Location = System::Drawing::Point(67, 49);
			this->报修日期DateTimePicker->Name = L"报修日期DateTimePicker";
			this->报修日期DateTimePicker->Size = System::Drawing::Size(139, 21);
			this->报修日期DateTimePicker->TabIndex = 42;
			// 
			// 报修人员TextBox
			// 
			this->报修人员TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"报修人员", true)));
			this->报修人员TextBox->Location = System::Drawing::Point(273, 49);
			this->报修人员TextBox->Name = L"报修人员TextBox";
			this->报修人员TextBox->Size = System::Drawing::Size(87, 21);
			this->报修人员TextBox->TabIndex = 44;
			// 
			// 财产编号TextBox
			// 
			this->财产编号TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"财产编号", true)));
			this->财产编号TextBox->Location = System::Drawing::Point(246, 24);
			this->财产编号TextBox->Name = L"财产编号TextBox";
			this->财产编号TextBox->ReadOnly = true;
			this->财产编号TextBox->Size = System::Drawing::Size(99, 21);
			this->财产编号TextBox->TabIndex = 38;
			// 
			// 维修编号TextBox
			// 
			this->维修编号TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"维修编号", true)));
			this->维修编号TextBox->Location = System::Drawing::Point(67, 24);
			this->维修编号TextBox->Name = L"维修编号TextBox";
			this->维修编号TextBox->Size = System::Drawing::Size(113, 21);
			this->维修编号TextBox->TabIndex = 36;
			// 
			// 故障现象TextBox
			// 
			this->故障现象TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"故障现象", true)));
			this->故障现象TextBox->Location = System::Drawing::Point(67, 74);
			this->故障现象TextBox->Name = L"故障现象TextBox";
			this->故障现象TextBox->Size = System::Drawing::Size(469, 21);
			this->故障现象TextBox->TabIndex = 46;
			// 
			// 受理人员TextBox
			// 
			this->受理人员TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"受理人员", true)));
			this->受理人员TextBox->Location = System::Drawing::Point(431, 49);
			this->受理人员TextBox->Name = L"受理人员TextBox";
			this->受理人员TextBox->Size = System::Drawing::Size(105, 21);
			this->受理人员TextBox->TabIndex = 48;
			// 
			// 处理意见TextBox
			// 
			this->处理意见TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"处理意见", true)));
			this->处理意见TextBox->Location = System::Drawing::Point(67, 99);
			this->处理意见TextBox->Name = L"处理意见TextBox";
			this->处理意见TextBox->Size = System::Drawing::Size(469, 21);
			this->处理意见TextBox->TabIndex = 50;
			// 
			// 修理日期DateTimePicker
			// 
			this->修理日期DateTimePicker->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Value", this->公共维修BindingSource, L"修理日期", 
				true)));
			this->修理日期DateTimePicker->Location = System::Drawing::Point(67, 124);
			this->修理日期DateTimePicker->Name = L"修理日期DateTimePicker";
			this->修理日期DateTimePicker->Size = System::Drawing::Size(113, 21);
			this->修理日期DateTimePicker->TabIndex = 52;
			// 
			// 修理人员TextBox
			// 
			this->修理人员TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"修理人员", true)));
			this->修理人员TextBox->Location = System::Drawing::Point(244, 124);
			this->修理人员TextBox->Name = L"修理人员TextBox";
			this->修理人员TextBox->Size = System::Drawing::Size(67, 21);
			this->修理人员TextBox->TabIndex = 54;
			// 
			// 修理费用TextBox
			// 
			this->修理费用TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"修理费用", true)));
			this->修理费用TextBox->Location = System::Drawing::Point(374, 124);
			this->修理费用TextBox->Name = L"修理费用TextBox";
			this->修理费用TextBox->Size = System::Drawing::Size(47, 21);
			this->修理费用TextBox->TabIndex = 56;
			// 
			// 材料费用TextBox
			// 
			this->材料费用TextBox->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->公共维修BindingSource, L"材料费用", true)));
			this->材料费用TextBox->Location = System::Drawing::Point(486, 124);
			this->材料费用TextBox->Name = L"材料费用TextBox";
			this->材料费用TextBox->Size = System::Drawing::Size(50, 21);
			this->材料费用TextBox->TabIndex = 58;
			// 
			// 公共财产TableAdapter
			// 
			this->公共财产TableAdapter->ClearBeforeFill = true;
			// 
			// CommonRepairForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(542, 416);
			this->Controls->Add(this->公共维修DataGridView);
			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(修理日期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->补充说明TextBox);
			this->Controls->Add(this->修理结果TextBox);
			this->Controls->Add(this->财产名称ComboBox);
			this->Controls->Add(this->报修日期DateTimePicker);
			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->修理日期DateTimePicker);
			this->Controls->Add(this->修理人员TextBox);
			this->Controls->Add(this->修理费用TextBox);
			this->Controls->Add(this->材料费用TextBox);
			this->Controls->Add(this->公共维修BindingNavigator);
			this->Name = L"CommonRepairForm";
			this->ShowInTaskbar = false;
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
			this->Text = L"物业管理[公共维修管理]";
			this->Load += gcnew System::EventHandler(this, &CommonRepairForm::CommonRepairForm_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->DBCommunityDataSet))->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->公共财产BindingSource))->EndInit();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	public: String^ MyCommunity;
	private: System::Void CommonRepairForm_Load(System::Object^  sender, System::EventArgs^  e) 
	{// TODO: 这行代码将数据加载到表“DBCommunityDataSet.公共财产”中
	  this->公共财产TableAdapter->FillByUsing(this->DBCommunityDataSet->公共财产);
	  try
	  {
   	    this->公共维修TableAdapter->Fill(this->DBCommunityDataSet->公共维修, 维修编号ToolStripTextBox->Text);
	  }
	  catch (System::Exception^ ex) 
	  {
		 System::Windows::Forms::MessageBox::Show(ex->Message);
	  }
	}
	private: System::Void 公共维修BindingNavigatorSaveItem_Click(System::Object^  sender, System::EventArgs^  e) 
	{
	  this->Validate();
	  this->公共维修BindingSource->EndEdit();
	  this->公共维修TableAdapter->Update(this->DBCommunityDataSet->公共维修);
	}
	private: System::Void 查询ToolStripButton_Click(System::Object^  sender, System::EventArgs^  e) 
	{
	  try 
	  {
		 this->公共维修TableAdapter->Fill(this->DBCommunityDataSet->公共维修, 维修编号ToolStripTextBox->Text);
	  }
	  catch (System::Exception^ ex) 
	  {
		 System::Windows::Forms::MessageBox::Show(ex->Message);
	  }
	}
	private: System::Void 财产名称ComboBox_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) 
	{
	  if (this->财产名称ComboBox->SelectedValue->ToString() != "System.Data.DataRowView")
      {
         this->财产编号TextBox->Text = this->财产名称ComboBox->SelectedValue->ToString();
      }
	}
	private: System::Void 打印ToolStripButton_Click(System::Object^  sender, System::EventArgs^  e) 
	{//打印公共财产维修单
      this->printPreviewDialog1->Document = this->printDocument1;
      this->printPreviewDialog1->ShowDialog();
	}
	private: System::Void printDocument1_PrintPage(System::Object^  sender, System::Drawing::Printing::PrintPageEventArgs^  e) 
	{
	  e->Graphics->DrawString(this->MyCommunity + "公共财产维修单", gcnew System::Drawing::Font("宋体", 20), Brushes::Black, 200, 90);
      e->Graphics->DrawString("维修编号:" + this->公共维修DataGridView->CurrentRow->Cells[0]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 145);
	  e->Graphics->DrawString("打印日期:" + DateTime::Now.ToLongDateString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 550, 145);
      e->Graphics->DrawLine(gcnew Pen(Color::Black,(float)3.00), 100, 165, 720, 165);
      e->Graphics->DrawString("财产编号:" + this->公共维修DataGridView->CurrentRow->Cells[1]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 175);
      e->Graphics->DrawString("财产名称:" + this->公共维修DataGridView->CurrentRow->Cells[2]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 300, 175);
      e->Graphics->DrawString("报修日期:" + DateTime::Parse(this->公共维修DataGridView->CurrentRow->Cells[3]->Value->ToString()).ToShortDateString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 550, 175);
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 195, 720, 195);
      e->Graphics->DrawString("报修人员:" + this->公共维修DataGridView->CurrentRow->Cells[4]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 200);
      e->Graphics->DrawString("受理人员:" + this->公共维修DataGridView->CurrentRow->Cells[6]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 300, 200);
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 220, 720, 220);
      e->Graphics->DrawString("故障现象:" , gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 225);
      e->Graphics->DrawString(this->公共维修DataGridView->CurrentRow->Cells[5]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, RectangleF(110,245,620,90));
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 335, 720, 335);
      e->Graphics->DrawString("处理意见:", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 340);
      e->Graphics->DrawString(this->公共维修DataGridView->CurrentRow->Cells[7]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, RectangleF(110, 360, 620, 90));
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 450, 720, 450);
      e->Graphics->DrawString("修理日期:" + DateTime::Parse(this->公共维修DataGridView->CurrentRow->Cells[8]->Value->ToString()).ToShortDateString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 455);
      e->Graphics->DrawString("修理人员:" + this->公共维修DataGridView->CurrentRow->Cells[9]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 250, 455);
      e->Graphics->DrawString("修理费用:" + this->公共维修DataGridView->CurrentRow->Cells[10]->Value->ToString()+"元", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 370, 455);
      e->Graphics->DrawString("材料费用:" + this->公共维修DataGridView->CurrentRow->Cells[11]->Value->ToString() + "元", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 480, 455);
      double My费用合计 = Convert::ToDouble(this->公共维修DataGridView->CurrentRow->Cells[10]->Value->ToString()) + Convert::ToDouble(this->公共维修DataGridView->CurrentRow->Cells[11]->Value->ToString());
      e->Graphics->DrawString("费用合计:" + My费用合计.ToString() + "元", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 590, 455);
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 475, 720, 475);
      e->Graphics->DrawString("修理结果:", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 480);
      e->Graphics->DrawString(this->公共维修DataGridView->CurrentRow->Cells[12]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, RectangleF(110, 500, 620, 240));
      e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 765, 720, 765);
      e->Graphics->DrawString("补充说明:", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 770);
      e->Graphics->DrawString(this->公共维修DataGridView->CurrentRow->Cells[13]->Value->ToString(), gcnew System::Drawing::Font("宋体", 10), Brushes::Black, RectangleF(110, 790, 620, 205));
      e->Graphics->DrawLine(gcnew Pen(Color::Black, (float)3.00), 100, 1000, 720, 1000);            
	}
  };
}

⌨️ 快捷键说明

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