diff --git a/DB/DbFactory.cs b/DB/DbFactory.cs index f245517..31a1c69 100644 --- a/DB/DbFactory.cs +++ b/DB/DbFactory.cs @@ -12,11 +12,13 @@ namespace DB public class DbFactory { + /// + /// 数据库访问类 + /// public static IDbContext GetContext { get { - PostgreSQLContext context = new PostgreSQLContext(() => { IDbConnection conn = new NpgsqlConnection(RfidSetting.Current.Db); //需要自己引入数据库驱动 diff --git a/RfidWeb/FormMain.Designer.cs b/RfidWeb/FormMain.Designer.cs index 4fd6ea6..a9fceb3 100644 --- a/RfidWeb/FormMain.Designer.cs +++ b/RfidWeb/FormMain.Designer.cs @@ -43,20 +43,12 @@ this.btnArgument = new System.Windows.Forms.Button(); this.btnMain = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); - this.panel4 = new System.Windows.Forms.Panel(); - this.panel3 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.panel5 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.panel6.SuspendLayout(); this.panel7.SuspendLayout(); this.panel8.SuspendLayout(); this.panel2.SuspendLayout(); - this.panel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.panel5.SuspendLayout(); this.SuspendLayout(); // // panel1 @@ -78,9 +70,9 @@ this.panel6.Controls.Add(this.panel7); this.panel6.Controls.Add(this.panel8); this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel6.Location = new System.Drawing.Point(0, 68); + this.panel6.Location = new System.Drawing.Point(0, 70); this.panel6.Name = "panel6"; - this.panel6.Size = new System.Drawing.Size(1280, 956); + this.panel6.Size = new System.Drawing.Size(1280, 954); this.panel6.TabIndex = 1; // // panel7 @@ -90,15 +82,16 @@ this.panel7.Dock = System.Windows.Forms.DockStyle.Fill; this.panel7.Location = new System.Drawing.Point(370, 0); this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(910, 956); + this.panel7.Size = new System.Drawing.Size(910, 954); this.panel7.TabIndex = 4; // // panContent // this.panContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.panContent.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panContent.Location = new System.Drawing.Point(0, 14); this.panContent.Name = "panContent"; - this.panContent.Size = new System.Drawing.Size(910, 942); + this.panContent.Size = new System.Drawing.Size(910, 940); this.panContent.TabIndex = 1; // // panel9 @@ -124,7 +117,7 @@ this.panel8.Location = new System.Drawing.Point(0, 0); this.panel8.Margin = new System.Windows.Forms.Padding(4); this.panel8.Name = "panel8"; - this.panel8.Size = new System.Drawing.Size(370, 956); + this.panel8.Size = new System.Drawing.Size(370, 954); this.panel8.TabIndex = 3; // // button4 @@ -153,43 +146,46 @@ // // btnMes // - this.btnMes.BackgroundImage = global::RfidWeb.Properties.Resources.btn; + this.btnMes.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); this.btnMes.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnMes.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnMes.ForeColor = System.Drawing.SystemColors.Window; this.btnMes.Location = new System.Drawing.Point(22, 400); this.btnMes.Margin = new System.Windows.Forms.Padding(4); this.btnMes.Name = "btnMes"; this.btnMes.Size = new System.Drawing.Size(300, 87); this.btnMes.TabIndex = 4; this.btnMes.Text = "生产计划"; - this.btnMes.UseVisualStyleBackColor = true; + this.btnMes.UseVisualStyleBackColor = false; // // btnAccount // - this.btnAccount.BackgroundImage = global::RfidWeb.Properties.Resources.btn; + this.btnAccount.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); this.btnAccount.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnAccount.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnAccount.ForeColor = System.Drawing.SystemColors.Window; this.btnAccount.Location = new System.Drawing.Point(22, 305); this.btnAccount.Margin = new System.Windows.Forms.Padding(4); this.btnAccount.Name = "btnAccount"; this.btnAccount.Size = new System.Drawing.Size(300, 87); this.btnAccount.TabIndex = 3; this.btnAccount.Text = "账户管理"; - this.btnAccount.UseVisualStyleBackColor = true; + this.btnAccount.UseVisualStyleBackColor = false; this.btnAccount.Click += new System.EventHandler(this.btnAccount_Click); // // btnAlarm // - this.btnAlarm.BackgroundImage = global::RfidWeb.Properties.Resources.btn; + this.btnAlarm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); this.btnAlarm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnAlarm.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnAlarm.ForeColor = System.Drawing.SystemColors.Window; this.btnAlarm.Location = new System.Drawing.Point(22, 210); this.btnAlarm.Margin = new System.Windows.Forms.Padding(4); this.btnAlarm.Name = "btnAlarm"; this.btnAlarm.Size = new System.Drawing.Size(300, 87); this.btnAlarm.TabIndex = 3; this.btnAlarm.Text = "报警记录"; - this.btnAlarm.UseVisualStyleBackColor = true; + this.btnAlarm.UseVisualStyleBackColor = false; this.btnAlarm.Click += new System.EventHandler(this.btnAlarm_Click); // // btnExit @@ -208,112 +204,57 @@ // // btnArgument // - this.btnArgument.BackgroundImage = global::RfidWeb.Properties.Resources.btn; + this.btnArgument.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); this.btnArgument.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnArgument.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnArgument.ForeColor = System.Drawing.SystemColors.Window; this.btnArgument.Location = new System.Drawing.Point(22, 115); this.btnArgument.Margin = new System.Windows.Forms.Padding(4); this.btnArgument.Name = "btnArgument"; this.btnArgument.Size = new System.Drawing.Size(300, 87); this.btnArgument.TabIndex = 1; this.btnArgument.Text = "参数界面"; - this.btnArgument.UseVisualStyleBackColor = true; + this.btnArgument.UseVisualStyleBackColor = false; this.btnArgument.Click += new System.EventHandler(this.btnArgument_Click); // // btnMain // - this.btnMain.BackgroundImage = global::RfidWeb.Properties.Resources.btn_sel1; + this.btnMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); this.btnMain.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btnMain.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnMain.ForeColor = System.Drawing.SystemColors.Window; this.btnMain.Location = new System.Drawing.Point(22, 17); this.btnMain.Margin = new System.Windows.Forms.Padding(4); this.btnMain.Name = "btnMain"; this.btnMain.Size = new System.Drawing.Size(300, 90); this.btnMain.TabIndex = 0; this.btnMain.Text = "首页"; - this.btnMain.UseVisualStyleBackColor = true; + this.btnMain.UseVisualStyleBackColor = false; this.btnMain.Click += new System.EventHandler(this.btnMain_Click); // // panel2 // this.panel2.BackColor = System.Drawing.Color.Transparent; + this.panel2.BackgroundImage = global::RfidWeb.Properties.Resources._2024_11_12_170754_114; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.panel2.Controls.Add(this.panel4); - this.panel2.Controls.Add(this.panel3); - this.panel2.Controls.Add(this.panel5); + this.panel2.Controls.Add(this.label1); this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Font = new System.Drawing.Font("新宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1280, 68); + this.panel2.Size = new System.Drawing.Size(1280, 70); this.panel2.TabIndex = 0; // - // panel4 - // - this.panel4.BackColor = System.Drawing.Color.Transparent; - this.panel4.BackgroundImage = global::RfidWeb.Properties.Resources.frm21; - this.panel4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel4.Location = new System.Drawing.Point(370, 0); - this.panel4.Margin = new System.Windows.Forms.Padding(4); - this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(471, 68); - this.panel4.TabIndex = 4; - // - // panel3 - // - this.panel3.BackColor = System.Drawing.Color.Transparent; - this.panel3.Controls.Add(this.pictureBox1); - this.panel3.Dock = System.Windows.Forms.DockStyle.Left; - this.panel3.Location = new System.Drawing.Point(0, 0); - this.panel3.Margin = new System.Windows.Forms.Padding(4); - this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(370, 68); - this.panel3.TabIndex = 1; - // - // pictureBox1 - // - this.pictureBox1.Image = global::RfidWeb.Properties.Resources.log; - this.pictureBox1.Location = new System.Drawing.Point(22, 14); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(4); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(340, 40); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // panel5 - // - this.panel5.BackColor = System.Drawing.Color.Transparent; - this.panel5.Controls.Add(this.label1); - this.panel5.Controls.Add(this.label2); - this.panel5.Dock = System.Windows.Forms.DockStyle.Right; - this.panel5.Location = new System.Drawing.Point(841, 0); - this.panel5.Margin = new System.Windows.Forms.Padding(4); - this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(439, 68); - this.panel5.TabIndex = 3; - // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.Location = new System.Drawing.Point(116, 12); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(226, 19); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(217, 40); + this.label1.Size = new System.Drawing.Size(284, 27); this.label1.TabIndex = 0; - this.label1.Text = "2024/10/25"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(276, 12); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(177, 40); - this.label2.TabIndex = 1; - this.label2.Text = "10:25:01"; + this.label1.Text = "佳通RFID层合裁切设备"; // // FormMain // @@ -327,23 +268,13 @@ this.panel7.ResumeLayout(false); this.panel8.ResumeLayout(false); this.panel2.ResumeLayout(false); - this.panel3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.panel5.ResumeLayout(false); - this.panel5.PerformLayout(); + this.panel2.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Panel panel5; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel6; private System.Windows.Forms.Panel panel8; private System.Windows.Forms.Button button4; @@ -357,5 +288,7 @@ private System.Windows.Forms.Panel panel7; private System.Windows.Forms.Panel panContent; private System.Windows.Forms.Panel panel9; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/RfidWeb/FormMain.cs b/RfidWeb/FormMain.cs index 3418900..0175fb4 100644 --- a/RfidWeb/FormMain.cs +++ b/RfidWeb/FormMain.cs @@ -38,16 +38,16 @@ namespace RfidWeb var rfidSetting = RfidSetting.Current; InitializeComponent(); - //if (this.FormBorderStyle == FormBorderStyle.None) - //{ - // this.FormBorderStyle = FormBorderStyle.FixedSingle; - // this.WindowState = FormWindowState.Normal; - //} - //else - //{ - // this.FormBorderStyle = FormBorderStyle.None; - // this.WindowState = FormWindowState.Maximized; - //} + if (this.FormBorderStyle == FormBorderStyle.None) + { + this.FormBorderStyle = FormBorderStyle.FixedSingle; + this.WindowState = FormWindowState.Normal; + } + else + { + this.FormBorderStyle = FormBorderStyle.None; + this.WindowState = FormWindowState.Maximized; + } Init(); } @@ -77,9 +77,6 @@ namespace RfidWeb var dataTime = DateTime.Now; this.Invoke(() => { - - label1.Text = dataTime.ToString("yyyy'/'MM'/'dd"); - label2.Text = dataTime.ToString("HH:mm:ss"); }); ThreadPoolX.QueueUserWorkItem(UpdateLog); @@ -125,37 +122,13 @@ namespace RfidWeb } - private void SetBackGroupImage(Button button) - { - var imageOld = Properties.Resources.btn; - List