Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

巡检计划

  • Loading branch information...
commit fc1931d2172b95e30aa22a37061f5551c23bc3d5 1 parent 9a544fb
qicb authored
View
36 Application/WorkStation.csproj
@@ -57,6 +57,30 @@
<Compile Include="frmAddCard.Designer.cs">
<DependentUpon>frmAddCard.cs</DependentUpon>
</Compile>
+ <Compile Include="frmAddPlan.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddPlan.Designer.cs">
+ <DependentUpon>frmAddPlan.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddPlanExamine.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddPlanExamine.Designer.cs">
+ <DependentUpon>frmAddPlanExamine.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddPlanToTask.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddPlanToTask.Designer.cs">
+ <DependentUpon>frmAddPlanToTask.cs</DependentUpon>
+ </Compile>
+ <Compile Include="frmAddPlan_Add.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmAddPlan_Add.Designer.cs">
+ <DependentUpon>frmAddPlan_Add.cs</DependentUpon>
+ </Compile>
<Compile Include="frmAddPoint.cs">
<SubType>Form</SubType>
</Compile>
@@ -140,6 +164,18 @@
<EmbeddedResource Include="frmAddCard.resx">
<DependentUpon>frmAddCard.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="frmAddPlan.resx">
+ <DependentUpon>frmAddPlan.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddPlanExamine.resx">
+ <DependentUpon>frmAddPlanExamine.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddPlanToTask.resx">
+ <DependentUpon>frmAddPlanToTask.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="frmAddPlan_Add.resx">
+ <DependentUpon>frmAddPlan_Add.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="frmAddPoint.resx">
<DependentUpon>frmAddPoint.cs</DependentUpon>
</EmbeddedResource>
View
180 Application/frmAddPlan.Designer.cs
@@ -0,0 +1,180 @@
+namespace WorkStation
+{
+ partial class frmAddPlan
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.dgvPlan = new System.Windows.Forms.DataGridView();
+ this.chkColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.btnUnSub = new System.Windows.Forms.Button();
+ this.btnSubmit = new System.Windows.Forms.Button();
+ this.btnDel = new System.Windows.Forms.Button();
+ this.btnEdit = new System.Windows.Forms.Button();
+ this.btnNew = new System.Windows.Forms.Button();
+ this.cboShow = new System.Windows.Forms.ComboBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.labState = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).BeginInit();
+ this.SuspendLayout();
+ //
+ // dgvPlan
+ //
+ this.dgvPlan.AllowUserToAddRows = false;
+ this.dgvPlan.AllowUserToDeleteRows = false;
+ this.dgvPlan.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvPlan.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.chkColumn});
+ this.dgvPlan.Location = new System.Drawing.Point(6, 89);
+ this.dgvPlan.Name = "dgvPlan";
+ this.dgvPlan.ReadOnly = true;
+ this.dgvPlan.RowTemplate.Height = 23;
+ this.dgvPlan.Size = new System.Drawing.Size(686, 460);
+ this.dgvPlan.TabIndex = 34;
+ this.dgvPlan.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPlan_CellClick);
+ this.dgvPlan.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvPlan_CellMouseDoubleClick);
+ //
+ // chkColumn
+ //
+ this.chkColumn.HeaderText = "选择";
+ this.chkColumn.Name = "chkColumn";
+ this.chkColumn.ReadOnly = true;
+ this.chkColumn.Width = 38;
+ //
+ // btnUnSub
+ //
+ this.btnUnSub.Location = new System.Drawing.Point(590, 31);
+ this.btnUnSub.Name = "btnUnSub";
+ this.btnUnSub.Size = new System.Drawing.Size(75, 23);
+ this.btnUnSub.TabIndex = 41;
+ this.btnUnSub.Text = "撤销提交";
+ this.btnUnSub.UseVisualStyleBackColor = true;
+ this.btnUnSub.Click += new System.EventHandler(this.btnUnSub_Click);
+ //
+ // btnSubmit
+ //
+ this.btnSubmit.Location = new System.Drawing.Point(497, 31);
+ this.btnSubmit.Name = "btnSubmit";
+ this.btnSubmit.Size = new System.Drawing.Size(75, 23);
+ this.btnSubmit.TabIndex = 40;
+ this.btnSubmit.Text = "提交";
+ this.btnSubmit.UseVisualStyleBackColor = true;
+ this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
+ //
+ // btnDel
+ //
+ this.btnDel.Location = new System.Drawing.Point(411, 31);
+ this.btnDel.Name = "btnDel";
+ this.btnDel.Size = new System.Drawing.Size(75, 23);
+ this.btnDel.TabIndex = 39;
+ this.btnDel.Text = "删除";
+ this.btnDel.UseVisualStyleBackColor = true;
+ this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
+ //
+ // btnEdit
+ //
+ this.btnEdit.Location = new System.Drawing.Point(322, 31);
+ this.btnEdit.Name = "btnEdit";
+ this.btnEdit.Size = new System.Drawing.Size(75, 23);
+ this.btnEdit.TabIndex = 38;
+ this.btnEdit.Text = "编辑";
+ this.btnEdit.UseVisualStyleBackColor = true;
+ this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
+ //
+ // btnNew
+ //
+ this.btnNew.Location = new System.Drawing.Point(235, 31);
+ this.btnNew.Name = "btnNew";
+ this.btnNew.Size = new System.Drawing.Size(75, 23);
+ this.btnNew.TabIndex = 37;
+ this.btnNew.Text = "新建";
+ this.btnNew.UseVisualStyleBackColor = true;
+ this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
+ //
+ // cboShow
+ //
+ this.cboShow.FormattingEnabled = true;
+ this.cboShow.Location = new System.Drawing.Point(51, 34);
+ this.cboShow.Name = "cboShow";
+ this.cboShow.Size = new System.Drawing.Size(152, 20);
+ this.cboShow.TabIndex = 43;
+ this.cboShow.SelectedIndexChanged += new System.EventHandler(this.cboShow_SelectedIndexChanged);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(16, 38);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(29, 12);
+ this.label2.TabIndex = 42;
+ this.label2.Text = "显示";
+ //
+ // labState
+ //
+ this.labState.AutoSize = true;
+ this.labState.Location = new System.Drawing.Point(238, 14);
+ this.labState.Name = "labState";
+ this.labState.Size = new System.Drawing.Size(29, 12);
+ this.labState.TabIndex = 44;
+ this.labState.Text = "状态";
+ //
+ // frmAddPlan
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(696, 556);
+ this.Controls.Add(this.dgvPlan);
+ this.Controls.Add(this.labState);
+ this.Controls.Add(this.cboShow);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.btnUnSub);
+ this.Controls.Add(this.btnSubmit);
+ this.Controls.Add(this.btnDel);
+ this.Controls.Add(this.btnEdit);
+ this.Controls.Add(this.btnNew);
+ this.Name = "frmAddPlan";
+ this.Text = "frmAddPlan";
+ this.Load += new System.EventHandler(this.frmAddPlan_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.DataGridView dgvPlan;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn chkColumn;
+ private System.Windows.Forms.Button btnUnSub;
+ private System.Windows.Forms.Button btnSubmit;
+ private System.Windows.Forms.Button btnDel;
+ private System.Windows.Forms.Button btnEdit;
+ private System.Windows.Forms.Button btnNew;
+ private System.Windows.Forms.ComboBox cboShow;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label labState;
+ }
+}
View
308 Application/frmAddPlan.cs
@@ -0,0 +1,308 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddPlan : Form
+ {
+ public frmAddPlan()
+ {
+ InitializeComponent();
+ }
+
+ private void frmAddPlan_Load(object sender, EventArgs e)
+ {
+ this.labState.Text = "";
+ cboInit();
+ getDgvPlan(this.dgvPlan,this.labState.Text);
+ }
+ private void cboShow_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.labState.Text = (this.cboShow.SelectedItem as BoxItem).Value.ToString() == "" ? "0,1,2,4,6,8,16" : (this.cboShow.SelectedItem as BoxItem).Value.ToString();
+ switch((this.cboShow.SelectedItem as BoxItem).Value.ToString())
+ {
+ case "":
+ {
+ this.btnNew.Enabled = true;
+ this.btnEdit.Enabled = true;
+ this.btnDel.Enabled = true;
+ this.btnSubmit.Enabled = true;
+ this.btnUnSub.Enabled = true;
+ break;
+ }
+ case "0":
+ {
+ this.btnUnSub.Enabled = false;
+ break;
+ }
+ case "1":
+ {
+ this.btnNew.Enabled = false;
+ this.btnEdit.Enabled = false;
+ this.btnDel.Enabled = false;
+ this.btnSubmit.Enabled = false;
+ this.btnUnSub.Enabled = true;
+ break;
+ }
+ case "2":
+ {
+ this.btnNew.Enabled = false;
+ this.btnEdit.Enabled = true;
+ this.btnDel.Enabled = true;
+ this.btnSubmit.Enabled = true;
+ this.btnUnSub.Enabled = false;
+ break;
+ }
+ case"4":
+ case"8":
+ case"16":
+ case "32":
+ {
+ this.btnNew.Enabled = false;
+ this.btnEdit.Enabled = false;
+ this.btnDel.Enabled = false;
+ this.btnSubmit.Enabled = false;
+ this.btnUnSub.Enabled = false;
+ break;
+ }
+
+ }
+ getDgvPlan(this.dgvPlan,this.labState.Text);
+ }
+
+ private void btnNew_Click(object sender, EventArgs e)
+ {
+ frmAddPlan_Add add = new frmAddPlan_Add();
+ add.Left = this.Left - (this.Width - add.Width) / 2;
+ add.Top = this.Top - (this.Height - add.Height) / 2;
+ add.dgv = this.dgvPlan;
+ add.state = this.labState.Text;
+ add.Show();
+ }
+
+ private void btnEdit_Click(object sender, EventArgs e)
+ {
+ int count = 0,rowindex=0;
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ count++;
+ rowindex = i;
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (count !=1)
+ {
+ MessageBox.Show("请选择一个要编辑的计划"); return;
+ }
+ frmAddPlan_Add add = new frmAddPlan_Add();
+ add.Left = this.Left - (this.Width - add.Width) / 2;
+ add.Top = this.Top - (this.Height - add.Height) / 2;
+ add.isEdit = true;
+ add.planID = dgvPlan.Rows[rowindex].Cells[1].Value.ToString();
+ add.planName = dgvPlan.Rows[rowindex].Cells[2].Value.ToString();
+ add.planAlias = dgvPlan.Rows[rowindex].Cells[3].Value.ToString();
+ add.dtStart = Convert.ToDateTime(dgvPlan.Rows[rowindex].Cells[4].Value);
+ add.dtEnd = Convert.ToDateTime(dgvPlan.Rows[rowindex].Cells[6].Value);
+ add.planPost = dgvPlan.Rows[rowindex].Cells[7].Value.ToString();
+ add.planRoute = dgvPlan.Rows[rowindex].Cells[8].Value.ToString();
+ add.planInterval = dgvPlan.Rows[rowindex].Cells[9].Value.ToString();
+ add.planUnit = dgvPlan.Rows[rowindex].Cells[10].Value.ToString();
+ add.dtEffect = Convert.ToDateTime(dgvPlan.Rows[rowindex].Cells[11].Value);
+ add.dtIneffect = Convert.ToDateTime(dgvPlan.Rows[rowindex].Cells[12].Value);
+
+ add.Show();
+ }
+
+ private void btnDel_Click(object sender, EventArgs e)
+ {
+ string Del = "";
+ string strsql = "Delete From CheckPlan Where ID in(";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ Del += dgvPlan.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (Del != "")
+ {
+ Del = Del.Substring(0, Del.Length - 1);
+ strsql += Del + ") and PlanState=0";
+ SqlHelper.ExecuteNonQuery(strsql);
+ getDgvPlan(dgvPlan,this.labState.Text);
+ }
+ else
+ {
+ MessageBox.Show("请选择要删除的项。");
+ }
+ }
+
+ private void btnSubmit_Click(object sender, EventArgs e)
+ {
+ string update = "";
+ string strUpdae = "Update CheckPlan Set PlanState=1 where Id in(";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ update += dgvPlan.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (update != "")
+ {
+ update = update.Substring(0, update.Length - 1);
+ strUpdae += update + ") and PlanState=0";
+ SqlHelper.ExecuteNonQuery(strUpdae);
+ getDgvPlan(dgvPlan, this.labState.Text);
+ }
+ else
+ {
+ MessageBox.Show("请选择要提交的项");
+ }
+ }
+
+ private void btnUnSub_Click(object sender, EventArgs e)
+ {
+ string update = "";
+ string strUpdae = "Update CheckPlan Set PlanState=0 where Id in(";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ update += dgvPlan.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+ if (update != "")
+ {
+ update = update.Substring(0, update.Length - 1);
+ strUpdae += update + ") and PlanState=1";
+ SqlHelper.ExecuteNonQuery(strUpdae);
+ getDgvPlan(dgvPlan, this.labState.Text);
+ }
+ else
+ {
+ MessageBox.Show("请选择要撤销提交的项");
+ }
+ }
+
+ public static void getDgvPlan(DataGridView dgv, string labState)
+ {
+ DataSet ds = SqlHelper.ExecuteDataset(@"Select
+ c.ID as 计划编号,
+ c.Name as 计划名称,
+ c.Alias as 别名,
+ c.StartTime as 计划开始时间,
+ c.Duration as 持续时间,
+ c.EndTime as 计划结束时间,
+ p.Name as 指派岗位,
+ r.Name as 路线,
+ c.Interval as 周期,
+ (select meaning from codes where code= IntervalUnit and purpose='intervalunit') as 周期单位,
+ c.EffectiveTime as 计划生效时间,
+ c.IneffectiveTime as 计划失效时间,
+ c.Planner as 计划制定人,
+ (select meaning from codes where code= planstate and purpose='planstate') as 状态
+ From Checkplan as c left join CheckRoute as r on c.route_id=r.id
+ left join Post p on c.post=p.id
+ where c.PlanState in (" + labState + ")");
+ dgv.DataSource = ds.Tables[0];
+ }
+
+ private void cboInit()
+ {
+ SqlDataReader dr = SqlHelper.ExecuteReader("Select Code,Meaning From Codes Where Purpose='PlanState'");
+ BoxItem item = null;
+ item = new BoxItem("全部", "");
+ cboShow.Items.Add(item);
+ while (dr.Read())
+ {
+ item = new BoxItem();
+ item.Text = dr["Meaning"].ToString();
+ item.Value = dr["Code"].ToString();
+ cboShow.Items.Add(item);
+ }
+ dr.Dispose();
+ cboShow.SelectedIndex = cboShow.Items.Count > 0 ? 0 : -1;
+ }
+
+ private void btnControl()
+ {
+
+ }
+
+ private void dgvPlan_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
+ {
+ if(e.RowIndex<0||btnEdit.Enabled==false) return;
+ frmAddPlan_Add add = new frmAddPlan_Add();
+ add.Left = this.Left - (this.Width - add.Width) / 2;
+ add.Top = this.Top - (this.Height - add.Height) / 2;
+
+ add.isEdit = true;
+ add.planID = dgvPlan.Rows[e.RowIndex].Cells[1].Value.ToString();
+ add.planName = dgvPlan.Rows[e.RowIndex].Cells[2].Value.ToString();
+ add.planAlias = dgvPlan.Rows[e.RowIndex].Cells[3].Value.ToString();
+ add.dtStart = Convert.ToDateTime(dgvPlan.Rows[e.RowIndex].Cells[4].Value);
+ add.dtEnd = Convert.ToDateTime(dgvPlan.Rows[e.RowIndex].Cells[6].Value);
+ add.planPost = dgvPlan.Rows[e.RowIndex].Cells[7].Value.ToString();
+ add.planRoute = dgvPlan.Rows[e.RowIndex].Cells[8].Value.ToString();
+ add.planInterval = dgvPlan.Rows[e.RowIndex].Cells[9].Value.ToString();
+ add.planUnit = dgvPlan.Rows[e.RowIndex].Cells[10].Value.ToString();
+ add.dtEffect = Convert.ToDateTime(dgvPlan.Rows[e.RowIndex].Cells[11].Value);
+ add.dtIneffect = Convert.ToDateTime(dgvPlan.Rows[e.RowIndex].Cells[12].Value);
+
+ add.Show();
+ }
+
+ private void dgvPlan_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex == -1) return;
+ if (e.ColumnIndex == 0)
+ {
+ if ((bool)dgvPlan.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+ }
+ }
+}
View
126 Application/frmAddPlan.resx
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
View
107 Application/frmAddPlanExamine.Designer.cs
@@ -0,0 +1,107 @@
+namespace WorkStation
+{
+ partial class frmAddPlanExamine
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.btnPass = new System.Windows.Forms.Button();
+ this.btnUnpass = new System.Windows.Forms.Button();
+ this.dgvPlan = new System.Windows.Forms.DataGridView();
+ this.chkColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).BeginInit();
+ this.SuspendLayout();
+ //
+ // btnPass
+ //
+ this.btnPass.Location = new System.Drawing.Point(54, 32);
+ this.btnPass.Name = "btnPass";
+ this.btnPass.Size = new System.Drawing.Size(75, 23);
+ this.btnPass.TabIndex = 1;
+ this.btnPass.Text = "通过";
+ this.btnPass.UseVisualStyleBackColor = true;
+ this.btnPass.Click += new System.EventHandler(this.btnPass_Click);
+ //
+ // btnUnpass
+ //
+ this.btnUnpass.Location = new System.Drawing.Point(212, 32);
+ this.btnUnpass.Name = "btnUnpass";
+ this.btnUnpass.Size = new System.Drawing.Size(75, 23);
+ this.btnUnpass.TabIndex = 2;
+ this.btnUnpass.Text = "未通过";
+ this.btnUnpass.UseVisualStyleBackColor = true;
+ this.btnUnpass.Click += new System.EventHandler(this.btnUnpass_Click);
+ //
+ // dgvPlan
+ //
+ this.dgvPlan.AllowUserToAddRows = false;
+ this.dgvPlan.AllowUserToDeleteRows = false;
+ this.dgvPlan.Anchor = ((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.dgvPlan.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvPlan.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.chkColumn});
+ this.dgvPlan.Location = new System.Drawing.Point(12, 89);
+ this.dgvPlan.Name = "dgvPlan";
+ this.dgvPlan.ReadOnly = true;
+ this.dgvPlan.RowTemplate.Height = 23;
+ this.dgvPlan.Size = new System.Drawing.Size(820, 451);
+ this.dgvPlan.TabIndex = 35;
+ this.dgvPlan.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPlan_CellClick);
+ //
+ // chkColumn
+ //
+ this.chkColumn.HeaderText = "选择";
+ this.chkColumn.Name = "chkColumn";
+ this.chkColumn.ReadOnly = true;
+ this.chkColumn.Width = 38;
+ //
+ // frmAddPlanExamine
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(844, 552);
+ this.Controls.Add(this.btnUnpass);
+ this.Controls.Add(this.dgvPlan);
+ this.Controls.Add(this.btnPass);
+ this.Name = "frmAddPlanExamine";
+ this.Text = "计划审核";
+ this.Load += new System.EventHandler(this.frmAddPlanExamine_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button btnPass;
+ private System.Windows.Forms.Button btnUnpass;
+ private System.Windows.Forms.DataGridView dgvPlan;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn chkColumn;
+
+ }
+}
View
133 Application/frmAddPlanExamine.cs
@@ -0,0 +1,133 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace WorkStation
+{
+ public partial class frmAddPlanExamine : Form
+ {
+ public frmAddPlanExamine()
+ {
+ InitializeComponent();
+ }
+
+ private void frmAddPlanExamine_Load(object sender, EventArgs e)
+ {
+ getDgvPlan();
+ }
+
+ private void dgvPlan_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex == -1) return;
+ if (e.ColumnIndex == 0)
+ {
+ if ((bool)dgvPlan.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+ }
+
+ private void btnPass_Click(object sender, EventArgs e)
+ {
+ string id = "";
+ string update = "Update checkplan set planstate=4 where id in (";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ id += dgvPlan.Rows[i].Cells[1].Value+",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+
+ if (id != "")
+ {
+ id = id.Substring(0, id.Length - 1);
+ update += id + ") and planstate=1";
+ if (SqlHelper.ExecuteNonQuery(update) == 0)
+ {
+ MessageBox.Show("审核失败");
+ }
+ }
+ else
+ {
+ MessageBox.Show("请选择要审核的项");
+ }
+ getDgvPlan();
+ }
+
+ private void btnUnpass_Click(object sender, EventArgs e)
+ {
+ string id = "";
+ string update = "Update checkplan set planstate=2 where id in (";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ try
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ id += dgvPlan.Rows[i].Cells[1].Value + ",";
+ }
+ }
+ catch
+ {
+ continue;
+ }
+ }
+
+ if (id != "")
+ {
+ id = id.Substring(0, id.Length - 1);
+ update += id + ") and planstate=1";
+ if (SqlHelper.ExecuteNonQuery(update) == 0)
+ {
+ MessageBox.Show("审核失败");
+ }
+ }
+ else
+ {
+ MessageBox.Show("请选择要审核的项");
+ }
+ getDgvPlan();
+ }
+
+ private void getDgvPlan()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset(@"Select
+ c.ID as 计划编号,
+ c.Name as 计划名称,
+ c.Alias as 别名,
+ c.StartTime as 计划开始时间,
+ c.Duration as 持续时间,
+ c.EndTime as 计划结束时间,
+ p.Name as 指派岗位,
+ r.Name as 路线,
+ c.Interval as 周期,
+ (select meaning from codes where code= IntervalUnit and purpose='intervalunit') as 周期单位,
+ c.EffectiveTime as 计划生效时间,
+ c.IneffectiveTime as 计划失效时间,
+ c.Planner as 计划制定人,
+ (select meaning from codes where code= planstate and purpose='planstate') as 状态
+ From Checkplan as c left join CheckRoute as r on c.route_id=r.id
+ left join Post p on c.post=p.id
+ where c.PlanState in (" + 1 + ")");
+ dgvPlan.DataSource = ds.Tables[0];
+ }
+ }
+}
View
126 Application/frmAddPlanExamine.resx
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
View
143 Application/frmAddPlanToTask.Designer.cs
@@ -0,0 +1,143 @@
+namespace WorkStation
+{
+ partial class frmAddPlanToTask
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.btnDown = new System.Windows.Forms.Button();
+ this.dgvPlan = new System.Windows.Forms.DataGridView();
+ this.chkColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.dgvTask = new System.Windows.Forms.DataGridView();
+ this.cboState = new System.Windows.Forms.ComboBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.labID = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvTask)).BeginInit();
+ this.SuspendLayout();
+ //
+ // btnDown
+ //
+ this.btnDown.Location = new System.Drawing.Point(209, 13);
+ this.btnDown.Name = "btnDown";
+ this.btnDown.Size = new System.Drawing.Size(75, 23);
+ this.btnDown.TabIndex = 0;
+ this.btnDown.Text = "生成任务";
+ this.btnDown.UseVisualStyleBackColor = true;
+ this.btnDown.Click += new System.EventHandler(this.btnDown_Click);
+ //
+ // dgvPlan
+ //
+ this.dgvPlan.AllowUserToAddRows = false;
+ this.dgvPlan.AllowUserToDeleteRows = false;
+ this.dgvPlan.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvPlan.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.chkColumn});
+ this.dgvPlan.Location = new System.Drawing.Point(12, 42);
+ this.dgvPlan.Name = "dgvPlan";
+ this.dgvPlan.ReadOnly = true;
+ this.dgvPlan.RowTemplate.Height = 23;
+ this.dgvPlan.Size = new System.Drawing.Size(785, 245);
+ this.dgvPlan.TabIndex = 35;
+ this.dgvPlan.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPlan_CellContentClick);
+ //
+ // chkColumn
+ //
+ this.chkColumn.HeaderText = "选择";
+ this.chkColumn.Name = "chkColumn";
+ this.chkColumn.ReadOnly = true;
+ this.chkColumn.Width = 38;
+ //
+ // dgvTask
+ //
+ this.dgvTask.AllowUserToAddRows = false;
+ this.dgvTask.AllowUserToDeleteRows = false;
+ this.dgvTask.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dgvTask.Location = new System.Drawing.Point(12, 304);
+ this.dgvTask.Name = "dgvTask";
+ this.dgvTask.ReadOnly = true;
+ this.dgvTask.RowTemplate.Height = 23;
+ this.dgvTask.Size = new System.Drawing.Size(785, 277);
+ this.dgvTask.TabIndex = 36;
+ //
+ // cboState
+ //
+ this.cboState.FormattingEnabled = true;
+ this.cboState.Location = new System.Drawing.Point(63, 14);
+ this.cboState.Name = "cboState";
+ this.cboState.Size = new System.Drawing.Size(121, 20);
+ this.cboState.TabIndex = 37;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(21, 18);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(29, 12);
+ this.label1.TabIndex = 38;
+ this.label1.Text = "显示";
+ //
+ // labID
+ //
+ this.labID.AutoSize = true;
+ this.labID.Location = new System.Drawing.Point(327, 18);
+ this.labID.Name = "labID";
+ this.labID.Size = new System.Drawing.Size(89, 12);
+ this.labID.TabIndex = 39;
+ this.labID.Text = "已下发任务的ID";
+ //
+ // frmAddPlanToTask
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(809, 607);
+ this.Controls.Add(this.labID);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.cboState);
+ this.Controls.Add(this.dgvTask);
+ this.Controls.Add(this.dgvPlan);
+ this.Controls.Add(this.btnDown);
+ this.Name = "frmAddPlanToTask";
+ this.Text = "任务下发";
+ this.Load += new System.EventHandler(this.frmAddPlanToTask_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvTask)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button btnDown;
+ private System.Windows.Forms.DataGridView dgvPlan;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn chkColumn;
+ private System.Windows.Forms.DataGridView dgvTask;
+ private System.Windows.Forms.ComboBox cboState;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label labID;
+ }
+}
View
95 Application/frmAddPlanToTask.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddPlanToTask : Form
+ {
+ public frmAddPlanToTask()
+ {
+ InitializeComponent();
+ }
+
+
+ private void dgvPlan_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if ((bool)dgvPlan.Rows[e.RowIndex].Cells[0].EditedFormattedValue == false)
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = true;
+ }
+ else
+ {
+ dgvPlan.Rows[e.RowIndex].Cells[0].Value = false;
+ }
+ }
+
+ private void btnDown_Click(object sender, EventArgs e)
+ {
+ string strIDs = "";
+ for (int i = 0; i < dgvPlan.Rows.Count; i++)
+ {
+ if ((bool)dgvPlan.Rows[i].Cells[0].Value == true)
+ {
+ strIDs += dgvPlan.Rows[i].Cells[1].Value.ToString() + ",";
+ }
+ }
+ if (strIDs == "")
+ {
+ MessageBox.Show("请选择要下发的计划");
+ return;
+ }
+ SqlParameter[] pars = new SqlParameter[] {
+ new SqlParameter("@PlanIDs",strIDs)
+ };
+ SqlHelper.ExecuteNonQuery("CreateTask", CommandType.StoredProcedure, pars);
+ getDgvPlan();
+ }
+
+ private void cboInit()
+ {
+ cboState.Items.Add(new BoxItem("全部", ""));
+ cboState.Items.Add(new BoxItem("未下发", "4"));
+ cboState.Items.Add(new BoxItem("已下发", "8"));
+ cboState.SelectedIndex = 0;
+ }
+
+ private void getDgvPlan()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset(@"Select
+ c.ID as 计划编号,
+ c.Name as 计划名称,
+ c.Alias as 别名,
+ c.StartTime as 计划开始时间,
+ c.Duration as 持续时间,
+ c.EndTime as 计划结束时间,
+ p.Name as 指派岗位,
+ r.Name as 路线,
+ c.Interval as 周期,
+ (select meaning from codes where code= IntervalUnit and purpose='intervalunit') as 周期单位,
+ c.EffectiveTime as 计划生效时间,
+ c.IneffectiveTime as 计划失效时间,
+ c.Planner as 计划制定人,
+ (select meaning from codes where code= planstate and purpose='planstate') as 状态
+ From Checkplan as c left join CheckRoute as r on c.route_id=r.id
+ left join Post p on c.post=p.id
+ where c.PlanState in (" + 4 + ")");
+ dgvPlan.DataSource = ds.Tables[0];
+ }
+ private void getDgvTask()
+ {
+
+ }
+
+ private void frmAddPlanToTask_Load(object sender, EventArgs e)
+ {
+ getDgvPlan();
+ }
+ }
+}
View
126 Application/frmAddPlanToTask.resx
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
View
302 Application/frmAddPlan_Add.Designer.cs
@@ -0,0 +1,302 @@
+namespace WorkStation
+{
+ partial class frmAddPlan_Add
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.dtpIneffect = new System.Windows.Forms.DateTimePicker();
+ this.dtpEffect = new System.Windows.Forms.DateTimePicker();
+ this.dtpStart = new System.Windows.Forms.DateTimePicker();
+ this.cboRoute = new System.Windows.Forms.ComboBox();
+ this.txtName = new System.Windows.Forms.TextBox();
+ this.lblshixiao = new System.Windows.Forms.Label();
+ this.lblshengxiao = new System.Windows.Forms.Label();
+ this.lblTime = new System.Windows.Forms.Label();
+ this.lblRount = new System.Windows.Forms.Label();
+ this.lblName = new System.Windows.Forms.Label();
+ this.txtAlias = new System.Windows.Forms.TextBox();
+ this.lblAlias = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.dtpEnd = new System.Windows.Forms.DateTimePicker();
+ this.cboPost = new System.Windows.Forms.ComboBox();
+ this.lblPost = new System.Windows.Forms.Label();
+ this.txtInterval = new System.Windows.Forms.TextBox();
+ this.cboUnit = new System.Windows.Forms.ComboBox();
+ this.lblCycle = new System.Windows.Forms.Label();
+ this.btnSave = new System.Windows.Forms.Button();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // dtpIneffect
+ //
+ this.dtpIneffect.Location = new System.Drawing.Point(96, 238);
+ this.dtpIneffect.Name = "dtpIneffect";
+ this.dtpIneffect.Size = new System.Drawing.Size(183, 21);
+ this.dtpIneffect.TabIndex = 40;
+ //
+ // dtpEffect
+ //
+ this.dtpEffect.Location = new System.Drawing.Point(96, 205);
+ this.dtpEffect.Name = "dtpEffect";
+ this.dtpEffect.Size = new System.Drawing.Size(183, 21);
+ this.dtpEffect.TabIndex = 39;
+ //
+ // dtpStart
+ //
+ this.dtpStart.CustomFormat = "yyyy\'\'MM\'\'dd\'\' hh\':\'mm";
+ this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
+ this.dtpStart.Location = new System.Drawing.Point(96, 141);
+ this.dtpStart.Name = "dtpStart";
+ this.dtpStart.Size = new System.Drawing.Size(183, 21);
+ this.dtpStart.TabIndex = 38;
+ //
+ // cboRoute
+ //
+ this.cboRoute.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboRoute.FormattingEnabled = true;
+ this.cboRoute.Items.AddRange(new object[] {
+ "选择路线"});
+ this.cboRoute.Location = new System.Drawing.Point(96, 86);
+ this.cboRoute.Name = "cboRoute";
+ this.cboRoute.Size = new System.Drawing.Size(183, 20);
+ this.cboRoute.TabIndex = 37;
+ //
+ // txtName
+ //
+ this.txtName.Location = new System.Drawing.Point(96, 23);
+ this.txtName.Name = "txtName";
+ this.txtName.Size = new System.Drawing.Size(183, 21);
+ this.txtName.TabIndex = 35;
+ //
+ // lblshixiao
+ //
+ this.lblshixiao.AutoSize = true;
+ this.lblshixiao.Location = new System.Drawing.Point(12, 242);
+ this.lblshixiao.Name = "lblshixiao";
+ this.lblshixiao.Size = new System.Drawing.Size(77, 12);
+ this.lblshixiao.TabIndex = 34;
+ this.lblshixiao.Text = "任务失效时间";
+ //
+ // lblshengxiao
+ //
+ this.lblshengxiao.AutoSize = true;
+ this.lblshengxiao.Location = new System.Drawing.Point(13, 209);
+ this.lblshengxiao.Name = "lblshengxiao";
+ this.lblshengxiao.Size = new System.Drawing.Size(77, 12);
+ this.lblshengxiao.TabIndex = 33;
+ this.lblshengxiao.Text = "任务生效时间";
+ //
+ // lblTime
+ //
+ this.lblTime.AutoSize = true;
+ this.lblTime.Location = new System.Drawing.Point(13, 145);
+ this.lblTime.Name = "lblTime";
+ this.lblTime.Size = new System.Drawing.Size(77, 12);
+ this.lblTime.TabIndex = 32;
+ this.lblTime.Text = "执行开始时间";
+ //
+ // lblRount
+ //
+ this.lblRount.AutoSize = true;
+ this.lblRount.Location = new System.Drawing.Point(36, 89);
+ this.lblRount.Name = "lblRount";
+ this.lblRount.Size = new System.Drawing.Size(53, 12);
+ this.lblRount.TabIndex = 30;
+ this.lblRount.Text = "巡检路线";
+ //
+ // lblName
+ //
+ this.lblName.AutoSize = true;
+ this.lblName.Location = new System.Drawing.Point(37, 27);
+ this.lblName.Name = "lblName";
+ this.lblName.Size = new System.Drawing.Size(53, 12);
+ this.lblName.TabIndex = 28;
+ this.lblName.Text = "计划名称";
+ //
+ // txtAlias
+ //
+ this.txtAlias.Location = new System.Drawing.Point(96, 54);
+ this.txtAlias.Name = "txtAlias";
+ this.txtAlias.Size = new System.Drawing.Size(183, 21);
+ this.txtAlias.TabIndex = 45;
+ //
+ // lblAlias
+ //
+ this.lblAlias.AutoSize = true;
+ this.lblAlias.Location = new System.Drawing.Point(36, 57);
+ this.lblAlias.Name = "lblAlias";
+ this.lblAlias.Size = new System.Drawing.Size(53, 12);
+ this.lblAlias.TabIndex = 44;
+ this.lblAlias.Text = "计划别名";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 178);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(77, 12);
+ this.label1.TabIndex = 47;
+ this.label1.Text = "执行结束时间";
+ //
+ // dtpEnd
+ //
+ this.dtpEnd.CustomFormat = "yyyy\'\'MM\'\'dd\'\' hh\':\'mm";
+ this.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
+ this.dtpEnd.Location = new System.Drawing.Point(96, 174);
+ this.dtpEnd.Name = "dtpEnd";
+ this.dtpEnd.Size = new System.Drawing.Size(183, 21);
+ this.dtpEnd.TabIndex = 46;
+ //
+ // cboPost
+ //
+ this.cboPost.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboPost.FormattingEnabled = true;
+ this.cboPost.Items.AddRange(new object[] {
+ "选择路线"});
+ this.cboPost.Location = new System.Drawing.Point(96, 112);
+ this.cboPost.Name = "cboPost";
+ this.cboPost.Size = new System.Drawing.Size(183, 20);
+ this.cboPost.TabIndex = 49;
+ //
+ // lblPost
+ //
+ this.lblPost.AutoSize = true;
+ this.lblPost.Location = new System.Drawing.Point(36, 115);
+ this.lblPost.Name = "lblPost";
+ this.lblPost.Size = new System.Drawing.Size(53, 12);
+ this.lblPost.TabIndex = 48;
+ this.lblPost.Text = "指派岗位";
+ //
+ // txtInterval
+ //
+ this.txtInterval.Location = new System.Drawing.Point(95, 272);
+ this.txtInterval.Name = "txtInterval";
+ this.txtInterval.Size = new System.Drawing.Size(46, 21);
+ this.txtInterval.TabIndex = 52;
+ //
+ // cboUnit
+ //
+ this.cboUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboUnit.FormattingEnabled = true;
+ this.cboUnit.Items.AddRange(new object[] {
+ "选择路线"});
+ this.cboUnit.Location = new System.Drawing.Point(147, 273);
+ this.cboUnit.Name = "cboUnit";
+ this.cboUnit.Size = new System.Drawing.Size(59, 20);
+ this.cboUnit.TabIndex = 51;
+ //
+ // lblCycle
+ //
+ this.lblCycle.AutoSize = true;
+ this.lblCycle.Location = new System.Drawing.Point(36, 276);
+ this.lblCycle.Name = "lblCycle";
+ this.lblCycle.Size = new System.Drawing.Size(53, 12);
+ this.lblCycle.TabIndex = 50;
+ this.lblCycle.Text = "循环周期";
+ //
+ // btnSave
+ //
+ this.btnSave.Location = new System.Drawing.Point(66, 317);
+ this.btnSave.Name = "btnSave";
+ this.btnSave.Size = new System.Drawing.Size(75, 23);
+ this.btnSave.TabIndex = 53;
+ this.btnSave.Text = "新建";
+ this.btnSave.UseVisualStyleBackColor = true;
+ this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+ //
+ // btnClose
+ //
+ this.btnClose.Location = new System.Drawing.Point(176, 317);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(75, 23);
+ this.btnClose.TabIndex = 54;
+ this.btnClose.Text = "关闭";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // frmAddPlan_Add
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.ClientSize = new System.Drawing.Size(336, 387);
+ this.Controls.Add(this.btnClose);
+ this.Controls.Add(this.btnSave);
+ this.Controls.Add(this.txtInterval);
+ this.Controls.Add(this.cboUnit);
+ this.Controls.Add(this.lblCycle);
+ this.Controls.Add(this.cboPost);
+ this.Controls.Add(this.lblPost);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.dtpEnd);
+ this.Controls.Add(this.txtAlias);
+ this.Controls.Add(this.lblAlias);
+ this.Controls.Add(this.dtpIneffect);
+ this.Controls.Add(this.dtpEffect);
+ this.Controls.Add(this.dtpStart);
+ this.Controls.Add(this.cboRoute);
+ this.Controls.Add(this.txtName);
+ this.Controls.Add(this.lblshixiao);
+ this.Controls.Add(this.lblshengxiao);
+ this.Controls.Add(this.lblTime);
+ this.Controls.Add(this.lblRount);
+ this.Controls.Add(this.lblName);
+ this.MaximizeBox = false;
+ this.Name = "frmAddPlan_Add";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "新建计划";
+ this.Load += new System.EventHandler(this.frmAddPlan_Add_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.DateTimePicker dtpIneffect;
+ private System.Windows.Forms.DateTimePicker dtpEffect;
+ private System.Windows.Forms.DateTimePicker dtpStart;
+ private System.Windows.Forms.ComboBox cboRoute;
+ private System.Windows.Forms.TextBox txtName;
+ private System.Windows.Forms.Label lblshixiao;
+ private System.Windows.Forms.Label lblshengxiao;
+ private System.Windows.Forms.Label lblTime;
+ private System.Windows.Forms.Label lblRount;
+ private System.Windows.Forms.Label lblName;
+ private System.Windows.Forms.TextBox txtAlias;
+ private System.Windows.Forms.Label lblAlias;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.DateTimePicker dtpEnd;
+ private System.Windows.Forms.ComboBox cboPost;
+ private System.Windows.Forms.Label lblPost;
+ private System.Windows.Forms.TextBox txtInterval;
+ private System.Windows.Forms.ComboBox cboUnit;
+ private System.Windows.Forms.Label lblCycle;
+ private System.Windows.Forms.Button btnSave;
+ private System.Windows.Forms.Button btnClose;
+ }
+}
View
130 Application/frmAddPlan_Add.cs
@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddPlan_Add : Form
+ {
+ public frmAddPlan_Add()
+ {
+ InitializeComponent();
+ }
+ public DataGridView dgv = null;
+ public string planName, planAlias, planRoute, planPost, planInterval, planUnit;
+ public DateTime dtStart, dtEnd, dtEffect, dtIneffect;
+ public bool isEdit = false;
+ public string state = "",planID="";
+ private void frmAddPlan_Add_Load(object sender, EventArgs e)
+ {
+ this.cboInit();
+ if (isEdit)
+ {
+ this.txtName.Text = planName;
+ this.txtAlias.Text = planAlias;
+ this.txtInterval.Text = planInterval;
+ this.cboPost.SelectedText = planPost;
+ this.cboRoute.SelectedText = planRoute;
+ this.cboUnit.SelectedText = planUnit;
+ this.dtpStart.Value = dtStart;
+ this.dtpEnd.Value = dtEnd;
+ this.dtpEffect.Value = dtEffect;
+ this.dtpIneffect.Value = dtIneffect;
+
+ this.Text = "修改计划";
+ this.btnSave.Text = "修改";
+ }
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+ if (txtName.Text.Trim() == "" || txtInterval.Text.Trim() == "")
+ {
+ MessageBox.Show("请确保没有空值");
+ return;
+ }
+ if (SqlHelper.ExecuteScalar("Select count(1) From CheckPlan Where Name='" + this.txtName.Text.Trim() + "'").ToString() != "0")
+ {
+ MessageBox.Show("请确保计划名称的唯一性");
+ return;
+ }
+ string strInsert = @"Insert into CheckPlan(Name,Alias,StartTime,Duration,EndTime,Post,Route_ID,Interval,IntervalUnit,EffectiveTime,IneffectiveTime,Planner,PlanState) values
+ (@Name,@Alias,@StartTime,@Duration,@EndTime,@Post,@Route_ID,@Interval,@IntervalUnit,@EffectiveTime,@IneffectiveTime,@Planner,@PlanState)";
+ SqlParameter[] pars = new SqlParameter[] {
+ new SqlParameter("@Name",SqlDbType.VarChar),
+ new SqlParameter("@Alias",SqlDbType.VarChar),
+ new SqlParameter("@StartTime",SqlDbType.DateTime),
+ new SqlParameter("@Duration",SqlDbType.DateTime),
+ new SqlParameter("@EndTime",SqlDbType.DateTime),
+ new SqlParameter("@Post",SqlDbType.BigInt),
+ new SqlParameter("@Route_ID",SqlDbType.BigInt),
+ new SqlParameter("@Interval",SqlDbType.Int),
+ new SqlParameter("@IntervalUnit",SqlDbType.Char),
+ new SqlParameter("@EffectiveTime",SqlDbType.DateTime),
+ new SqlParameter("@IneffectiveTime",SqlDbType.DateTime),
+ new SqlParameter("@Planner",SqlDbType.Float),
+ new SqlParameter("@PlanState",SqlDbType.Int)
+ };
+ pars[0].Value = this.txtName.Text.Trim();
+ pars[1].Value = this.txtAlias.Text.Trim();
+ pars[2].Value = this.dtpStart.Value;
+ pars[3].Value = this.dtpStart.Value;
+ pars[4].Value = this.dtpEnd.Value;
+ pars[5].Value = this.cboPost.SelectedValue;
+ pars[6].Value = this.cboRoute.SelectedValue;
+ pars[7].Value = this.txtInterval.Text.Trim();
+ pars[8].Value = this.cboUnit.SelectedValue;
+ pars[9].Value = this.dtpEffect.Value;
+ pars[10].Value = this.dtpIneffect.Value;
+ pars[11].Value = 88888888;
+ pars[12].Value = 0;
+ if (SqlHelper.ExecuteNonQuery(strInsert, pars) != 1)
+ {
+ MessageBox.Show("保存失败,请稍后再试!");
+ }
+ else
+ {
+ if (dgv != null)
+ {
+ frmAddPlan.getDgvPlan(dgv,state);
+ }
+ }
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void cboInit()
+ {
+ DataSet ds = SqlHelper.ExecuteDataset("Select Code,Meaning From Codes Where Purpose='IntervalUnit'");
+ cboUnit.DataSource = ds.Tables[0];
+ cboUnit.DisplayMember = "Meaning";
+ cboUnit.ValueMember = "Code";
+ cboUnit.SelectedIndex = cboUnit.Items.Count > 0 ? 0 : -1;
+
+ ds.Dispose();
+ ds = SqlHelper.ExecuteDataset("Select ID,Site_ID,Name From Post");
+ cboPost.DataSource = ds.Tables[0];
+ cboPost.DisplayMember = "Name";
+ cboPost.ValueMember = "ID";
+ cboPost.SelectedIndex = cboPost.Items.Count > 0 ? 0 : -1;
+
+ ds.Dispose();
+ ds = SqlHelper.ExecuteDataset("Select ID,Name From CheckRoute");
+ cboRoute.DataSource = ds.Tables[0];
+ cboRoute.DisplayMember = "Name";
+ cboRoute.ValueMember = "ID";
+ cboRoute.SelectedIndex = cboRoute.Items.Count > 0 ? 0 : -1;
+
+ ds.Dispose();
+ }
+ }
+}
View
120 Application/frmAddPlan_Add.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
54 Application/frmAddTask.cs
@@ -1,20 +1,20 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
using System.Windows.Forms;
-using System.Data.SqlClient;
-
-namespace WorkStation
-{
- public partial class frmAddTask : Form
- {
- public frmAddTask()
- {
- InitializeComponent();
+using System.Data.SqlClient;
+
+namespace WorkStation
+{
+ public partial class frmAddTask : Form
+ {
+ public frmAddTask()
+ {
+ InitializeComponent();
}
private void frmAddTask_Load(object sender, EventArgs e)
@@ -59,15 +59,15 @@ private void dgvPlan_CellClick(object sender, DataGridViewCellEventArgs e)
}
private void cboinit()
- {
- DataSet ds=SqlHelper.ExecuteDataset("Select Code,Meaning From Codes Where Purpose='IntervalUnit'");
+ {
+ DataSet ds=SqlHelper.ExecuteDataset("Select Code,Meaning From Codes Where Purpose='IntervalUnit'");
cboUnit.DataSource=ds.Tables[0];
cboUnit.DisplayMember = "Meaning";
cboUnit.ValueMember = "Code";
cboUnit.SelectedIndex = cboUnit.Items.Count > 0 ? 0 : -1;
ds.Dispose();
- ds = SqlHelper.ExecuteDataset("Select ID,Site_ID,Name From Post");
+ ds = SqlHelper.ExecuteDataset("Select ID,Site_ID,Name From Post");
cboPost.DataSource=ds.Tables[0];
cboPost.DisplayMember = "Name";
cboPost.ValueMember = "ID";
@@ -91,11 +91,11 @@ private void cboinit()
item = new BoxItem();
item.Text = dr["Meaning"].ToString();
item.Value = dr["Code"].ToString();
- cboShow.Items.Add(item);
+ cboShow.Items.Add(item);
}
dr.Dispose();
- cboShow.SelectedIndex = cboShow.Items.Count > 0 ? 0 : -1;
-
+ cboShow.SelectedIndex = cboShow.Items.Count > 0 ? 0 : -1;
+
}
private void getDgvPlan()
@@ -325,8 +325,8 @@ private void cboShow_SelectedIndexChanged(object sender, EventArgs e)
{
this.labState.Text = (this.cboShow.SelectedItem as BoxItem).Value.ToString() == "" ? "0,1,2,4,6,8,16" : (this.cboShow.SelectedItem as BoxItem).Value.ToString();
getDgvPlan();
- }
-
-
- }
-}
+ }
+
+
+ }
+}
View
25 Application/frmain.Designer.cs
@@ -93,8 +93,6 @@ private void InitializeComponent()
this.tsmidelete1 = new System.Windows.Forms.ToolStripSeparator();
this.tsmishenhe1 = new System.Windows.Forms.ToolStripMenuItem();
this.tsmixiafa1 = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
- this.tsmiexit = new System.Windows.Forms.ToolStripMenuItem();
this.tsmtongjibaobiao = new System.Windows.Forms.ToolStripMenuItem();
this.tsmirenyuanchuqin = new System.Windows.Forms.ToolStripMenuItem();
this.tsmixunjianxiang = new System.Windows.Forms.ToolStripMenuItem();
@@ -678,9 +676,7 @@ private void InitializeComponent()
this.tsmixinjian1,
this.tsmidelete1,
this.tsmishenhe1,
- this.tsmixiafa1,
- this.toolStripMenuItem1,
- this.tsmiexit});
+ this.tsmixiafa1});
this.tsmrenwu.Image = ((System.Drawing.Image)(resources.GetObject("tsmrenwu.Image")));
this.tsmrenwu.Name = "tsmrenwu";
this.tsmrenwu.Size = new System.Drawing.Size(81, 20);
@@ -702,24 +698,15 @@ private void InitializeComponent()
//
this.tsmishenhe1.Name = "tsmishenhe1";
this.tsmishenhe1.Size = new System.Drawing.Size(152, 22);
- this.tsmishenhe1.Text = "审核";
+ this.tsmishenhe1.Text = "任务审核";
+ this.tsmishenhe1.Click += new System.EventHandler(this.tsmishenhe1_Click);
//
// tsmixiafa1
//
this.tsmixiafa1.Name = "tsmixiafa1";
this.tsmixiafa1.Size = new System.Drawing.Size(152, 22);
- this.tsmixiafa1.Text = "下发";
- //
- // toolStripMenuItem1
- //
- this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
- //
- // tsmiexit
- //
- this.tsmiexit.Name = "tsmiexit";
- this.tsmiexit.Size = new System.Drawing.Size(152, 22);
- this.tsmiexit.Text = "退出";
+ this.tsmixiafa1.Text = "任务下发";
+ this.tsmixiafa1.Click += new System.EventHandler(this.tsmixiafa1_Click);
//
// tsmtongjibaobiao
//
@@ -969,7 +956,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmixinjian1;
private System.Windows.Forms.ToolStripMenuItem tsmishenhe1;
private System.Windows.Forms.ToolStripMenuItem tsmixiafa1;
- private System.Windows.Forms.ToolStripMenuItem tsmiexit;
private System.Windows.Forms.ToolStripMenuItem tsmtongjibaobiao;
private System.Windows.Forms.ToolStripMenuItem tsmirenyuanchuqin;
private System.Windows.Forms.ToolStripMenuItem tsmixunjianxiang;
@@ -1036,6 +1022,5 @@ private void InitializeComponent()
private System.Windows.Forms.Panel panel8;
private System.Windows.Forms.Button btnItem;
private System.Windows.Forms.ToolStripSeparator tsmidelete1;
- private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
}
}
View
14 Application/frmain.cs
@@ -206,9 +206,21 @@ private void tsmixunjianluxian_Click(object sender, EventArgs e)
private void tsmixinjian1_Click(object sender, EventArgs e)
{
- frmAddTask frm = new frmAddTask();
+ frmAddPlan frm = new frmAddPlan();
frm.ShowDialog();
}
+
+ private void tsmishenhe1_Click(object sender, EventArgs e)
+ {
+ frmAddPlanExamine frm = new frmAddPlanExamine();
+ frm.Show();
+ }
+
+ private void tsmixiafa1_Click(object sender, EventArgs e)
+ {
+ frmAddPlanToTask add = new frmAddPlanToTask();
+ add.ShowDialog();
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.