184 lines
5.9 KiB
C#
184 lines
5.9 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
|
|
namespace LP;
|
|
|
|
public class FormFangLeiGaiZao : Form
|
|
{
|
|
private delegate void delegateFormSetTitle(Form form, string value);
|
|
|
|
public FormDesktop desktop = null;
|
|
|
|
public string mTitle = "";
|
|
|
|
public TaskData mtData = null;
|
|
|
|
private IContainer components = null;
|
|
|
|
private Button buttonGaiZaoTuiJian;
|
|
|
|
private Button buttonGaoFengXianYuanYin;
|
|
|
|
private Button buttonGaiZaoTuiJian_FeiJianXian;
|
|
|
|
public FormFangLeiGaiZao()
|
|
{
|
|
InitializeComponent();
|
|
if (mtData == null)
|
|
{
|
|
mtData = new TaskData();
|
|
}
|
|
mTitle = "防雷改造";
|
|
}
|
|
|
|
private void FormFangLeiGaiZao_Load(object sender, EventArgs e)
|
|
{
|
|
MyFormSetTitle(this, "");
|
|
}
|
|
|
|
private void FormFangLeiGaiZao_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
}
|
|
|
|
public void MyInput_TaskData()
|
|
{
|
|
mtData.copyFrom_TaskData(desktop.mGaiZao_TaskData);
|
|
}
|
|
|
|
public void MyOutput_TaskData()
|
|
{
|
|
desktop.mGaiZao_TaskData.copyFrom_TaskData(mtData);
|
|
}
|
|
|
|
public void Destroy()
|
|
{
|
|
if (mtData != null)
|
|
{
|
|
mtData.Destroy();
|
|
}
|
|
mtData = null;
|
|
mTitle = "";
|
|
}
|
|
|
|
private void buttonGaoFengXianYuanYin_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult dialogResult = DialogResult.None;
|
|
dialogResult = desktop.mDlg_GaoFengXianYuanYin.ShowDialog(this);
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
}
|
|
}
|
|
|
|
private void MyThread_SendTaskData()
|
|
{
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
if (desktop.mAddTaskData.mID_Task <= 0)
|
|
{
|
|
break;
|
|
}
|
|
Thread.Sleep(1000);
|
|
}
|
|
desktop.mAddTaskData.copyFrom_TaskData(mtData);
|
|
desktop.MySendForm_TaskData(desktop, desktop.mAddTaskData);
|
|
}
|
|
|
|
private void buttonGaiZaoTuiJian_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult dialogResult = DialogResult.None;
|
|
desktop.mDlg_5CuoShiTuiJian.mb_FeiJianXian = false;
|
|
dialogResult = desktop.mDlg_5CuoShiTuiJian.ShowDialog(this);
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
Thread thread = new Thread(MyThread_SendTaskData);
|
|
thread.Start();
|
|
}
|
|
}
|
|
|
|
private void buttonGaiZaoTuiJian_FeiJianXian_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult dialogResult = DialogResult.None;
|
|
desktop.mDlg_5CuoShiTuiJian.mb_FeiJianXian = true;
|
|
dialogResult = desktop.mDlg_5CuoShiTuiJian.ShowDialog(this);
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
Thread thread = new Thread(MyThread_SendTaskData);
|
|
thread.Start();
|
|
}
|
|
}
|
|
|
|
public void MyFormSetTitle(Form form, string value)
|
|
{
|
|
if (form.InvokeRequired)
|
|
{
|
|
delegateFormSetTitle method = MyFormSetTitle;
|
|
form.Invoke(method, form, value);
|
|
return;
|
|
}
|
|
if (string.IsNullOrEmpty(value))
|
|
{
|
|
form.Text = mTitle;
|
|
}
|
|
if (!string.IsNullOrEmpty(value))
|
|
{
|
|
form.Text = mTitle + " —— " + value;
|
|
}
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.buttonGaiZaoTuiJian = new System.Windows.Forms.Button();
|
|
this.buttonGaoFengXianYuanYin = new System.Windows.Forms.Button();
|
|
this.buttonGaiZaoTuiJian_FeiJianXian = new System.Windows.Forms.Button();
|
|
base.SuspendLayout();
|
|
this.buttonGaiZaoTuiJian.Font = new System.Drawing.Font("宋体", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
|
this.buttonGaiZaoTuiJian.Location = new System.Drawing.Point(169, 26);
|
|
this.buttonGaiZaoTuiJian.Name = "buttonGaiZaoTuiJian";
|
|
this.buttonGaiZaoTuiJian.Size = new System.Drawing.Size(126, 40);
|
|
this.buttonGaiZaoTuiJian.TabIndex = 1;
|
|
this.buttonGaiZaoTuiJian.Text = "改造措施推荐";
|
|
this.buttonGaiZaoTuiJian.UseVisualStyleBackColor = true;
|
|
this.buttonGaiZaoTuiJian.Click += new System.EventHandler(buttonGaiZaoTuiJian_Click);
|
|
this.buttonGaoFengXianYuanYin.Font = new System.Drawing.Font("宋体", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
|
this.buttonGaoFengXianYuanYin.Location = new System.Drawing.Point(26, 26);
|
|
this.buttonGaoFengXianYuanYin.Name = "buttonGaoFengXianYuanYin";
|
|
this.buttonGaoFengXianYuanYin.Size = new System.Drawing.Size(126, 40);
|
|
this.buttonGaoFengXianYuanYin.TabIndex = 0;
|
|
this.buttonGaoFengXianYuanYin.Text = "高风险原因";
|
|
this.buttonGaoFengXianYuanYin.UseVisualStyleBackColor = true;
|
|
this.buttonGaoFengXianYuanYin.Click += new System.EventHandler(buttonGaoFengXianYuanYin_Click);
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Font = new System.Drawing.Font("宋体", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Location = new System.Drawing.Point(312, 26);
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Name = "buttonGaiZaoTuiJian_FeiJianXian";
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Size = new System.Drawing.Size(183, 40);
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.TabIndex = 2;
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Text = "改造措施推荐(非建线)";
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.UseVisualStyleBackColor = true;
|
|
this.buttonGaiZaoTuiJian_FeiJianXian.Click += new System.EventHandler(buttonGaiZaoTuiJian_FeiJianXian_Click);
|
|
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
|
|
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
base.ClientSize = new System.Drawing.Size(524, 92);
|
|
base.Controls.Add(this.buttonGaiZaoTuiJian_FeiJianXian);
|
|
base.Controls.Add(this.buttonGaiZaoTuiJian);
|
|
base.Controls.Add(this.buttonGaoFengXianYuanYin);
|
|
base.Name = "FormFangLeiGaiZao";
|
|
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
|
this.Text = "FormFangLeiGaiZao";
|
|
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormFangLeiGaiZao_FormClosing);
|
|
base.Load += new System.EventHandler(FormFangLeiGaiZao_Load);
|
|
base.ResumeLayout(false);
|
|
}
|
|
}
|