瀏覽代碼

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 年之前
父節點
當前提交
bcad332576

+ 5 - 3
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -23,7 +23,7 @@ namespace UAS_LabelMachine
         //public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
 
         ////怡海能达外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YISEA;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.253.6)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////怡海能达ERP地址
         //public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
         ////怡海能达FTP
@@ -48,8 +48,10 @@ namespace UAS_LabelMachine
         private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=ZT_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.47.41.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //泽天ERP地址
         public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
-        //泽天FTP
-        public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
+        //泽天FTP外网
+        //public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
+        //泽天FTP内网
+        public static readonly string FTPAdress = "ftp://10.2.10.241|uas|Lz201478c";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套

+ 5 - 6
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -545,7 +545,7 @@ namespace UAS_LabelMachine
             {
                 Input.Clear();
                 sql.Clear();
-                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
+                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -578,8 +578,7 @@ namespace UAS_LabelMachine
                     stw.ShowDialog();
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
                 }
-                else
-                    MessageBox.Show("当前出入库单号不存在!", "提示");
+                else MessageBox.Show("当前出入库单号不存在或者未审核!", "提示");
             }
         }
 
@@ -1130,7 +1129,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    SingleReport.Load(SingleLabelCombox.Text);
+                    SingleReport.Load(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
                 }
             }
             catch (Exception) { }
@@ -1147,7 +1146,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    MidReport.Load(MidLabelCombox.Text);
+                    MidReport.Load(ftpOperater.DownLoadTo + MidLabelCombox.Text);
                 }
             }
             catch (Exception) { }
@@ -1164,7 +1163,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    OutReport.Load(OutBoxCombox.Text);
+                    OutReport.Load(ftpOperater.DownLoadTo + OutBoxCombox.Text);
                 }
             }
             catch (Exception) { }

+ 67 - 0
UAS_DeviceMonitor/Entity/User.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace UAS_DeviceMonitor.Entity
+{
+    class User
+    {
+        /// <summary>
+        /// 用户姓名
+        /// </summary>
+        public static string UserName; //  姓名 em_name
+        /// <summary>
+        /// 用户编号
+        /// </summary>
+        public static string UserCode; //  工号 em_code
+        /// <summary>
+        /// 用户岗位
+        /// </summary>
+        public static string UserPosition;//岗位 em_position
+        /// <summary>
+        /// 当前工序编号
+        /// </summary>
+        public static string CurrentStepCode;//工序 sc_stepcode
+        /// <summary>
+        /// 当前工序名称
+        /// </summary>
+        public static string CurrentStepName;//工序名称
+        /// <summary>
+        /// 用户部门
+        /// </summary>
+        public static string UserDepartment;//部门 em_depart
+        /// <summary>
+        /// 职称
+        /// </summary>
+        public static string UserProfessName;//职称 em_professname
+        /// <summary>
+        /// 用户类型,admin表示超级管理员,normal表示普通用户
+        /// </summary>
+        public static string UserAccountType;//用户类型  em_type
+        /// <summary>
+        /// 岗位资源编号
+        /// </summary>
+        public static string UserSourceCode;//岗位资源  ur_resourecode
+        /// <summary>
+        /// 用户分组
+        /// </summary>
+        public static string UserGroup;//用户分组  ug_name
+        /// <summary>
+        ///  用户分组编码
+        /// </summary>
+        public static string UserGroupCode;//用户分组编码   ug_code
+        /// <summary>
+        /// 用户所属的线别
+        /// </summary>
+        public static string UserLineCode;
+        /// <summary>
+        /// 资源所属工作中心
+        /// </summary>
+        public static string WorkCenter;
+        /// <summary>
+        /// 默认不良组别
+        /// </summary>
+        public static string DefaultBadGroup;
+    }
+}

+ 117 - 0
UAS_DeviceMonitor/Login.Designer.cs

@@ -0,0 +1,117 @@
+namespace UAS_DeviceMonitor
+{
+    partial class Login
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.UserName = new DevExpress.XtraEditors.TextEdit();
+            this.PassWord = new DevExpress.XtraEditors.TextEdit();
+            this.UserName_label = new DevExpress.XtraEditors.LabelControl();
+            this.PassWord_label = new DevExpress.XtraEditors.LabelControl();
+            this.LoginButton = new DevExpress.XtraEditors.SimpleButton();
+            ((System.ComponentModel.ISupportInitialize)(this.UserName.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PassWord.Properties)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // UserName
+            // 
+            this.UserName.Location = new System.Drawing.Point(144, 66);
+            this.UserName.Name = "UserName";
+            this.UserName.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.UserName.Properties.Appearance.Options.UseFont = true;
+            this.UserName.Size = new System.Drawing.Size(145, 28);
+            this.UserName.TabIndex = 0;
+            // 
+            // PassWord
+            // 
+            this.PassWord.Location = new System.Drawing.Point(144, 114);
+            this.PassWord.Name = "PassWord";
+            this.PassWord.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.PassWord.Properties.Appearance.Options.UseFont = true;
+            this.PassWord.Properties.PasswordChar = '*';
+            this.PassWord.Size = new System.Drawing.Size(145, 28);
+            this.PassWord.TabIndex = 1;
+            this.PassWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PassWord_KeyDown);
+            // 
+            // UserName_label
+            // 
+            this.UserName_label.Appearance.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.UserName_label.Location = new System.Drawing.Point(71, 69);
+            this.UserName_label.Name = "UserName_label";
+            this.UserName_label.Size = new System.Drawing.Size(48, 21);
+            this.UserName_label.TabIndex = 2;
+            this.UserName_label.Text = "用户名";
+            // 
+            // PassWord_label
+            // 
+            this.PassWord_label.Appearance.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.PassWord_label.Location = new System.Drawing.Point(87, 117);
+            this.PassWord_label.Name = "PassWord_label";
+            this.PassWord_label.Size = new System.Drawing.Size(32, 21);
+            this.PassWord_label.TabIndex = 3;
+            this.PassWord_label.Text = "密码";
+            // 
+            // LoginButton
+            // 
+            this.LoginButton.Location = new System.Drawing.Point(171, 184);
+            this.LoginButton.Name = "LoginButton";
+            this.LoginButton.Size = new System.Drawing.Size(75, 23);
+            this.LoginButton.TabIndex = 4;
+            this.LoginButton.Text = "登录";
+            this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click);
+            // 
+            // Login
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(414, 245);
+            this.Controls.Add(this.LoginButton);
+            this.Controls.Add(this.PassWord_label);
+            this.Controls.Add(this.UserName_label);
+            this.Controls.Add(this.PassWord);
+            this.Controls.Add(this.UserName);
+            this.FormBorderEffect = DevExpress.XtraEditors.FormBorderEffect.None;
+            this.Name = "Login";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = " 设备管理平台";
+            this.Load += new System.EventHandler(this.Login_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.UserName.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PassWord.Properties)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraEditors.TextEdit UserName;
+        private DevExpress.XtraEditors.TextEdit PassWord;
+        private DevExpress.XtraEditors.LabelControl UserName_label;
+        private DevExpress.XtraEditors.LabelControl PassWord_label;
+        private DevExpress.XtraEditors.SimpleButton LoginButton;
+    }
+}

+ 71 - 0
UAS_DeviceMonitor/Login.cs

@@ -0,0 +1,71 @@
+using System;
+using DevExpress.XtraEditors;
+using UAS_DeviceMonitor.Entity;
+using System.Data;
+using UAS_DeviceMonitor.DataOperate;
+using UAS_DeviceMonitor.PublicMethod;
+
+namespace UAS_DeviceMonitor
+{
+    public partial class Login : XtraForm
+    {
+        DataHelper dh = new DataHelper();
+
+        public DataTable UserInf { get; private set; }
+
+        public Login()
+        {
+            InitializeComponent();
+        }
+
+        private void Login_Load(object sender, EventArgs e)
+        {
+            SystemInf.dh = dh;
+        }
+
+        private void LoginButton_Click(object sender, EventArgs e)
+        {
+            if (UserName.Text != "" && PassWord.Text != "")
+            {
+                string oErrMessage = "";
+                if (LogicHandler.CheckUserLogin(UserName.Text, PassWord.Text, out oErrMessage))
+                {
+                    SetInf();
+                    Main main = new Main();
+                    Hide();
+                    main.ShowDialog();
+                    Close();
+                }
+                else XtraMessageBox.Show(oErrMessage);
+            }
+            else XtraMessageBox.Show("用户名和密码不能为空!");
+        }
+
+        /// <summary>
+        ///设置User类的全局变量,类似于Session
+        /// </summary>
+        private void SetInf()
+        {
+            //设置全局用户信息
+            string[] field = { "em_code,em_depart,em_type,em_name,em_position,em_professname,em_type,ug_code,ug_name" };
+            UserInf = dh.getFieldsDataByCondition("Employee left join cs$userresource on ur_emcode=em_code left join cs$usergroup on ug_code=ur_groupcode", field, "upper(em_code)='" + UserName.Text.ToUpper() + "'");
+            //通过Source表关联岗位资源编号查询出当前的执行工序
+            User.UserCode = UserInf.Rows[0]["em_code"].ToString();
+            User.UserDepartment = UserInf.Rows[0]["em_depart"].ToString();
+            User.UserName = UserInf.Rows[0]["em_name"].ToString();
+            User.UserPosition = UserInf.Rows[0]["em_position"].ToString();
+            User.UserProfessName = UserInf.Rows[0]["em_professname"].ToString();
+            User.UserAccountType = UserInf.Rows[0]["em_type"].ToString();
+            User.UserGroupCode = UserInf.Rows[0]["ug_code"].ToString();
+            User.UserGroup = UserInf.Rows[0]["ug_name"].ToString();
+        }
+
+        private void PassWord_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
+        {
+            if (e.KeyCode == System.Windows.Forms.Keys.Enter)
+            {
+                LoginButton.PerformClick();
+            }
+        }
+    }
+}

+ 120 - 0
UAS_DeviceMonitor/Login.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 10 - 13
UAS_DeviceMonitor/Main.cs

@@ -1,19 +1,19 @@
 using System;
-using DevExpress.XtraBars;
-using UAS_DeviceMonitor.DataOperate;
 using System.Data;
 using System.Text;
-using UAS_DeviceMonitor.Entity;
-using UAS_DeviceMonitor.PublicMethod;
-using DevExpress.XtraGrid.Views.Grid;
 using System.Collections.Generic;
 using System.Drawing;
-using DevExpress.XtraBars.Ribbon;
 using System.Threading;
-using UAS_DeviceMonitor.CustomerControl.PictureEditWithText;
 using System.Windows.Forms;
+using DevExpress.XtraBars;
+using DevExpress.XtraGrid.Views.Grid;
+using DevExpress.XtraBars.Ribbon;
 using DevExpress.XtraEditors.Controls;
 using DevExpress.XtraEditors;
+using UAS_DeviceMonitor.DataOperate;
+using UAS_DeviceMonitor.Entity;
+using UAS_DeviceMonitor.PublicMethod;
+using UAS_DeviceMonitor.CustomerControl.PictureEditWithText;
 using UAS_DeviceMonitor.Device.Infomation;
 
 namespace UAS_DeviceMonitor
@@ -24,15 +24,13 @@ namespace UAS_DeviceMonitor
         StringBuilder sql = new StringBuilder();
         //用于设备状态查询界面SQL查看
         StringBuilder DeviceStatusQuerySQL = new StringBuilder();
-        DataHelper dh;
+        DataHelper dh=SystemInf.dh;
         ModeBusTCPServer mbt = new ModeBusTCPServer();
         List<string> SQL = new List<string>();
 
         #region 初始化代码
         public Main()
         {
-            dh = new DataHelper();
-            SystemInf.dh = dh;
             InitializeComponent();
             dpc_enableCheckEdit.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
             CommandSetRepositoryItemComboBox1.ParseEditValue += CommandSetRepositoryItemComboBox1_ParseEditValue;
@@ -249,7 +247,6 @@ namespace UAS_DeviceMonitor
         private void ButtonStartPolling_Click(object sender, EventArgs e)
         {
             GridView grid = GridViewPollSetting;
-
             for (int i = 0; i < GridPollingSetting.RowCount; i++)
             {
                 Polling pl = new Polling();
@@ -257,7 +254,6 @@ namespace UAS_DeviceMonitor
                 pl.DeviceCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DECODE").ToString();
                 pl.CommandCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DCCODE").ToString();
                 pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString());
-                pl.SendRadix = GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString();
                 pl.Enable = GridViewPollSetting.GetRowCellValue(i, "DPC_ENABLE").ToString() != "0";
                 pl.Dh = new DataHelper();
                 if (pl.Enable)
@@ -295,7 +291,7 @@ namespace UAS_DeviceMonitor
             PollingTimer timer = new PollingTimer();
             Polling pl = (Polling)i;
             timer.Polling = i;
-            timer.Interval = pl.Interval * 5000;
+            timer.Interval = pl.Interval * 1000;
             timer.Elapsed += Timer_Tick;
             timer.Start();
             try
@@ -417,6 +413,7 @@ namespace UAS_DeviceMonitor
                     pl.Id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
                     pl.DeviceCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DECODE").ToString();
                     pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_INTERVAL").ToString());
+                    pl.CommandCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DCCODE").ToString();
                     pl.Enable = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() != "0";
                     pl.Dh = new DataHelper();
                     if (pl.Enable)

+ 1 - 1
UAS_DeviceMonitor/Program.cs

@@ -57,7 +57,7 @@ namespace UAS_DeviceMonitor
                 }
                 DevExpress.Skins.SkinManager.EnableFormSkins();
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new Main());
+                    Application.Run(new Login());
                 else
                 {
                     //创建启动对象

+ 41 - 0
UAS_DeviceMonitor/PublicMethod/LogicHandler.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using UAS_DeviceMonitor.DataOperate;
+using UAS_DeviceMonitor.Entity;
+
+namespace UAS_DeviceMonitor.PublicMethod
+{
+    class LogicHandler
+    {
+        public LogicHandler() { }
+
+        static DataHelper dh = SystemInf.dh;
+        //用于拼接SQL
+        static StringBuilder sql = new StringBuilder();
+        //用于存放批量执行的SQL
+        static List<string> sqls = new List<string>();
+        /// <summary>
+        /// 验证用户身份信息
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code from employee where upper(em_code)=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode.ToUpper(), iPassWord);
+            if (dt.Rows.Count > 0)
+                return true;
+            else
+            {
+                oErrorMessage = "用户名或者密码不正确!";
+                return false;
+            }
+        }
+    }
+}

+ 11 - 0
UAS_DeviceMonitor/UAS_DeviceMonitor.csproj

@@ -212,6 +212,13 @@
     <Compile Include="Entity\Polling.cs" />
     <Compile Include="Entity\SocketObject.cs" />
     <Compile Include="Entity\SystemInf.cs" />
+    <Compile Include="Entity\User.cs" />
+    <Compile Include="Login.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Login.Designer.cs">
+      <DependentUpon>Login.cs</DependentUpon>
+    </Compile>
     <Compile Include="Main.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -221,6 +228,7 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="PublicMethod\BaseUtil.cs" />
+    <Compile Include="PublicMethod\LogicHandler.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="PublicMethod\ModeBusTCPServer.cs" />
     <Compile Include="PublicMethod\PollingTask.cs" />
@@ -257,6 +265,9 @@
     <EmbeddedResource Include="Device\Information\DeviceStatusInfo.resx">
       <DependentUpon>DeviceStatusInfo.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Login.resx">
+      <DependentUpon>Login.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Main.resx">
       <DependentUpon>Main.cs</DependentUpon>
     </EmbeddedResource>