diff --git a/BBMPT.sln b/BBMPT.sln index b38d69a..3055002 100644 --- a/BBMPT.sln +++ b/BBMPT.sln @@ -60,6 +60,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrintInjectionBarCode", "Pr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PunchAndWeld", "PunchAndWeld\PunchAndWeld.csproj", "{D6371D99-5220-4A51-A72C-966FB4BFCD2C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveScreen", "FiveScreen\FiveScreen.csproj", "{7C80977B-EF23-4658-A6D4-664A12AB67BD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -172,6 +174,14 @@ Global {D6371D99-5220-4A51-A72C-966FB4BFCD2C}.Release|Any CPU.Build.0 = Release|Any CPU {D6371D99-5220-4A51-A72C-966FB4BFCD2C}.Release|x86.ActiveCfg = Release|Any CPU {D6371D99-5220-4A51-A72C-966FB4BFCD2C}.Release|x86.Build.0 = Release|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Debug|x86.ActiveCfg = Debug|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Debug|x86.Build.0 = Debug|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Release|Any CPU.Build.0 = Release|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Release|x86.ActiveCfg = Release|Any CPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/FiveScreen/FiveScreen.csproj b/FiveScreen/FiveScreen.csproj new file mode 100644 index 0000000..e52c1f9 --- /dev/null +++ b/FiveScreen/FiveScreen.csproj @@ -0,0 +1,152 @@ + + + + + Debug + AnyCPU + {7C80977B-EF23-4658-A6D4-664A12AB67BD} + WinExe + Properties + FiveScreen + FiveScreen + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + False + .\Tools.dll + + + + + Form + + + FrmCenter.cs + + + Form + + + FrmInjection2.cs + + + Form + + + FrmInjection1.cs + + + Form + + + FrmPainting3.cs + + + Form + + + FrmPainting2.cs + + + Form + + + FrmPainting1.cs + + + + + + FrmCenter.cs + + + FrmInjection2.cs + + + FrmInjection1.cs + + + FrmPainting3.cs + + + FrmPainting2.cs + + + FrmPainting1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + Designer + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FiveScreen/FrmCenter.Designer.cs b/FiveScreen/FrmCenter.Designer.cs new file mode 100644 index 0000000..ef73aa7 --- /dev/null +++ b/FiveScreen/FrmCenter.Designer.cs @@ -0,0 +1,104 @@ +namespace FiveScreen +{ + partial class FrmCenter + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.panel1 = new System.Windows.Forms.Panel(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // webBrowser1 + // + this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; + this.webBrowser1.Location = new System.Drawing.Point(0, 86); + this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScrollBarsEnabled = false; + this.webBrowser1.Size = new System.Drawing.Size(1904, 978); + this.webBrowser1.TabIndex = 3; + this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/PaintingResultScreen2.html"; + this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/PaintingResultScreen2.html", System.UriKind.Absolute); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.Transparent; + this.panel1.ForeColor = System.Drawing.Color.Transparent; + this.panel1.Location = new System.Drawing.Point(1231, 2); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(665, 59); + this.panel1.TabIndex = 4; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.webBrowser1, 0, 1); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 86F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1904, 1064); + this.tableLayoutPanel1.TabIndex = 5; + this.tableLayoutPanel1.DoubleClick += new System.EventHandler(this.tableLayoutPanel1_DoubleClick); + // + // FrmCenter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ControlText; + this.BackgroundImage = global::FiveScreen.Properties.Resources.底图; + this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ControlBox = false; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.panel1); + this.ImeMode = System.Windows.Forms.ImeMode.Off; + this.MinimumSize = new System.Drawing.Size(16, 16); + this.Name = "FrmCenter"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.TransparencyKey = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.tableLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + } +} + diff --git a/FiveScreen/FrmCenter.cs b/FiveScreen/FrmCenter.cs new file mode 100644 index 0000000..bbb786e --- /dev/null +++ b/FiveScreen/FrmCenter.cs @@ -0,0 +1,79 @@ +using DBUtility; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmCenter : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + + public FrmCenter() + { + InitializeComponent(); + + // this.WindowState = FormWindowState.Normal; + tableLayoutPanel1.MouseDown += FrmCenter_MouseDown; + tableLayoutPanel1.MouseMove += FrmCenter_MouseMove; + tableLayoutPanel1.MouseUp += FrmCenter_MouseUp; + this.WindowState = FormWindowState.Maximized; + + } + private void tableLayoutPanel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if (this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + } + private void panel1_DoubleClick(object sender, EventArgs e) + { + + } + + private void FrmCenter_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmCenter_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmCenter_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + + + } +} diff --git a/FiveScreen/FrmCenter.resx b/FiveScreen/FrmCenter.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiveScreen/FrmCenter.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiveScreen/FrmInjection1.Designer.cs b/FiveScreen/FrmInjection1.Designer.cs new file mode 100644 index 0000000..c9eb466 --- /dev/null +++ b/FiveScreen/FrmInjection1.Designer.cs @@ -0,0 +1,172 @@ +namespace FiveScreen +{ + partial class FrmInjection1 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.webBrowser4 = new System.Windows.Forms.WebBrowser(); + this.webBrowser3 = new System.Windows.Forms.WebBrowser(); + this.webBrowser2 = new System.Windows.Forms.WebBrowser(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackgroundImage = global::FiveScreen.Properties.Resources.北汽底图; + this.panel1.Controls.Add(this.webBrowser4); + this.panel1.Controls.Add(this.webBrowser3); + this.panel1.Controls.Add(this.webBrowser2); + this.panel1.Controls.Add(this.webBrowser1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(2856, 1410); + this.panel1.TabIndex = 0; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // webBrowser4 + // + this.webBrowser4.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.webBrowser4.Location = new System.Drawing.Point(962, 963); + this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser4.MinimumSize = new System.Drawing.Size(30, 30); + this.webBrowser4.Name = "webBrowser4"; + this.webBrowser4.ScrollBarsEnabled = false; + this.webBrowser4.Size = new System.Drawing.Size(1896, 447); + this.webBrowser4.TabIndex = 5; + this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-4.html", System.UriKind.Absolute); + // + // webBrowser3 + // + this.webBrowser3.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.webBrowser3.Location = new System.Drawing.Point(2, 963); + this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser3.MinimumSize = new System.Drawing.Size(30, 30); + this.webBrowser3.Name = "webBrowser3"; + this.webBrowser3.ScrollBarsEnabled = false; + this.webBrowser3.Size = new System.Drawing.Size(982, 447); + this.webBrowser3.TabIndex = 4; + this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-3.html", System.UriKind.Absolute); + // + // webBrowser2 + // + this.webBrowser2.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.webBrowser2.Location = new System.Drawing.Point(962, 234); + this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser2.MinimumSize = new System.Drawing.Size(30, 30); + this.webBrowser2.Name = "webBrowser2"; + this.webBrowser2.ScrollBarsEnabled = false; + this.webBrowser2.Size = new System.Drawing.Size(1896, 417); + this.webBrowser2.TabIndex = 3; + this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-2.html", System.UriKind.Absolute); + // + // webBrowser1 + // + this.webBrowser1.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.webBrowser1.Location = new System.Drawing.Point(2, 234); + this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(30, 30); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScrollBarsEnabled = false; + this.webBrowser1.Size = new System.Drawing.Size(982, 417); + this.webBrowser1.TabIndex = 2; + this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-1.html", System.UriKind.Absolute); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.BackColor = System.Drawing.Color.Transparent; + this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Location = new System.Drawing.Point(-8, 864); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(2848, 69); + this.label2.TabIndex = 1; + this.label2.Text = "注塑设备利用率"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(-8, 140); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(2848, 69); + this.label1.TabIndex = 0; + this.label1.Text = "注塑合格率"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FrmInjection1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(2856, 1410); + this.ControlBox = false; + this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Name = "FrmInjection1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Tag = "喷涂合格率"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.WebBrowser webBrowser3; + private System.Windows.Forms.WebBrowser webBrowser2; + private System.Windows.Forms.WebBrowser webBrowser4; + + } +} + diff --git a/FiveScreen/FrmInjection1.cs b/FiveScreen/FrmInjection1.cs new file mode 100644 index 0000000..f975b24 --- /dev/null +++ b/FiveScreen/FrmInjection1.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmInjection1 : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + public FrmInjection1() + { + InitializeComponent(); + panel1.MouseDown += FrmInjection1_MouseDown; + panel1.MouseMove += FrmInjection1_MouseMove; + panel1.MouseUp += FrmInjection1_MouseUp; + this.WindowState = FormWindowState.Maximized; + } + + private void panel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if (this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + + } + + private void FrmInjection1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmInjection1_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmInjection1_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + } +} diff --git a/FiveScreen/FrmInjection1.resx b/FiveScreen/FrmInjection1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiveScreen/FrmInjection1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiveScreen/FrmInjection2.Designer.cs b/FiveScreen/FrmInjection2.Designer.cs new file mode 100644 index 0000000..cee2014 --- /dev/null +++ b/FiveScreen/FrmInjection2.Designer.cs @@ -0,0 +1,329 @@ +namespace FiveScreen +{ + partial class FrmInjection2 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.panel1 = new System.Windows.Forms.Panel(); + this.labState6 = new System.Windows.Forms.Label(); + this.labState5 = new System.Windows.Forms.Label(); + this.labState4 = new System.Windows.Forms.Label(); + this.labState3 = new System.Windows.Forms.Label(); + this.labState2 = new System.Windows.Forms.Label(); + this.labState1 = new System.Windows.Forms.Label(); + this.labPass6 = new System.Windows.Forms.Label(); + this.labPass5 = new System.Windows.Forms.Label(); + this.labPass4 = new System.Windows.Forms.Label(); + this.labPass3 = new System.Windows.Forms.Label(); + this.labPass2 = new System.Windows.Forms.Label(); + this.labPass1 = new System.Windows.Forms.Label(); + this.labUse6 = new System.Windows.Forms.Label(); + this.labUse5 = new System.Windows.Forms.Label(); + this.labUse4 = new System.Windows.Forms.Label(); + this.labUse3 = new System.Windows.Forms.Label(); + this.labUse2 = new System.Windows.Forms.Label(); + this.labUse1 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // timer1 + // + this.timer1.Interval = 60000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // panel1 + // + this.panel1.AutoScroll = true; + this.panel1.BackgroundImage = global::FiveScreen.Properties.Resources.zhusu2; + this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.panel1.Controls.Add(this.labState6); + this.panel1.Controls.Add(this.labState5); + this.panel1.Controls.Add(this.labState4); + this.panel1.Controls.Add(this.labState3); + this.panel1.Controls.Add(this.labState2); + this.panel1.Controls.Add(this.labState1); + this.panel1.Controls.Add(this.labPass6); + this.panel1.Controls.Add(this.labPass5); + this.panel1.Controls.Add(this.labPass4); + this.panel1.Controls.Add(this.labPass3); + this.panel1.Controls.Add(this.labPass2); + this.panel1.Controls.Add(this.labPass1); + this.panel1.Controls.Add(this.labUse6); + this.panel1.Controls.Add(this.labUse5); + this.panel1.Controls.Add(this.labUse4); + this.panel1.Controls.Add(this.labUse3); + this.panel1.Controls.Add(this.labUse2); + this.panel1.Controls.Add(this.labUse1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.TabIndex = 0; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // labState6 + // + this.labState6.BackColor = System.Drawing.Color.Transparent; + this.labState6.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState6.ForeColor = System.Drawing.Color.White; + this.labState6.Location = new System.Drawing.Point(1587, 909); + this.labState6.Name = "labState6"; + this.labState6.Size = new System.Drawing.Size(269, 119); + this.labState6.TabIndex = 17; + this.labState6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labState5 + // + this.labState5.BackColor = System.Drawing.Color.Transparent; + this.labState5.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState5.ForeColor = System.Drawing.Color.White; + this.labState5.Location = new System.Drawing.Point(1585, 788); + this.labState5.Name = "labState5"; + this.labState5.Size = new System.Drawing.Size(269, 119); + this.labState5.TabIndex = 16; + this.labState5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labState4 + // + this.labState4.BackColor = System.Drawing.Color.Transparent; + this.labState4.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState4.ForeColor = System.Drawing.Color.White; + this.labState4.Location = new System.Drawing.Point(1586, 661); + this.labState4.Name = "labState4"; + this.labState4.Size = new System.Drawing.Size(269, 119); + this.labState4.TabIndex = 15; + this.labState4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labState3 + // + this.labState3.BackColor = System.Drawing.Color.Transparent; + this.labState3.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState3.ForeColor = System.Drawing.Color.White; + this.labState3.Location = new System.Drawing.Point(1587, 540); + this.labState3.Name = "labState3"; + this.labState3.Size = new System.Drawing.Size(269, 119); + this.labState3.TabIndex = 14; + this.labState3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labState2 + // + this.labState2.BackColor = System.Drawing.Color.Transparent; + this.labState2.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState2.ForeColor = System.Drawing.Color.White; + this.labState2.Location = new System.Drawing.Point(1588, 420); + this.labState2.Name = "labState2"; + this.labState2.Size = new System.Drawing.Size(269, 119); + this.labState2.TabIndex = 13; + this.labState2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labState1 + // + this.labState1.BackColor = System.Drawing.Color.Transparent; + this.labState1.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labState1.ForeColor = System.Drawing.Color.White; + this.labState1.Location = new System.Drawing.Point(1588, 292); + this.labState1.Name = "labState1"; + this.labState1.Size = new System.Drawing.Size(269, 119); + this.labState1.TabIndex = 12; + this.labState1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass6 + // + this.labPass6.BackColor = System.Drawing.Color.Transparent; + this.labPass6.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass6.ForeColor = System.Drawing.Color.White; + this.labPass6.Location = new System.Drawing.Point(946, 917); + this.labPass6.Name = "labPass6"; + this.labPass6.Size = new System.Drawing.Size(308, 119); + this.labPass6.TabIndex = 11; + this.labPass6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass5 + // + this.labPass5.BackColor = System.Drawing.Color.Transparent; + this.labPass5.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass5.ForeColor = System.Drawing.Color.White; + this.labPass5.Location = new System.Drawing.Point(944, 796); + this.labPass5.Name = "labPass5"; + this.labPass5.Size = new System.Drawing.Size(308, 119); + this.labPass5.TabIndex = 10; + this.labPass5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass4 + // + this.labPass4.BackColor = System.Drawing.Color.Transparent; + this.labPass4.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass4.ForeColor = System.Drawing.Color.White; + this.labPass4.Location = new System.Drawing.Point(945, 669); + this.labPass4.Name = "labPass4"; + this.labPass4.Size = new System.Drawing.Size(308, 119); + this.labPass4.TabIndex = 9; + this.labPass4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass3 + // + this.labPass3.BackColor = System.Drawing.Color.Transparent; + this.labPass3.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass3.ForeColor = System.Drawing.Color.White; + this.labPass3.Location = new System.Drawing.Point(946, 548); + this.labPass3.Name = "labPass3"; + this.labPass3.Size = new System.Drawing.Size(308, 119); + this.labPass3.TabIndex = 8; + this.labPass3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass2 + // + this.labPass2.BackColor = System.Drawing.Color.Transparent; + this.labPass2.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass2.ForeColor = System.Drawing.Color.White; + this.labPass2.Location = new System.Drawing.Point(947, 428); + this.labPass2.Name = "labPass2"; + this.labPass2.Size = new System.Drawing.Size(308, 119); + this.labPass2.TabIndex = 7; + this.labPass2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labPass1 + // + this.labPass1.BackColor = System.Drawing.Color.Transparent; + this.labPass1.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labPass1.ForeColor = System.Drawing.Color.White; + this.labPass1.Location = new System.Drawing.Point(947, 300); + this.labPass1.Name = "labPass1"; + this.labPass1.Size = new System.Drawing.Size(308, 119); + this.labPass1.TabIndex = 6; + this.labPass1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse6 + // + this.labUse6.BackColor = System.Drawing.Color.Transparent; + this.labUse6.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse6.ForeColor = System.Drawing.Color.White; + this.labUse6.Location = new System.Drawing.Point(657, 912); + this.labUse6.Name = "labUse6"; + this.labUse6.Size = new System.Drawing.Size(274, 119); + this.labUse6.TabIndex = 5; + this.labUse6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse5 + // + this.labUse5.BackColor = System.Drawing.Color.Transparent; + this.labUse5.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse5.ForeColor = System.Drawing.Color.White; + this.labUse5.Location = new System.Drawing.Point(655, 791); + this.labUse5.Name = "labUse5"; + this.labUse5.Size = new System.Drawing.Size(274, 119); + this.labUse5.TabIndex = 4; + this.labUse5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse4 + // + this.labUse4.BackColor = System.Drawing.Color.Transparent; + this.labUse4.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse4.ForeColor = System.Drawing.Color.White; + this.labUse4.Location = new System.Drawing.Point(656, 664); + this.labUse4.Name = "labUse4"; + this.labUse4.Size = new System.Drawing.Size(274, 119); + this.labUse4.TabIndex = 3; + this.labUse4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse3 + // + this.labUse3.BackColor = System.Drawing.Color.Transparent; + this.labUse3.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse3.ForeColor = System.Drawing.Color.White; + this.labUse3.Location = new System.Drawing.Point(657, 543); + this.labUse3.Name = "labUse3"; + this.labUse3.Size = new System.Drawing.Size(274, 119); + this.labUse3.TabIndex = 2; + this.labUse3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse2 + // + this.labUse2.BackColor = System.Drawing.Color.Transparent; + this.labUse2.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse2.ForeColor = System.Drawing.Color.White; + this.labUse2.Location = new System.Drawing.Point(658, 423); + this.labUse2.Name = "labUse2"; + this.labUse2.Size = new System.Drawing.Size(274, 119); + this.labUse2.TabIndex = 1; + this.labUse2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labUse1 + // + this.labUse1.BackColor = System.Drawing.Color.Transparent; + this.labUse1.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.labUse1.ForeColor = System.Drawing.Color.White; + this.labUse1.Location = new System.Drawing.Point(658, 295); + this.labUse1.Name = "labUse1"; + this.labUse1.Size = new System.Drawing.Size(274, 119); + this.labUse1.TabIndex = 0; + this.labUse1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FrmInjection2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ControlBox = false; + this.Controls.Add(this.panel1); + this.Name = "FrmInjection2"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Tag = "喷涂合格率"; + this.Load += new System.EventHandler(this.FrmInjection2_Load); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label labState6; + private System.Windows.Forms.Label labState5; + private System.Windows.Forms.Label labState4; + private System.Windows.Forms.Label labState3; + private System.Windows.Forms.Label labState2; + private System.Windows.Forms.Label labState1; + private System.Windows.Forms.Label labPass6; + private System.Windows.Forms.Label labPass5; + private System.Windows.Forms.Label labPass4; + private System.Windows.Forms.Label labPass3; + private System.Windows.Forms.Label labPass2; + private System.Windows.Forms.Label labPass1; + private System.Windows.Forms.Label labUse6; + private System.Windows.Forms.Label labUse5; + private System.Windows.Forms.Label labUse4; + private System.Windows.Forms.Label labUse3; + private System.Windows.Forms.Label labUse2; + private System.Windows.Forms.Label labUse1; + private System.Windows.Forms.Timer timer1; + + } +} + diff --git a/FiveScreen/FrmInjection2.cs b/FiveScreen/FrmInjection2.cs new file mode 100644 index 0000000..1632f60 --- /dev/null +++ b/FiveScreen/FrmInjection2.cs @@ -0,0 +1,401 @@ +using DBUtility; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmInjection2 : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + public FrmInjection2() + { + InitializeComponent(); + panel1.MouseDown += FrmInjection1_MouseDown; + panel1.MouseMove += FrmInjection1_MouseMove; + panel1.MouseUp += FrmInjection1_MouseUp; + this.WindowState = FormWindowState.Maximized; + } + + private void panel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if(this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + + } + + private void FrmInjection2_Load(object sender, EventArgs e) + { + LoadDeviceState(); + } + void LoadDeviceState() + { + DataTable dt = new DataTable(); + try + { + #region 第一阶段内容 + Label[] labUse = { labUse1, labUse2, labUse3, labUse4, labUse5, labUse6 }; + Label[] labPass = { labPass1, labPass2, labPass3, labPass4, labPass5, labPass6 }; + Label[] labState = { labState1, labState2, labState3, labState4, labState5, labState6 }; + + #region sql + string sql = @" + SELECT * INTO #temp + FROM + ( + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM01' + ORDER BY CreateTime DESC) a + UNION ALL + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM02' + ORDER BY CreateTime DESC) b + UNION ALL + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM03' + ORDER BY CreateTime DESC) c + UNION ALL + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM04' + ORDER BY CreateTime DESC) d + UNION ALL + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM05' + ORDER BY CreateTime DESC) e + UNION ALL + SELECT * from + (SELECT TOP 1 StationID, StationNo, [UseRate], [PassRate] + FROM tb_Report_FiveScreenLast + WHERE stationNo = 'IM06' + ORDER BY CreateTime DESC) f + ) aa + + SELECT #temp.StationID, #temp.StationNo,#temp.UseRate,#temp.PassRate,StartTime,EndTime,(CASE WHEN (starttime is not null and EndTime IS NULL) OR EndTime = '' THEN '停机' ELSE '运行' END) [State] INTO #tmp FROM #temp + LEFT JOIN tb_Injection_DownRecord + ON tb_Injection_DownRecord.StationID = #temp.StationID + ORDER BY StartTime DESC + + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM01' + ORDER BY StartTime DESC) a + UNION ALL + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM02' + ORDER BY StartTime DESC) b + UNION ALL + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM03' + ORDER BY StartTime DESC) c + UNION ALL + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM04' + ORDER BY StartTime DESC) d + UNION ALL + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM05' + ORDER BY StartTime DESC) e + UNION ALL + SELECT * FROM ( + SELECT TOP 1 * + FROM #tmp + WHERE stationNo = 'IM06' + ORDER BY StartTime DESC) f + + + DROP TABLE #temp; + DROP TABLE #tmp; + "; + #endregion + dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); + if (dt != null && dt.Rows.Count > 0) + { + for (int i = 0; i < dt.Rows.Count; i++) + { + labUse[i].Text = dt.Rows[i]["UseRate"].ToString(); + //labPass[i].Text = dt.Rows[i]["PassRate"].ToString(); + labState[i].Text = dt.Rows[i]["State"].ToString(); + } + } + #endregion + + #region 第二阶段内容 + + Label[] labPro = new Label[6]; + Label[] labProNum = new Label[6]; + for (int i = 0; i < 6; i++) + { + labPro[i] = new Label(); + labPro[i].Name = "labPro" + i.ToString(); + labPro[i].BackColor = Color.Transparent; + labPro[i].ForeColor = Color.White; + labPro[i].Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + labPro[i].TextAlign = ContentAlignment.MiddleCenter; + labPro[i].Size = new System.Drawing.Size(269, 119); + labPro[i].Location = new System.Drawing.Point(353, 298 + i * 122); + //labPro[i].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))); + panel1.Controls.Add(labPro[i]); + + labProNum[i] = new Label(); + labProNum[i].Name = "labProNum" + i.ToString(); + labProNum[i].BackColor = Color.Transparent; + labProNum[i].ForeColor = Color.White; + labProNum[i].Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + labProNum[i].TextAlign = ContentAlignment.MiddleCenter; + labProNum[i].Size = new System.Drawing.Size(295, 111); + labProNum[i].Location = new System.Drawing.Point(1273, 300 + i * 123); + //labProNum[i].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))); + panel1.Controls.Add(labProNum[i]); + } + + GetLabContent(); + + #endregion + + timer1.Enabled = true; + } + catch (Exception ex) + { + LogHelper.WriteLog(ex.ToString(), "注塑六设备大屏"); + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + } + } + + private void timer1_Tick(object sender, EventArgs e) + { + try + { + LoadDeviceState(); + //GetLabContent(); + } + catch (Exception ex) + { + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + } + } + + private void GetLabContent() + { + try + { + #region 产品名称 + + for (int i = 0; i < 6; i++) + { + string sql_pro = @" + select top 1 ProductName as [Plan] from tb_Product WITH (NOLOCK) where StockNo = ( + select top 1 StockNo from tb_InjectionPlan WITH (NOLOCK) where StationID = ( + select StationID from tb_Station WITH (NOLOCK) where StationNo = '" + "IM0" + (i + 1).ToString() + @"' ) + AND (IsFinish is null or IsFinish = 0) + ORDER BY BeginTime ASC + ) + or PartNo = ( + select top 1 PartNo from tb_InjectionPlan WITH (NOLOCK) where StationID = ( + select StationID from tb_Station WITH (NOLOCK) where StationNo = '" + "IM0" + (i + 1).ToString() + @"' ) + AND (IsFinish is null or IsFinish = 0) + ORDER BY BeginTime ASC + ) + "; + object aa = SqlHelper.ExecuteScalar(SqlHelper.SqlConnString, CommandType.Text, sql_pro, null); + if (aa != null) + { + this.panel1.Controls.Find("labPro" + i.ToString(), true)[0].Text = aa.ToString(); + } + else + { + this.panel1.Controls.Find("labPro" + i.ToString(), true)[0].Text = ""; + } + } + + #endregion + + #region 生产数 + + for (int i = 0; i < 6; i++) + { + string date = DateTime.Now.ToString("yyyy-MM-dd"); + if (DateTime.Now.Hour >= 0 && DateTime.Now.Hour < 8) + { + date = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); + } + string sql_num = @" + SELECT TOP 1 isnull(ProductCount,0) ProductCount, isnull(BadCount,0) BadCount + FROM tb_Product_Injection a WITH (NOLOCK) + WHERE a.StationID = ( SELECT StationID from tb_Station WITH (NOLOCK) where StationNo = '" + "IM0" + (i + 1).ToString() + @"' ) + AND (a.StockNo = ( + select top 1 StockNo from tb_InjectionPlan WITH (NOLOCK) where StationID = ( select StationID from tb_Station where StationNo = '" + "IM0" + (i + 1).ToString() + @"') + AND (IsFinish is null or IsFinish = 0) + ORDER BY BeginTime ASC + ) + OR a.PartNo = ( + select top 1 PartNo from tb_InjectionPlan WITH (NOLOCK) where StationID = ( select StationID from tb_Station where StationNo = '" + "IM0" + (i + 1).ToString() + @"') + AND (IsFinish is null or IsFinish = 0) + ORDER BY BeginTime ASC + )) + and a.PlanID = ( + select top 1 InjectionPlanID from tb_InjectionPlan WITH (NOLOCK) where StationID = ( select StationID from tb_Station where StationNo = '" + "IM0" + (i + 1).ToString() + @"') + AND (IsFinish is null or IsFinish = 0) + ORDER BY BeginTime ASC + ) + AND a.ProductDate = '" + date + @"' + AND a.ClassName = '" + GetWorkClass() + @"' + "; + //object bb = SqlHelper.ExecuteScalar(SqlHelper.SqlConnString, CommandType.Text, sql_num, null); + //if (bb != null) + //{ + // this.panel1.Controls.Find("labProNum" + i.ToString(), true)[0].Text = bb.ToString(); + //} + //else + //{ + // this.panel1.Controls.Find("labProNum" + i.ToString(), true)[0].Text = ""; + //} + + DataTable dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql_num, null); + if (dt != null && dt.Rows.Count > 0) + { + this.panel1.Controls.Find("labProNum" + i.ToString(), true)[0].Text = dt.Rows[0]["ProductCount"].ToString(); + + int prc = 0; int badc = 0; + string PassCount = ""; + Int32.TryParse(dt.Rows[0]["ProductCount"].ToString(), out prc); + Int32.TryParse(dt.Rows[0]["BadCount"].ToString(), out badc); + PassCount = (prc - badc).ToString(); + + int passc = 0; + double compc = 0.0; + Int32.TryParse(PassCount, out passc); + Double.TryParse(dt.Rows[0]["ProductCount"].ToString(), out compc); + if (compc == 0.0) + { + this.panel1.Controls.Find("labPass" + (i + 1).ToString(), true)[0].Text = "0.0%"; + } + else + { + this.panel1.Controls.Find("labPass" + (i + 1).ToString(), true)[0].Text = (passc / compc * 100).ToString("0.00") + "%"; + } + } + else + { + this.panel1.Controls.Find("labProNum" + i.ToString(), true)[0].Text = "0"; + this.panel1.Controls.Find("labPass" + (i + 1).ToString(), true)[0].Text = "0.0%"; + } + } + + #endregion + } + catch (Exception ex) + { + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + } + } + + /// + /// 获取班次,规定早8至晚8为A班 + /// + /// + public string GetWorkClass() + { + bool classA = IsBetweenTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "2019-06-12 08:00:00", "2019-06-12 20:00:00"); + if (classA) + { + return "A班"; + } + else + { + return "B班"; + } + } + + /// + /// 判断传入时间是否在工作时间段内 + /// + /// + /// + /// + /// + public static bool IsBetweenTime(string timeStr, string startTime, string endTime) + { + //判断传入时间是否在工作时间段内 + try + { + TimeSpan startSpan = DateTime.Parse(startTime).TimeOfDay; + TimeSpan endSpan = DateTime.Parse(endTime).TimeOfDay; + + DateTime t1 = Convert.ToDateTime(timeStr); + TimeSpan dspNow = t1.TimeOfDay; + if (dspNow > startSpan && dspNow < endSpan) + { + return true; + } + return false; + } + catch (Exception ex) + { + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + return false; + } + } + + private void FrmInjection1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmInjection1_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmInjection1_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + } +} diff --git a/FiveScreen/FrmInjection2.resx b/FiveScreen/FrmInjection2.resx new file mode 100644 index 0000000..1f666f2 --- /dev/null +++ b/FiveScreen/FrmInjection2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/FiveScreen/FrmPainting1.Designer.cs b/FiveScreen/FrmPainting1.Designer.cs new file mode 100644 index 0000000..d3da5e2 --- /dev/null +++ b/FiveScreen/FrmPainting1.Designer.cs @@ -0,0 +1,168 @@ +namespace FiveScreen +{ + partial class FrmPainting1 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.webBrowser4 = new System.Windows.Forms.WebBrowser(); + this.webBrowser3 = new System.Windows.Forms.WebBrowser(); + this.webBrowser2 = new System.Windows.Forms.WebBrowser(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackgroundImage = global::FiveScreen.Properties.Resources.北汽底图; + this.panel1.Controls.Add(this.webBrowser4); + this.panel1.Controls.Add(this.webBrowser3); + this.panel1.Controls.Add(this.webBrowser2); + this.panel1.Controls.Add(this.webBrowser1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.TabIndex = 0; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // webBrowser4 + // + this.webBrowser4.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.webBrowser4.Location = new System.Drawing.Point(640, 642); + this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.Name = "webBrowser4"; + this.webBrowser4.ScrollBarsEnabled = false; + this.webBrowser4.Size = new System.Drawing.Size(1264, 422); + this.webBrowser4.TabIndex = 5; + this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-4.html", System.UriKind.Absolute); + // + // webBrowser3 + // + this.webBrowser3.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.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.Name = "webBrowser3"; + this.webBrowser3.ScrollBarsEnabled = false; + this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.TabIndex = 4; + this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-3.html", System.UriKind.Absolute); + // + // webBrowser2 + // + this.webBrowser2.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.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.Name = "webBrowser2"; + this.webBrowser2.ScrollBarsEnabled = false; + this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.TabIndex = 3; + this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-2.html", System.UriKind.Absolute); + // + // webBrowser1 + // + this.webBrowser1.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.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScrollBarsEnabled = false; + this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.TabIndex = 2; + this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-1.html", System.UriKind.Absolute); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.BackColor = System.Drawing.Color.Transparent; + this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.TabIndex = 1; + this.label2.Text = "喷涂总合格率"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.TabIndex = 0; + this.label1.Text = "喷涂一次合格率"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FrmPainting1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ControlBox = false; + this.Controls.Add(this.panel1); + this.Name = "FrmPainting1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Tag = "喷涂合格率"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.WebBrowser webBrowser3; + private System.Windows.Forms.WebBrowser webBrowser2; + private System.Windows.Forms.WebBrowser webBrowser4; + + } +} + diff --git a/FiveScreen/FrmPainting1.cs b/FiveScreen/FrmPainting1.cs new file mode 100644 index 0000000..98a42ef --- /dev/null +++ b/FiveScreen/FrmPainting1.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmPainting1 : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + public FrmPainting1() + { + InitializeComponent(); + panel1.MouseDown += FrmInjection1_MouseDown; + panel1.MouseMove += FrmInjection1_MouseMove; + panel1.MouseUp += FrmInjection1_MouseUp; + this.WindowState = FormWindowState.Maximized; + } + + private void panel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if (this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + } + + private void FrmInjection1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmInjection1_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmInjection1_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + } +} diff --git a/FiveScreen/FrmPainting1.resx b/FiveScreen/FrmPainting1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiveScreen/FrmPainting1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiveScreen/FrmPainting2.Designer.cs b/FiveScreen/FrmPainting2.Designer.cs new file mode 100644 index 0000000..572514b --- /dev/null +++ b/FiveScreen/FrmPainting2.Designer.cs @@ -0,0 +1,172 @@ +namespace FiveScreen +{ + partial class FrmPainting2 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.webBrowser4 = new System.Windows.Forms.WebBrowser(); + this.webBrowser3 = new System.Windows.Forms.WebBrowser(); + this.webBrowser2 = new System.Windows.Forms.WebBrowser(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackgroundImage = global::FiveScreen.Properties.Resources.北汽底图; + this.panel1.Controls.Add(this.webBrowser4); + this.panel1.Controls.Add(this.webBrowser3); + this.panel1.Controls.Add(this.webBrowser2); + this.panel1.Controls.Add(this.webBrowser1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.TabIndex = 0; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // webBrowser4 + // + this.webBrowser4.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.webBrowser4.Location = new System.Drawing.Point(640, 642); + this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.Name = "webBrowser4"; + this.webBrowser4.ScrollBarsEnabled = false; + this.webBrowser4.Size = new System.Drawing.Size(1264, 422); + this.webBrowser4.TabIndex = 5; + this.webBrowser4.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-4.html"; + this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-4.html", System.UriKind.Absolute); + // + // webBrowser3 + // + this.webBrowser3.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.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.Name = "webBrowser3"; + this.webBrowser3.ScrollBarsEnabled = false; + this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.TabIndex = 4; + this.webBrowser3.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-3.html"; + this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-3.html", System.UriKind.Absolute); + // + // webBrowser2 + // + this.webBrowser2.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.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.Name = "webBrowser2"; + this.webBrowser2.ScrollBarsEnabled = false; + this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.TabIndex = 3; + this.webBrowser2.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-2.html"; + this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-2.html", System.UriKind.Absolute); + // + // webBrowser1 + // + this.webBrowser1.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.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScrollBarsEnabled = false; + this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.TabIndex = 2; + this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-1.html"; + this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-1.html", System.UriKind.Absolute); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.BackColor = System.Drawing.Color.Transparent; + this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.TabIndex = 1; + this.label2.Text = "运行滑撬数"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.TabIndex = 0; + this.label1.Text = "喷涂设备利用率"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FrmPainting2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ControlBox = false; + this.Controls.Add(this.panel1); + this.Name = "FrmPainting2"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Tag = "喷涂合格率"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.WebBrowser webBrowser3; + private System.Windows.Forms.WebBrowser webBrowser2; + private System.Windows.Forms.WebBrowser webBrowser4; + + } +} + diff --git a/FiveScreen/FrmPainting2.cs b/FiveScreen/FrmPainting2.cs new file mode 100644 index 0000000..087eb5c --- /dev/null +++ b/FiveScreen/FrmPainting2.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmPainting2 : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + public FrmPainting2() + { + InitializeComponent(); + panel1.MouseDown += FrmInjection1_MouseDown; + panel1.MouseMove += FrmInjection1_MouseMove; + panel1.MouseUp += FrmInjection1_MouseUp; + this.WindowState = FormWindowState.Maximized; + } + + private void panel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if (this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + } + + private void FrmInjection1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmInjection1_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmInjection1_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + } +} diff --git a/FiveScreen/FrmPainting2.resx b/FiveScreen/FrmPainting2.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiveScreen/FrmPainting2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiveScreen/FrmPainting3.Designer.cs b/FiveScreen/FrmPainting3.Designer.cs new file mode 100644 index 0000000..d5bf7bc --- /dev/null +++ b/FiveScreen/FrmPainting3.Designer.cs @@ -0,0 +1,168 @@ +namespace FiveScreen +{ + partial class FrmPainting3 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.webBrowser4 = new System.Windows.Forms.WebBrowser(); + this.webBrowser3 = new System.Windows.Forms.WebBrowser(); + this.webBrowser2 = new System.Windows.Forms.WebBrowser(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackgroundImage = global::FiveScreen.Properties.Resources.北汽底图; + this.panel1.Controls.Add(this.webBrowser4); + this.panel1.Controls.Add(this.webBrowser3); + this.panel1.Controls.Add(this.webBrowser2); + this.panel1.Controls.Add(this.webBrowser1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.TabIndex = 0; + this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); + // + // webBrowser4 + // + this.webBrowser4.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.webBrowser4.Location = new System.Drawing.Point(641, 642); + this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.Name = "webBrowser4"; + this.webBrowser4.ScrollBarsEnabled = false; + this.webBrowser4.Size = new System.Drawing.Size(1263, 422); + this.webBrowser4.TabIndex = 5; + this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-4.html", System.UriKind.Absolute); + // + // webBrowser3 + // + this.webBrowser3.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.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.Name = "webBrowser3"; + this.webBrowser3.ScrollBarsEnabled = false; + this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.TabIndex = 4; + this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-3.html", System.UriKind.Absolute); + // + // webBrowser2 + // + this.webBrowser2.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.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.Name = "webBrowser2"; + this.webBrowser2.ScrollBarsEnabled = false; + this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.TabIndex = 3; + this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-2.html", System.UriKind.Absolute); + // + // webBrowser1 + // + this.webBrowser1.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.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScrollBarsEnabled = false; + this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.TabIndex = 2; + this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-1.html", System.UriKind.Absolute); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.BackColor = System.Drawing.Color.Transparent; + this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.TabIndex = 1; + this.label2.Text = "发货数"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.TabIndex = 0; + this.label1.Text = "喷涂入库套数"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FrmPainting3 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ControlBox = false; + this.Controls.Add(this.panel1); + this.Name = "FrmPainting3"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Tag = "喷涂合格率"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.WebBrowser webBrowser3; + private System.Windows.Forms.WebBrowser webBrowser2; + private System.Windows.Forms.WebBrowser webBrowser4; + + } +} + diff --git a/FiveScreen/FrmPainting3.cs b/FiveScreen/FrmPainting3.cs new file mode 100644 index 0000000..8e6b174 --- /dev/null +++ b/FiveScreen/FrmPainting3.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + public partial class FrmPainting3 : Form + { + bool isMouseDown = false; // 窗体是否移动 + Point currentFormLocation = new Point(); // 当前窗体位置 + Point currentMouseOffset = new Point(); // 当前鼠标的按下位置 + public FrmPainting3() + { + InitializeComponent(); + panel1.MouseDown += FrmInjection1_MouseDown; + panel1.MouseMove += FrmInjection1_MouseMove; + panel1.MouseUp += FrmInjection1_MouseUp; + this.WindowState = FormWindowState.Maximized; + } + + private void panel1_DoubleClick(object sender, EventArgs e) + { + //Application.Exit(); + if (this.WindowState == FormWindowState.Maximized) + { + this.WindowState = FormWindowState.Normal; + } + else + { + this.WindowState = FormWindowState.Maximized; + } + } + + private void FrmInjection1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + currentFormLocation = this.Location; + currentMouseOffset = Control.MousePosition; + } + } + + private void FrmInjection1_MouseMove(object sender, MouseEventArgs e) + { + int rangeX = 0, rangeY = 0; // 计算当前鼠标光标的位移,让窗体进行相同大小的位移 + if (isMouseDown) + { + Point pt = Control.MousePosition; + rangeX = currentMouseOffset.X - pt.X; + rangeY = currentMouseOffset.Y - pt.Y; + this.Location = new Point(currentFormLocation.X - rangeX, currentFormLocation.Y - rangeY); + } + } + + private void FrmInjection1_MouseUp(object sender, MouseEventArgs e) + { + isMouseDown = false; // 停止移动 + } + } +} diff --git a/FiveScreen/FrmPainting3.resx b/FiveScreen/FrmPainting3.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiveScreen/FrmPainting3.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiveScreen/LogHelper.cs b/FiveScreen/LogHelper.cs new file mode 100644 index 0000000..81e7ee8 --- /dev/null +++ b/FiveScreen/LogHelper.cs @@ -0,0 +1,133 @@ +using DBUtility; +using System; +using System.Data; +using System.IO; +using System.Text; + +namespace FiveScreen +{ + public class LogHelper + { + private static string CodeVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().Trim(); + + // + //保存日志的文件夹 + // + private static string logPath = AppDomain.CurrentDomain.BaseDirectory + @"log\"; + + /// + /// 写日志 + /// + /// + /// + public static void WriteLog(string msg, string errorFile = "") + { + try + { + if (string.IsNullOrEmpty(msg)) + { + return; + } + else + { + msg = string.Format("程序版本号:{0},Time:{1},Message:{2}", CodeVersion, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff"), msg); + } + //如果不存在log文件夹 则创建 + if (!Directory.Exists(logPath)) + { + Directory.CreateDirectory(logPath); + } + + StreamWriter sw = File.AppendText(logPath + errorFile + DateTime.Now.ToString("yyyyMMdd") + ".Log"); + sw.WriteLine(msg); + sw.Close(); + } + catch (Exception ex) + { + + } + } + /// + /// 拼接错误日志 + /// + /// 异常类 + /// 异常类文件夹名,可为空 + public static void WriteLogManager(Exception ex, string errorFile = "") + { + StringBuilder str = new StringBuilder();//保存到文件中的日志信息 + str.AppendLine("****************************异常文本****************************"); + str.AppendLine("【程序版本号】:" + CodeVersion + " 【出现时间】:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); + if (ex != null) + { + str.AppendLine(string.Format("【异常类型】:{0}\r\n【异常信息】:{1}\r\n【异常方法】:{2}\r\n【堆栈调用】:{3}", ex.GetType().Name, ex.Message, ex.TargetSite, ex.StackTrace)); + } + else + { + str.AppendLine(string.Format("【未处理应用程序线程错误】:{0}", ex)); + } + str.AppendLine("****************************************************************"); + //保存日志 + WriteLog(str.ToString(), "Error" + errorFile); + } + + /// + /// 系统日志(写数据库) + /// + /// + /// + public static void WriteSysLogBase(string msg, string method) + { + try + { + if (msg.Contains("'")) + { + msg = msg.Replace("'", "''"); + } + string sql = @" INSERT INTO [dbo].[LogSys] + ([ID] + ,[SysContent] + ,[SysSource] + ,[CreateTime]) + VALUES + ((SELECT NEWID()) + ,'" + msg + @"' + ,'" + method + @"' + ,(SELECT GETDATE())) "; + SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + } + catch (Exception ex) + { + //throw ex; + } + } + + /// + /// 错误日志(写数据库) + /// + /// + /// + public static void WriteErrLogBase(string msg, string method) + { + try + { + string sql = @" + INSERT INTO [dbo].[LogErr] + ([ID] + ,[ErrContent] + ,[ErrSource] + ,[ErrTime]) + VALUES + ((SELECT NEWID()) + ,'" + msg + @"' + ,'" + method + @"' + ,(SELECT GETDATE())) + "; + SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + } + catch (Exception ex) + { + //throw ex; + } + } + } +} diff --git a/FiveScreen/Program.cs b/FiveScreen/Program.cs new file mode 100644 index 0000000..8bd4dc6 --- /dev/null +++ b/FiveScreen/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiveScreen +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + //Application.Run(new FrmInjection2()); + Application.Run(new FrmCenter()); + //Application.Run(new FrmPainting3()); + } + } +} diff --git a/FiveScreen/Properties/AssemblyInfo.cs b/FiveScreen/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..73c25e2 --- /dev/null +++ b/FiveScreen/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("FiveScreen")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FiveScreen")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("2c5d7cab-b77f-4a05-a4f3-691fed3f51f2")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.1")] +[assembly: AssemblyFileVersion("1.0.0.1")] diff --git a/FiveScreen/Properties/Resources.Designer.cs b/FiveScreen/Properties/Resources.Designer.cs new file mode 100644 index 0000000..145c8d2 --- /dev/null +++ b/FiveScreen/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace FiveScreen.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FiveScreen.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 使用此强类型资源类,为所有资源查找 + /// 重写当前线程的 CurrentUICulture 属性。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap zhusu2 { + get { + object obj = ResourceManager.GetObject("zhusu2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 北汽底图 { + get { + object obj = ResourceManager.GetObject("北汽底图", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 底图 { + get { + object obj = ResourceManager.GetObject("底图", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 底图2 { + get { + object obj = ResourceManager.GetObject("底图2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/FiveScreen/Properties/Resources.resx b/FiveScreen/Properties/Resources.resx new file mode 100644 index 0000000..19d5f9e --- /dev/null +++ b/FiveScreen/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\北汽底图.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\底图2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\底图.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\zhusu2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/FiveScreen/Properties/Settings.Designer.cs b/FiveScreen/Properties/Settings.Designer.cs new file mode 100644 index 0000000..1b225cc --- /dev/null +++ b/FiveScreen/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FiveScreen.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/FiveScreen/Tools.dll b/FiveScreen/Tools.dll new file mode 100644 index 0000000..684e01b Binary files /dev/null and b/FiveScreen/Tools.dll differ diff --git a/PaintingScreen/Handler/Function.cs b/PaintingScreen/Handler/Function.cs index 70e246b..c2be4af 100644 --- a/PaintingScreen/Handler/Function.cs +++ b/PaintingScreen/Handler/Function.cs @@ -56,7 +56,7 @@ namespace PaintingScreen.Handler -- 一次合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #a - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE InspectTimes = '1' AND " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -64,7 +64,7 @@ namespace PaintingScreen.Handler -- 总合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #b - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -72,7 +72,7 @@ namespace PaintingScreen.Handler --总下线数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #c - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult in ('[合格]','[抛光]','报废') AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -158,7 +158,7 @@ namespace PaintingScreen.Handler -- 一次合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #a - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE InspectTimes = '1' AND " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -166,7 +166,7 @@ namespace PaintingScreen.Handler -- 总合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #b - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -176,13 +176,13 @@ namespace PaintingScreen.Handler ( SELECT num, productInfo FROM (SELECT COUNT(DISTINCT barcode) num, productInfo - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[报废]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo) a UNION SELECT * FROM (SELECT COUNT(DISTINCT barcode) num, productInfo - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND stationNo = 'S10' AND inspectResult <> '[合格]' AND SUBSTRING(productInfo,1,1) != ',' @@ -193,7 +193,7 @@ namespace PaintingScreen.Handler --总下线数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #c - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult in ('[合格]','[抛光]','报废') AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -307,7 +307,7 @@ namespace PaintingScreen.Handler -- 一次合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #a - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE InspectTimes = '1' AND " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC; @@ -315,7 +315,7 @@ namespace PaintingScreen.Handler -- 总合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #b - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC; @@ -323,7 +323,7 @@ namespace PaintingScreen.Handler --总下线数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #c - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult in ('[合格]','[抛光]','[报废]') AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC; @@ -465,7 +465,7 @@ namespace PaintingScreen.Handler -- 总合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #a - FROM [tb_InspectResult] + FROM [tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC; @@ -473,7 +473,7 @@ namespace PaintingScreen.Handler --总下线数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #b - FROM [tb_InspectResult] + FROM [tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult in ('[合格]','[抛光]','[报废]') AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC; @@ -491,7 +491,7 @@ namespace PaintingScreen.Handler ,[reason] ,[productInfo] INTO #result - FROM [tb_InspectResult] + FROM [tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND inspectResult = '[抛光]' AND reason <> '' AND reason IS NOT NULL; @@ -620,7 +620,7 @@ namespace PaintingScreen.Handler -- 一次合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #a - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE InspectTimes = '1' AND " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -628,7 +628,7 @@ namespace PaintingScreen.Handler -- 总合格数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #b - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[合格]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -638,13 +638,13 @@ namespace PaintingScreen.Handler ( SELECT num, productInfo FROM (SELECT COUNT(DISTINCT barcode) num, productInfo - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult = '[报废]' AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo) a UNION SELECT * FROM (SELECT COUNT(DISTINCT barcode) num, productInfo - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND stationNo = 'S10' AND inspectResult <> '[合格]' AND SUBSTRING(productInfo,1,1) != ',' @@ -655,7 +655,7 @@ namespace PaintingScreen.Handler --总下线数 SELECT COUNT(DISTINCT barcode) num, productInfo INTO #c - FROM [BBMPT].[dbo].[tb_InspectResult] + FROM [BBMPT].[dbo].[tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND productInfo != '' AND inspectResult in ('[合格]','[抛光]','报废') AND SUBSTRING(productInfo,1,1) != ',' GROUP BY productInfo ORDER BY productInfo DESC @@ -735,7 +735,7 @@ namespace PaintingScreen.Handler ,[DefectName5] ,[defectRate5] ,ROW_NUMBER() OVER(ORDER BY color,productInfo) xh - FROM [tb_ReportPaintingScreen_pg] + FROM [tb_ReportPaintingScreen_pg] ) t WHERE t.xh between @pageSize*(@pageIndex - 1)+1 and @pageSize*@pageIndex "; @@ -809,7 +809,7 @@ namespace PaintingScreen.Handler ,[reason] ,[productInfo] INTO #result - FROM [tb_InspectResult] + FROM [tb_InspectResult] with(nolock) WHERE " + GetQueryTime() + @" AND inspectResult = '[抛光]' AND reason <> '' AND reason IS NOT NULL; diff --git a/PaintingScreen/Manage/CodeInput.html b/PaintingScreen/Manage/CodeInput.html new file mode 100644 index 0000000..3e9ec78 --- /dev/null +++ b/PaintingScreen/Manage/CodeInput.html @@ -0,0 +1,123 @@ + + + + + 模具信息 + + + + + + + + + + 扫码: + + + + + + + + + + 模具信息 + 注塑机吨位模具寿命供应商 + 技术参数 + 项目数据项目数据 + 零件重量注塑周期 + 定位环尺寸顶出形式 + 模具重量流道形式 + 型腔数模具尺寸 + 工程更改 + 更改目的E/Q状态E/Qstate状态更新时间供应商备注 + + + + + + + + + + diff --git a/PaintingScreen/Manage/PaintingResultScreen1.html b/PaintingScreen/Manage/PaintingResultScreen1.html index d23f729..7221a9f 100644 --- a/PaintingScreen/Manage/PaintingResultScreen1.html +++ b/PaintingScreen/Manage/PaintingResultScreen1.html @@ -11,68 +11,67 @@ @@ -91,7 +90,7 @@ - + diff --git a/PaintingScreen/Manage/PaintingResultScreen2.html b/PaintingScreen/Manage/PaintingResultScreen2.html index ba95d40..b6ca4b5 100644 --- a/PaintingScreen/Manage/PaintingResultScreen2.html +++ b/PaintingScreen/Manage/PaintingResultScreen2.html @@ -12,72 +12,89 @@ @@ -89,9 +106,9 @@ 喷涂下线合格率看板 --> - + - 颜色型号下线数一次合格数一次合格率总合格数总合格率 + 颜色2型号下线数一次合格数一次合格率总合格数总合格率 diff --git a/PaintingScreen/Manage/PaintingScreenPaoGuang.html b/PaintingScreen/Manage/PaintingScreenPaoGuang.html index 368643e..362670b 100644 --- a/PaintingScreen/Manage/PaintingScreenPaoGuang.html +++ b/PaintingScreen/Manage/PaintingScreenPaoGuang.html @@ -11,11 +11,27 @@ @@ -107,8 +107,7 @@ success: function (result) { var res = result["result"]; - for (var i = 0; i < res.length; i++) - { + for (var i = 0; i < res.length; i++) { $("td[name='contentS" + (i + 1) + "']").text(res[i].StationNo); $("td[name='contentM" + (i + 1) + "']").text(res[i].ModelName); $("td[name='contentP" + (i + 1) + "']").text(res[i].ProductName); @@ -121,8 +120,7 @@ }) } - function Redirect() - { + function Redirect() { window.open('CodeInput.html'); } @@ -146,7 +144,7 @@ - + diff --git a/PaintingScreen/PaintingScreen.csproj b/PaintingScreen/PaintingScreen.csproj index 59bdb7a..d29e6d7 100644 --- a/PaintingScreen/PaintingScreen.csproj +++ b/PaintingScreen/PaintingScreen.csproj @@ -16,9 +16,11 @@ v4.5 true - - + enabled + enabled + + true diff --git a/PaintingScreen/bin/Handler/Handler.ashx b/PaintingScreen/bin/Handler/Handler.ashx index 13adf1b..92997da 100644 --- a/PaintingScreen/bin/Handler/Handler.ashx +++ b/PaintingScreen/bin/Handler/Handler.ashx @@ -19,10 +19,10 @@ public class Handler : IHttpHandler { switch (method) { - case "GetTable1": + case "GetTable1": //PaintingResultScreen1 GetTable1(); break; - case "GetTableSum": + case "GetTableSum": //PaintingResultScreen2 PaintingResultScreen1 GetTableSum(); break; case "CreateTable": @@ -31,21 +31,21 @@ public class Handler : IHttpHandler { case "CreateMiddleTable": CreateMiddleTable(); break; - case "GetMiddleTableData": + case "GetMiddleTableData": //PaintingResultScreen2 string page = Request.Params["page"]; GetMiddleTableData(page); break; case "CreateTablePaoGuang": CreateTablePaoGuang(); break; - case "GetTableSumPaoGuang": + case "GetTableSumPaoGuang": //PaintingScreenPaoGuang GetTableSumPaoGuang(); break; - case "GetMiddleTablePaoGuang": + case "GetMiddleTablePaoGuang": //PaintingScreenPaoGuang string pagePG = Request.Params["page"]; GetMiddleTablePaoGuang(pagePG); break; - case "GetSumRateTable": + case "GetSumRateTable"://PaintingScreenPaoGuang GetSumRateTable(); break; default: