Prechádzať zdrojové kódy

项目初始化导入

章政 8 rokov pred
rodič
commit
66d28135e1
100 zmenil súbory, kde vykonal 9524 pridanie a 0 odobranie
  1. 988 0
      MES接口/DataHelper.cs
  2. 1440 0
      MES接口/LogicHandler.cs
  3. BIN
      MES接口/MES接口.dll
  4. 36 0
      MES接口/Properties/AssemblyInfo.cs
  5. 26 0
      MES接口/Properties/Settings.Designer.cs
  6. 5 0
      MES接口/Properties/Settings.settings
  7. 89 0
      MES接口/UAS-MES接口.csproj
  8. 6 0
      MES接口/app.config
  9. 173 0
      MES接口/ftpOperater.cs
  10. BIN
      MES接口/tool/Oracle.ManagedDataAccess.dll
  11. 18 0
      NotePad/App.config
  12. 40 0
      NotePad/CustomerControls/AutoButtomRichTextBox.Designer.cs
  13. 30 0
      NotePad/CustomerControls/AutoButtomRichTextBox.cs
  14. 123 0
      NotePad/CustomerControls/AutoButtomRichTextBox.resx
  15. 36 0
      NotePad/CustomerControls/RoundPanel.Designer.cs
  16. 163 0
      NotePad/CustomerControls/RoundPanel.cs
  17. 65 0
      NotePad/Helper/AssemblyHelper.cs
  18. 21 0
      NotePad/Helper/WriteNote.cs
  19. BIN
      NotePad/MP3/人武训练的日子.mp3
  20. 216 0
      NotePad/NotePad.Designer.cs
  21. 169 0
      NotePad/NotePad.cs
  22. 180 0
      NotePad/NotePad.csproj
  23. 422 0
      NotePad/NotePad.resx
  24. BIN
      NotePad/Pic/1.考试作业校园.jpg
  25. BIN
      NotePad/Pic/2.校园.jpg
  26. BIN
      NotePad/Pic/3.校园 .JPG
  27. BIN
      NotePad/Pic/IMG_1558.JPG
  28. BIN
      NotePad/Pic/IMG_2439.JPG
  29. BIN
      NotePad/Pic/IMG_2478.JPG
  30. BIN
      NotePad/Pic/IMG_2576.JPG
  31. BIN
      NotePad/Pic/IMG_2982.JPG
  32. BIN
      NotePad/Pic/IMG_3005.JPG
  33. BIN
      NotePad/Pic/IMG_3056.JPG
  34. BIN
      NotePad/Pic/IMG_3062.JPG
  35. BIN
      NotePad/Pic/colorpicker.png
  36. BIN
      NotePad/Pic/icon.ico
  37. BIN
      NotePad/Pic/image1.jpg
  38. BIN
      NotePad/Pic/image2.jpg
  39. BIN
      NotePad/Pic/image3.jpg
  40. BIN
      NotePad/Pic/image4.jpg
  41. BIN
      NotePad/Pic/image5.jpg
  42. BIN
      NotePad/Pic/image6.jpg
  43. BIN
      NotePad/Pic/image7.jpg
  44. BIN
      NotePad/Pic/psb (1).jpg
  45. BIN
      NotePad/Pic/psb (3).jpg
  46. BIN
      NotePad/Pic/psb (4).jpg
  47. BIN
      NotePad/Pic/psb (5).jpg
  48. BIN
      NotePad/Pic/psb.jpg
  49. 42 0
      NotePad/Program.cs
  50. 36 0
      NotePad/Properties/AssemblyInfo.cs
  51. 253 0
      NotePad/Properties/Resources.Designer.cs
  52. 178 0
      NotePad/Properties/Resources.resx
  53. 48 0
      NotePad/Properties/Settings.Designer.cs
  54. 12 0
      NotePad/Properties/Settings.settings
  55. BIN
      NotePad/Resources/font_color_32px_1187333_easyicon.net.png
  56. BIN
      NotePad/Resources/image6.jpg
  57. BIN
      NotePad/Resources/image7.jpg
  58. BIN
      NotePad/Tool/CSkin.dll
  59. BIN
      NotePad/Tool/WMPLib.dll
  60. 12 0
      TestProject/App.config
  61. 136 0
      TestProject/DrawHelper.cs
  62. 32 0
      TestProject/EMouseEnum.cs
  63. 93 0
      TestProject/Form1.Designer.cs
  64. 36 0
      TestProject/Form1.cs
  65. 120 0
      TestProject/Form1.resx
  66. 86 0
      TestProject/Form2.Designer.cs
  67. 34 0
      TestProject/Form2.cs
  68. 123 0
      TestProject/Form2.resx
  69. 49 0
      TestProject/Program.cs
  70. 36 0
      TestProject/Properties/AssemblyInfo.cs
  71. 133 0
      TestProject/Properties/Resources.Designer.cs
  72. 142 0
      TestProject/Properties/Resources.resx
  73. 35 0
      TestProject/Properties/Settings.Designer.cs
  74. 14 0
      TestProject/Properties/Settings.settings
  75. 36 0
      TestProject/QQButton.Designer.cs
  76. 205 0
      TestProject/QQButton.cs
  77. 123 0
      TestProject/QQButton.resx
  78. BIN
      TestProject/Resources/Light.png
  79. BIN
      TestProject/Resources/White-side.png
  80. BIN
      TestProject/Resources/down.png
  81. BIN
      TestProject/Resources/focus.png
  82. BIN
      TestProject/Resources/gray.png
  83. BIN
      TestProject/Resources/highlight.png
  84. BIN
      TestProject/Resources/normal.png
  85. BIN
      TestProject/Resources/timg (1).jpg
  86. BIN
      TestProject/Resources/timg (1)1.jpg
  87. 183 0
      TestProject/TestProject.csproj
  88. BIN
      TestProject/tool/CSkin.dll
  89. 562 0
      TestProject/tool/MES接口.XML
  90. BIN
      TestProject/tool/MES接口.dll
  91. BIN
      TestProject/tool/Oracle.ManagedDataAccess.dll
  92. 45 0
      UAS-MES/App.config
  93. 339 0
      UAS-MES/BarTender.Designer.cs
  94. 562 0
      UAS-MES/BarTender.cs
  95. 126 0
      UAS-MES/BarTender.resx
  96. 224 0
      UAS-MES/Batch_Generation_Code.Designer.cs
  97. 123 0
      UAS-MES/Batch_Generation_Code.cs
  98. 120 0
      UAS-MES/Batch_Generation_Code.resx
  99. 498 0
      UAS-MES/Batch_Generation_CodeDetail.Designer.cs
  100. 482 0
      UAS-MES/Batch_Generation_CodeDetail.cs

+ 988 - 0
MES接口/DataHelper.cs

@@ -0,0 +1,988 @@
+using Oracle.ManagedDataAccess.Client;
+using System;
+using System.Data;
+using System.Text;
+using System.Configuration;
+
+namespace MES接口
+{
+    /// <summary>
+    /// 数据库操作类
+    /// </summary>
+    class DataHelper
+    {
+        //系统默认的的连接字符串
+        private string ConnectionStrings = ConfigurationManager.ConnectionStrings["MES"].ConnectionString;
+        //用户选择的数据库的连接字符串
+        public static string DBConnectionString;
+        public static OracleConnection connection = null;
+        OracleCommand command = null;
+
+        /// <summary>
+        /// 执行构造函数的时候打开数据库的链接
+        /// </summary>
+        public DataHelper()
+        {
+            try
+            {
+                //如果选择的是默认数据则直接用配置文件的信息连接,否则选择数据库的账套信息
+                if (DBConnectionString == null || DBConnectionString == ConnectionStrings)
+                {
+                    connection = new OracleConnection(ConnectionStrings);
+                }
+                else
+                {
+                    connection = new OracleConnection(DBConnectionString);
+                }
+                connection.Open();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.Message);
+            }
+        }
+
+        /// <summary>
+        /// 根据表名获取该表字段数据类型
+        /// </summary>
+        public DataTable GetColumnDataType(string TableName)
+        {
+            DataTable dt = new DataTable();
+            command = new OracleCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 获取第一行第一列的信息
+        /// </summary>
+        public object getFieldDataByCondition(string TableName, string Field, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            if (dt.Rows.Count > 0)
+            {
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+        /// <summary>
+        /// 执行打印的SQL
+        /// </summary>
+        /// <param name="SQL">SQL语句</param>
+        /// <param name="Parameters">动态添加的参数,主要根据条码枪扫描获取</param>
+        /// <returns></returns>
+        public object ExecutePrintSQL(string SQL, params string[] Parameters)
+        {
+            //按照?拆分数据,然后以:Param替换问号,同时添加参数
+            string[] Param = SQL.Split('?');
+            int ParamNum = Param.Length - 1;
+            //条码打印必然存在需要维护的参数
+            if (ParamNum > 0)
+            {
+                StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    sb.Append(Param[i] + ":Param" + i);
+                }
+                command = new OracleCommand(sb.ToString(), connection);
+
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    command.Parameters.Add("Param" + i, OracleDbType.Varchar2, Parameters[i], ParameterDirection.Input);
+                }
+
+                OracleDataAdapter ad = new OracleDataAdapter(command);
+                DataTable dt = new DataTable();
+                ad.Fill(dt);
+                ad.Dispose();
+                command.Dispose();
+                return dt;
+            }
+            return "参数错误,请检查SQL语句";
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,带条件
+        /// </summary>
+        /// <returns></returns>
+        public int getRowCount(string TableName, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            int count = int.Parse(dt.Rows[0][0].ToString());
+            return count;
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,不带条件
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <returns></returns>
+        public int getRowCount(string TableName)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName;
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            Console.WriteLine(sql);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            int count = int.Parse(dt.Rows[0][0].ToString());
+            return count;
+        }
+
+        /// <summary>
+        /// 通过表名和获取单行的记录
+        /// </summary>
+        public DataTable getFieldsDataByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition + " and rownum=1";
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 将DataTable导入到指定的表中
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        public void InsertDataTable(DataTable DataTable, string TableName)
+        {
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                for (int j = 0; j < DataTable.Columns.Count; j++)
+                {
+
+                }
+            }
+        }
+
+        /// <summary>
+        /// 按分页获取数据
+        /// </summary>
+        /// <param name="TableName">表名</param>
+        /// <param name="Fields">查询字段</param>
+        /// <param name="CurrentPage">当前页面</param>
+        /// <param name="PageSize">页面展示条数</param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        // SELECT * FROM (SELECT   A.*  FROM (SELECT* FROM datalist) A WHERE ROWNUM <= 50) WHERE ROWNUM >= 21
+        public DataTable getFieldsDatasByPageing(string TableName, string Fields, int CurrentPage, int PageSize, string Caller, params string[] condition)
+        {
+            DataTable dt = new DataTable();
+            StringBuilder sql = new StringBuilder();
+            //先查询出配置出去的列
+            //获取查询的列
+            string[] caption = GetCaptionFromField(Fields);
+            //获取对应列的描述
+            string[] field = GetField(Fields);
+            sql.Append(" select * from (select RowNum RN, A.* from (select ");
+            sql.Append(AddField(caption));
+            if (condition.Length > 0)
+            {
+                if (condition[0].Trim() != "")
+                {
+                    sql.Append(" from " + TableName + " where " + condition[0] + " ) A where ROWNUM <=" + CurrentPage * PageSize + ") where RN>" + (CurrentPage - 1) * PageSize);
+                }
+                else
+                {
+                    sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
+                }
+            }
+            Console.WriteLine(sql.ToString());
+            command = new OracleCommand(sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            dt.Columns.RemoveAt(0);
+            foreach (DataColumn dc in dt.Columns)
+            {
+                dc.ColumnName = field[dt.Columns.IndexOf(dc)];
+                dc.Caption = caption[dt.Columns.IndexOf(dc)];
+            }
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段和条件获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatasByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition;
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatas(string TableName, string Fields)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += Fields;
+            sql += " from " + TableName;
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            foreach (DataColumn dc in dt.Columns)
+            {
+                dc.Caption = "测试测试";
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 根据DataTable和指定的表名更新数据,如果需要保存新增的数据则需要传递一条Insert的SQL
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        public void UpDateTableByCondition(DataTable DataTable, string TableName, string PrimaryKey, params string[] sql)
+        {
+            if (DataTable == null)
+            {
+                return;
+            }
+            StringBuilder sb = new StringBuilder();
+            //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
+            DataTable data = (DataTable)ExecuteSql("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", "select");
+            //将所有的字段拼接起来
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                sb.Append("#" + data.Rows[i]["Column_Name"].ToString());
+            }
+            //移除掉所有不属于该表的列
+            for (int i = DataTable.Columns.Count - 1; i >= 0; i--)
+            {
+                if (!sb.ToString().Contains(DataTable.Columns[i].ColumnName.ToUpper()))
+                {
+                    DataTable.Columns.RemoveAt(i);
+                }
+            }
+            sb.Clear();
+            //计算有多少个是新加的行,根据主键为空来进行判断
+            int NewRowCount = 0;
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
+                {
+                    NewRowCount = NewRowCount + 1;
+                }
+            }
+            if (sql.Length > 0)
+            {
+                if (NewRowCount > 0)
+                {
+                    //获取参数的个数
+                    int paramsNum = sql[0].Split(':').Length - 1;
+
+                    //解析参数的数据
+                    string[] param = GetParamFromSQL(sql[0]);
+                    //新建一个二维数组去
+                    string[][] param_array = new string[paramsNum][];
+                    //实例化每个一维数组
+                    for (int i = 0; i < paramsNum; i++)
+                    {
+                        param_array[i] = new string[NewRowCount];
+                    }
+                    //设置每列参数的索引
+                    int num = 0;
+                    //变量所有的行,如果有主键为空的则移除,不为空的进行参数的拼接
+                    for (int i = DataTable.Rows.Count - 1; i >= 0; i--)
+                    {
+                        if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
+                        {
+                            //当为新添加行的时候才去设置参数,设置过后索引+1
+                            for (int j = 0; j < paramsNum; j++)
+                            {
+                                param_array[j][num] = DataTable.Rows[i][param[j]].ToString();
+                            }
+                            DataTable.Rows.RemoveAt(i);
+                            num++;
+                        }
+                    }
+                    BatchInsertDataTable(sql[0], param, param_array);
+                }
+            }
+            //不是新增行的启用更新的方法
+            sb.Append("update " + TableName + " set ");
+            //拼接语句,特殊处理日期
+
+            foreach (DataColumn dc in DataTable.Columns)
+            {
+                if (!dc.DataType.ToString().Equals("System.DateTime"))
+                {
+                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
+                }
+                else
+                {
+                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
+                }
+            }
+
+            sb.Remove(sb.Length - 1, 1);
+            sb.Append(" where " + PrimaryKey + "=:" + PrimaryKey);
+            command = new OracleCommand(sb.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            // 参数的长度是DataTable的行数决定的
+            command.ArrayBindCount = DataTable.Rows.Count;
+            //默认全部是Varchar2类型的
+            OracleDbType ob = OracleDbType.Varchar2;
+            for (int i = 0; i < DataTable.Columns.Count; i++)
+            {
+                object[] param = new object[DataTable.Rows.Count];
+                for (int j = 0; j < DataTable.Rows.Count; j++)
+                {
+                    DateTime dt = DateTime.Now;
+                    if (DateTime.TryParse(DataTable.Rows[j][i].ToString(), out dt))
+                    {
+                        param[j] = dt;
+                        ob = OracleDbType.Date;
+                    }
+                    else
+                    {
+                        ob = OracleDbType.Varchar2;
+                        param[j] = DataTable.Rows[j][i];
+                    }
+                }
+                //添加批量更新的参数
+                command.Parameters.Add(new OracleParameter(DataTable.Columns[i].Caption, ob, param, ParameterDirection.Input));
+            }
+            ad.UpdateCommand = command;
+            ad.Update(DataTable);
+            ad.Dispose();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 获取DbFind的数据的DataTable的结构
+        /// </summary>
+        /// <param name="field"></param>
+        /// <param name="caller"></param>
+        /// <returns></returns>
+        public DataTable GetDbFindDataTable(string field, string caller)
+        {
+            string sql = "select * from dbfindsetui where ds_caller='" + caller + "' and ds_whichui='" + field + "'";
+            DataTable dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count != 0)
+            {
+                //通过#号分割字段
+                string[] dbfield = dt.Rows[0]["ds_findtoui"].ToString().Split('#');
+                string[] cnfield = dt.Rows[0]["ds_dbcaption"].ToString().Split('#');
+                //获取查询要查询的Table
+                string dbtable = dt.Rows[0]["ds_tables"].ToString();
+                //拼接查询的字段
+                for (int i = 0; i < dbfield.Length; i++)
+                {
+                    dbfield[i] = dbfield[i].Split(',')[0];
+                }
+                //新建一个空的DataTable
+                DataTable dt1 = new DataTable();
+                //往空的DataTable添加结构,ColumnName是中文,Caption是实际的字段名称
+                for (int i = 0; i < cnfield.Length; i++)
+                {
+                    dt1.Columns.Add(cnfield[i]);
+                    dt1.Columns[i].Caption = dbfield[i];
+                }
+                //返回一个带有结构的空的DataTable
+                //DbFind.BindTable1 = dbtable;
+                return dt1;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+
+
+        /// <summary>
+        ///  获取配置列表中的数据,支持DaatList,Form,DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <param name="condition"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type, string condition)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            //记录描述和字段名称
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            //调用substring是为了去除之前拼接多出来的一个逗号
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable] + " where " + condition;
+            //调用一个新的构造DataTable用来存放返回的数据
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //给DataTable加上列名和描述,列名是中文字段,描述是数据库实际的字段名称
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            //返回的第一条数据是SQL,后面的是实际的列名
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
+        }
+
+        /// <summary>
+        /// 查询配置的字段,Type是查询DataList,Form还是DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            //用于记录实际的列名,+1的目的是为了存放SQL
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable];
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //设置DataTable的列名和描述
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
+        }
+
+        /// <summary>
+        /// 检测内容是否存在
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        /// <returns></returns>
+        public bool CheckExist(string TableName, string Condition)
+        {
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            DataTable dt = new DataTable();
+            Console.WriteLine(sql);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            if (int.Parse(dt.Rows[0][0].ToString()) > 0)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 直接执行SQL,同时传入SQL的类型
+        /// </summary>
+        /// <param name="SQL"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public object ExecuteSql(string SQL, string Type, params object[] names)
+        {
+            object result = null;
+            command = new OracleCommand(SQL, connection);
+            //用来拼接参数的
+            if (names.Length > 0)
+            {
+                string[] par = SQL.Split(':');
+                //用来存参数的数组
+                StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+                for (int i = 0; i < par.Length - 1; i++)
+                {
+                    //新建一个char类型的数组用来存储每个字节的变量
+                    char[] c = par[i + 1].ToCharArray();
+                    addpar[i] = new StringBuilder();
+                    for (int j = 0; j < c.Length; j++)
+                    {
+                        if (c[j] != ' ' && c[j] != ',')
+                        {
+                            addpar[i].Append(c[j]);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+                for (int i = 0; i < addpar.Length; i++)
+                {
+                    command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+                }
+            }
+            Console.WriteLine(SQL);
+            switch (Type.ToUpper())
+            {
+                case "SELECT":
+                    result = new DataTable();
+                    OracleDataAdapter ad = new OracleDataAdapter(command);
+                    ad.Fill((DataTable)result);
+                    ad.Dispose();
+                    break;
+                case "DELETE":
+                    result = command.ExecuteNonQuery();
+                    break;
+                case "UPDATE":
+                    result = command.ExecuteNonQuery();
+                    break;
+                case "INSERT":
+                    result = command.ExecuteNonQuery();
+                    break;
+            }
+            command.Dispose();
+            return result;
+        }
+
+        /// <summary>
+        /// 为了同步BS端的条码维护,检测时允许问号的存在,在检测时默认将问号换成:Param参数
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void CheckSQL(string SQL)
+        {
+            SQL = SQL.Replace("?", ":Param");
+            command = new OracleCommand(SQL, connection);
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        public int GetDistinctRowCount(string TableName, string Field)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select distinct count('" + Field + "') from " + TableName;
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 根据Caller获取流水号
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public string GetSerialNumberByCaller(string Caller)
+        {
+            string SerialNumber = getFieldDataByCondition("MaxNumbers", "mn_number", "mn_tablename='" + Caller + "'").ToString();
+            UpdateByCondition("MaxNumbers", "mn_number=mn_number+1", "mn_tablename='" + Caller + "'");
+            return SerialNumber;
+        }
+
+        /// <summary>
+        /// 根据主键ID删除表的数据
+        /// </summary>
+        /// <param name="TableName">表名</param>
+        /// <param name="ID">主键</param>
+        /// <param name="DeleteID">需要删除主键ID的数组</param>
+        public void DeleteDataByID(string TableName, string ID, string[] DeleteID)
+        {
+            string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            command.ArrayBindCount = DeleteID.Length;
+            command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string GetSEQ(string SeqName)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("SELECT " + SeqName + ".NEXTVAL FROM DUAL", "select");
+            return dt.Rows[0][0].ToString();
+        }
+
+        /// <summary>
+        /// 批量通过SQL来执行插入操作 ,参数的第一个数一个string[]数组,用来传递需要添加的参数的名称
+        /// 之后的是名称参数数组对应的 ,所有的插入参数数据长度必须是一致的
+        /// </summary>
+        /// <param name="sql"></param>
+        /// <param name="names"></param>
+        public void BatchInsert(string sql, params object[][] names)
+        {
+            command = new OracleCommand(sql, connection);
+            command.ArrayBindCount = names[1].Length;
+            Console.WriteLine(sql);
+            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
+            //将第一个数组的下标固定为0作为循环添加的参数的名称
+            for (int i = 1; i <= names[0].Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+            }
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
+        {
+            command = new OracleCommand(sql, connection);
+            command.ArrayBindCount = param1[0].Length;
+            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
+            //将第一个数组的下标固定为0作为循环添加的参数的名称
+            for (int i = 0; i < param.Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
+            }
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+
+        /// <summary>
+        /// 查询DataList配置的字段
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public string GetDataList(string TableName, string Caller)
+        {
+            DataTable dt = new DataTable();
+            string SQL = " select listagg(dld_field,',') within group (order by dld_id)  from datalistdetail where dld_caller='" + Caller + "'";
+            command = new OracleCommand(SQL, connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt.Rows[0][0].ToString();
+        }
+
+        /// <summary>
+        /// 取Configs表中的配置,进行该客户是否执行某个操作
+        /// </summary>
+        /// <param name="Code"></param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public object GetConfig(string Code, string Caller)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select Data from configs where code='" + Code + "' and caller='" + Caller + "'";
+            dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count == 0)
+            {
+                return "";
+            }
+            else
+            {
+                return dt.Rows[0]["Data"];
+            }
+        }
+
+
+        //将数据类型的列类型转换为DataTable
+        public DataTable DataTypeColumnToDataTable(DataTable dt)
+        {
+            DataTable dt1 = new DataTable();
+            dt1.Rows.Add();
+            foreach (DataRow dr in dt.Rows)
+            {
+                dt1.Columns.Add(dr[0].ToString());
+                int index = dt.Rows.IndexOf(dr);
+                if (dr[1].ToString() == "NUMBER")
+                {
+                    dt1.Rows[0][index] = 0;
+                }
+                if (dr[1].ToString() == "VARCHAR2")
+                {
+                    dt1.Rows[0][index] = "这是一段文字";
+                }
+                if (dr[1].ToString() == "DATE")
+                {
+                    dt1.Rows[0][index] = DateTime.Now.ToString("yyyy-MM-dd");
+                }
+                if (dr[1].ToString() == "FLOAT")
+                {
+                    dt1.Rows[0][index] = 1.0;
+                }
+                if (dr[1].ToString() == "CLOB")
+                {
+                    dt1.Rows[0][index] = "一段长文字";
+                }
+            }
+            return dt1;
+        }
+
+
+        /// <summary>
+        /// 通过条件更新
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="update"></param>
+        /// <param name="condition"></param>
+        public string UpdateByCondition(string TableName, string update, string condition)
+        {
+            string sql = "update " + TableName + " set " + update + " where " + condition;
+            Console.WriteLine(sql);
+            command = new OracleCommand(sql, connection);
+            command.ExecuteNonQuery();
+            command.Dispose();
+            return sql;
+        }
+
+        /// <summary>
+        /// 调用存储过程
+        /// </summary>
+        /// <param name="ProcedureName"></param>
+        /// <param name="param"></param>
+        public void CallProcedure(string ProcedureName, params string[] param)
+        {
+            command.CommandText = "Execute " + ProcedureName;
+            if (param[0].Length > 0)
+            {
+                command.ArrayBindCount = param[1].Length;
+                for (int i = 1; i <= param[0].Length; i++)
+                {
+                    command.Parameters.Add(new OracleParameter(param[0][i - 1].ToString(), OracleDbType.Varchar2, param[i], ParameterDirection.Input));
+                }
+            }
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 出现异常进行回滚的执行方法
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void ExecuteSQLTran(params string[] SQL)
+        {
+            OracleTransaction tx = connection.BeginTransaction();
+            command = new OracleCommand();
+            command.Connection = connection;
+            command.Transaction = tx;
+            try
+            {
+                foreach (string sql in SQL)
+                {
+                    if (!String.IsNullOrEmpty(sql))
+                    {
+                        command.CommandText = sql;
+                        command.ExecuteNonQuery();
+                    }
+                }
+                tx.Commit();
+            }
+            catch (System.Data.OracleClient.OracleException E)
+            {
+                tx.Rollback();
+                throw new Exception(E.Message);
+            }
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 用于将string 的数组转换成SQL的查询内容
+        /// </summary>
+        /// <param name="Fields"></param>
+        /// <returns></returns>
+        private string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+
+        /// <summary>
+        /// 通过查询的内容获取到字段的描述
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetCaptionFromField(string field)
+        {
+            string[] caption = field.Split(',');
+            for (int i = 0; i < caption.Length; i++)
+            {
+                caption[i] = caption[i].Substring(0, caption[i].LastIndexOf("as")).Trim();
+            }
+            return caption;
+        }
+
+        /// <summary>
+        /// 通过查询的语句获取查询的字段
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetField(string field)
+        {
+            string[] fields = field.Split(',');
+            for (int i = 0; i < fields.Length; i++)
+            {
+                fields[i] = fields[i].Substring(fields[i].LastIndexOf("as") + 2, fields[i].Length - fields[i].LastIndexOf("as") - 2).Trim();
+            }
+            return fields;
+        }
+
+        public object GetLabelParam(string sql)
+        {
+            DataTable dt = new DataTable();
+            command = new OracleCommand(sql, connection);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            if (dt.Rows.Count > 0)
+            {
+                ad.Dispose();
+                command.Dispose();
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                command.Dispose();
+                return "";
+            }
+        }
+
+        public static string[] GetParamFromSQL(string SQL)
+        {
+            string[] par = SQL.Split(':');
+            //用来存参数的数组
+            StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+            string[] param = new string[par.Length - 1];
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                //新建一个char类型的数组用来存储每个字节的变量
+                char[] c = par[i + 1].ToCharArray();
+                addpar[i] = new StringBuilder();
+                for (int j = 0; j < c.Length; j++)
+                {
+                    if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                    {
+                        addpar[i].Append(c[j]);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+            }
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                param[i] = addpar[i].ToString();
+            }
+            return param;
+        }
+    }
+}

+ 1440 - 0
MES接口/LogicHandler.cs

@@ -0,0 +1,1440 @@
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+
+namespace MES接口
+{
+    class LogicHandler
+    {
+        private static Dictionary<string, string> Caller_Field = new Dictionary<string, string>();
+
+        public LogicHandler()
+        {
+            //根据不同的Caller来判断不同的验证条件
+            Caller_Field.Add("Make!PackageCollection", "");
+            Caller_Field.Add("SMT!SMTFeeding", "");
+            Caller_Field.Add("SMT!MaterialsWaring", "");
+            Caller_Field.Add("SMT!ChangeLine", "");
+            Caller_Field.Add("Make!FeedingCollection", "cd_ifinput");
+            Caller_Field.Add("Make!TestCollection", "cd_iftest");
+            Caller_Field.Add("Make!BoxUp", "");
+            Caller_Field.Add("Make!Repair", "");
+            Caller_Field.Add("Make!SplitBoard", "");
+            Caller_Field.Add("Make!SeqTransform", "cd_ifsnchange");
+            Caller_Field.Add("Quality!QCTask", "");
+            Caller_Field.Add("Quality!SamplingConfirm", "");
+            Caller_Field.Add("Quality!BatchJudge", "");
+            Caller_Field.Add("Quality!BatchQuery", "");
+            Caller_Field.Add("Special!MixPackage", "");
+            Caller_Field.Add("Special!CancelCollection", "");
+            Caller_Field.Add("Special!SeqTransform", "");
+            Caller_Field.Add("Special!QCForce", "");
+            Caller_Field.Add("Specail!MendLabel", "");
+            Caller_Field.Add("Special!BoxSplit", "");
+            Caller_Field.Add("Warehouse!In", "");
+            Caller_Field.Add("Warehouse!Out", "");
+            Caller_Field.Add("Warehouse!FinishedProductIn", "");
+            Caller_Field.Add("Warehouse!FinishedProductOut", "");
+            Caller_Field.Add("Warehouse!PalletWeigh", "");
+            Caller_Field.Add("Query!ExeProgress", "");
+            Caller_Field.Add("Quert!RealTime", "");
+            Caller_Field.Add("Query!OnlineTraceBack", "");
+            Caller_Field.Add("Query!ProductTraceBack", "");
+            Caller_Field.Add("Setup!ScaleTest", "");
+            Caller_Field.Add("Setup!PrinterTest", "");
+            Caller_Field.Add("Setup!LabelMaintain", "");
+            Caller_Field.Add("OQC!SamplingDataCollection", "cd_ifoqc");
+            Caller_Field.Add("Make!FuselageLabelPrint", "");
+            Caller_Field.Add("Make!ColorBoxLabelPrint", "");
+            Caller_Field.Add("Make!CartonBoxWeigh", "");
+            Caller_Field.Add("Make!ColorBoxWeigh", "cd_ifinput");
+            Caller_Field.Add("Make!BigBoxWeigh", "cd_ifpack");
+            Caller_Field.Add("Make!PalletWeigh", "cd_ifpack");
+        }
+
+        static DataHelper dh = new DataHelper();
+        //用于拼接SQL
+        static StringBuilder sql = new StringBuilder();
+        //用于存放批量执行的SQL
+        static List<string> sqls = new List<string>();
+        /// <summary>
+        /// 将字段数组拼接成查询字符串
+        /// </summary>
+        /// <param name="Fields"></param>
+        /// <returns></returns>
+        public static string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+
+        /// <summary>
+        /// 检测当前工序是否正确,如果是第一道工序则进行插入MakeSerial表
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckCurrentStepAndIfFirst(string iSnCode, string iMakeCode, string iSourceCode, string iCaller, out bool oIfFirst, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            oIfFirst = false;
+            if (iSnCode == "")
+            {
+                oErrorMessage = "序列号不能为空值";
+                return false;
+            }
+            string StepCode = "";
+            string StepName = "";
+            string LineCode = "";
+
+            string cd_ifinput = "";
+            string cr_code = "";
+            //获取岗位资源对应的工序编号和名称
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+            if (Caller_Field[iCaller] != "")
+            {
+                DataTable dt1 = null;
+                if (iMakeCode == "" || iMakeCode == null)
+                {
+                    dt1 = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_makecode", "ms_status" }, "ms_sncode='" + iSnCode + "'");
+                    if (dt1.Rows.Count > 0)
+                    {
+                        if ((dt1.Rows[0]["ms_makecode"].ToString() == ""))
+                        {
+                            oErrorMessage = "序列号" + iSnCode + "未绑定工单";
+                            return false;
+                        }
+                        if (dt1.Rows[0]["ms_status"].ToString() == "2")
+                        {
+                            oErrorMessage = "序列号" + iSnCode + "对应工单已完工";
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        oErrorMessage = "序列号" + iSnCode + "不存";
+                        return false;
+                    }
+                }
+                sql.Clear();
+                sql.Append("select " + Caller_Field[iCaller] + ",cd_ifinput ifinput,cr_code from  make left join craft on cr_code=ma_craftcode left join craftdetail on cd_crid=cr_id ");
+                sql.Append(" where ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'");
+                //获取的行号不等于0,存在记录检测通过
+                dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                if (dt1.Rows.Count > 0)
+                {
+                    cd_ifinput = dt1.Rows[0]["ifinput"].ToString();
+                    cr_code = dt1.Rows[0]["cr_code"].ToString();
+                    if (dt1.Rows[0][Caller_Field[iCaller]].ToString() != "-1")
+                    {
+                        //返回具体的工单信息
+                        string serial = "";
+                        switch (Caller_Field[iCaller])
+                        {
+                            case "cd_ifinput":
+                                serial = "上料采集";
+                                break;
+                            case "cd_ifoqc":
+                                serial = "OQC";
+                                break;
+                            case "cd_ifpack":
+                                serial = "包装采集";
+                                break;
+                            case "cd_ifsnchange":
+                                serial = "序列转换";
+                                break;
+                            case "cd_iftest":
+                                serial = "测试采集";
+                                break;
+                            default:
+                                break;
+                        }
+                        oErrorMessage = "当前岗位对应的工序不是" + serial + "工序";
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "当前岗位资源对应的工序不属于工单号" + iMakeCode;
+                    return false;
+                }
+            }
+            if (!CheckMakeStatus(iMakeCode))
+            {
+                oErrorMessage = "工单的状态必须是已下放";
+                return false;
+            }
+            //验证当前执行的工序是否存在
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_nextstepcode from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string CurrentStep = dt.Rows[0]["ms_nextstepcode"].ToString();
+                if (CurrentStep != "")
+                {
+                    if (CurrentStep != StepCode)
+                    {
+                        oErrorMessage = "序列号" + iSnCode + "的当前工序是" + CurrentStep + ",当前岗位的工序是" + StepName;
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "序列号" + iSnCode + "无可继续执行工序(已完工或者序列号不存在)";
+                    return false;
+                }
+            }
+
+
+            //判断是否是第一道工序
+            dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakeCode + "'", "select");
+            string detno = dt.Rows[0]["detno"].ToString();
+            //判断当前最小的执行顺序是否有记录
+            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + StepCode + "' and mcd_macode='" + iMakeCode + "' and mcd_detno ='" + detno + "'") > 0)
+            {
+                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'"))
+                {
+                    //判断当前工单的数量是否已经超出了完工数量
+                    int ma_qty = int.Parse(dh.getFieldDataByCondition("make", "ma_qty", "ma_code='" + iMakeCode + "'").ToString());
+                    //查询除了报废的之外的记录数量
+                    int ms_sncodecount = int.Parse(dh.getFieldDataByCondition("makeserial", "count(ms_sncode)", "ms_makecode='" + iMakeCode + "' and ms_status<>3").ToString());
+                    //如果MakeSerial表的记录数已经达到了工单数量
+                    if (ma_qty > ms_sncodecount)
+                    {
+                        sql.Clear();
+                        sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
+                        sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
+                        sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + StepCode + "',1,ma_code ");
+                        sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
+                        dh.ExecuteSql(sql.ToString(), "insert");
+                        oErrorMessage = "获取序列号" + iSnCode + "成功,";
+                        oIfFirst = true;
+                    }
+                    else
+                    {
+                        oErrorMessage = "当前生产数量已达到完工数量";
+                        return false;
+                    }
+                }
+            }
+            //判断岗位备料是否足够
+            string Yes_No = dh.GetConfig("BatchNumber", "MESSetting").ToString();
+            if (cd_ifinput != "0")
+            {
+                sql.Clear();
+                sql.Append("select wm_concat(mss_prodcode) code,count(1) cn from (select sum(nvl(mss_remain,0))remain,mss_prodcode,max(mss_baseqty) mss_baseqty ");
+                sql.Append("from makesourcestock where mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "' ");
+                sql.Append("and mss_linecode='" + LineCode + "' group by mss_prodcode)T where T.remain<mss_baseqty and rownum<20");
+                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                //如果配置的是Yes
+                if (Yes_No != "0")
+                {
+                    //如果批次料不足
+                    if (dt.Rows.Count > 0 && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
+                    {
+                        oErrorMessage += "批次物料:" + iSnCode + "," + dt.Rows[0]["code"] + "岗位备料不足";
+                        return false;
+                    }
+                }
+            }
+            return true;
+        }
+
+        private static bool CheckMakeStatus(string iMaCode)
+        {
+            if (dh.getFieldDataByCondition(" make ", "ma_statuscode", "ma_code='" + iMaCode + "' ").ToString() == "STARTED")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 判断当前工序是否是第一道工序
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakecode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <returns></returns>
+        public static bool CheckIfFirstMakeSerial(string iSnCode, string iMakecode, string iSourceCode)
+        {
+            //选取当前的最小的执行顺序
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            DataTable dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakecode + "'", "select");
+            string detno = dt.Rows[0]["detno"].ToString();
+            //判断当前最小的执行顺序是否有记录
+            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + CurrentStep + "' and mcd_macode='" + iMakecode + "' and mcd_detno ='" + detno + "'") > 0)
+            {
+                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakecode + "'"))
+                {
+                    sql.Clear();
+                    sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
+                    sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
+                    sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + CurrentStep + "',0,ma_code ");
+                    sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakecode + "' and mcd_stepcode='" + CurrentStep + "'");
+                    dh.ExecuteSql(sql.ToString(), "insert");
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 判断下一工序是否是送检工序
+        /// </summary>
+        /// <returns></returns>
+        public static bool CheckNextStepIfQC(string iSnCode, string iMakeCode, string iStepCode, string iCraftCode, string iUserName, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string IfQC = dh.getFieldDataByCondition("craft left join  craftdetail on cd_crid=cr_id", "cd_ifoqc", "cr_code='" + iCraftCode + "' and cd_stepcode='" + iStepCode + "'").ToString();
+            if (IfQC != "0" && IfQC != "")
+            {
+                DataTable dt = dh.getFieldsDataByCondition("make left join product on ma_prodcode=pr_code", new string[] { "ma_nowcheckqty", "pr_qcbatchqty", "ma_checkno", "ma_prodcode", "pr_qualmethod" }, "ma_code='" + iMakeCode + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ma_nowcheckqty = dt.Rows[0]["ma_nowcheckqty"].ToString();
+                    string pr_qcbatchqty = dt.Rows[0]["pr_qcbatchqty"].ToString();
+                    string ma_checkno = dt.Rows[0]["ma_checkno"].ToString();
+                    string ma_prodcode = dt.Rows[0]["ma_prodcode"].ToString();
+                    string pr_qualmethod = dt.Rows[0]["pr_qualmethod"].ToString();
+                    if (pr_qcbatchqty != "" && pr_qcbatchqty != "0")
+                    {
+                        //当前批次的送检批数量大于物料资料中的抽检批数或者当前批次编号为空
+                        string checkno = "";
+                        if (int.Parse(ma_nowcheckqty == "" ? "0" : ma_nowcheckqty) >= int.Parse(pr_qcbatchqty) || ma_checkno == "")
+                        {
+                            //原有的抽检批次插入OQCBatch
+                            string ob_id = dh.GetSEQ("OQCBatch_SEQ");
+                            checkno = dh.GetSerialNumberByCaller("Make!CheckQC");
+                            sql.Clear();
+                            sql.Append("insert into OQCBatch  (ob_id, ob_checkno,ob_makecode,ob_source,ob_indate,ob_checkman,ob_batchqty,ob_status,ob_prodcode,ob_projectcode)");
+                            sql.Append(" values('" + ob_id + "','" + checkno + "','" + iMakeCode + "', '工序',sysdate, '" + iUserName + "','" + ma_nowcheckqty + "','UNCHECK','" + ma_prodcode + "','" + pr_qualmethod + "')");
+                            sqls.Add(sql.ToString());
+                            sqls.Add("update makeserial set ms_checkno='" + checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
+                            sqls.Add("update make set ma_checkno='" + checkno + "',ma_nowcheckqty=1 where ma_code='" + iMakeCode + "'");
+                        }
+                        else
+                        {
+                            sqls.Add("update makeserial set ms_checkno='" + ma_checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
+                            sqls.Add("update make set ma_nowcheckqty= ma_nowcheckqty+1  where ma_code='" + iMakeCode + "'");
+                        }
+                        dh.ExecuteSQLTran(sqls.ToArray());
+                        sqls.Clear();
+                        //如果制造单的ma_checkno没有值则新加入一个值
+                        string checkno1 = checkno == "" ? ma_checkno : checkno;
+                        string obd_obid = dh.getFieldDataByCondition("oqcbatch", "ob_id", "ob_checkno='" + checkno1 + "'").ToString();
+                        //插入抽检批次明细表
+                        sql.Clear();
+                        sql.Append("insert into OQCBatchDetail (obd_id,obd_obid,obd_sncode,obd_outboxcode,obd_makecode,obd_checkno,obd_builddate) ");
+                        sql.Append("select OQCBatchDetail_SEQ.nextval,'" + obd_obid + "',ms_sncode,ms_outboxcode,ms_makecode,ms_checkno,");
+                        sql.Append("sysdate from makeserial where  ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
+                        dh.ExecuteSql(sql.ToString(), "insert");
+                        return true;
+                    }
+                    else
+                    {
+                        oErrorMessage = "请维护物料资料的抽检批数";
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "制造单号不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrorMessage = "当前工序的下一工序不是OQC检测";
+                return false;
+            }
+        }
+
+        /// <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 em_code=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            if (dt.Rows.Count > 0)
+            {
+                return true;
+            }
+            else
+            {
+                oErrorMessage = "用户名或者密码不正确!";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 验证用户身份信息和岗位资源
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="iPassWord"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckUserLoginAndSource(string iUserCode, string iPassWord, string iUserSource, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            if (dt.Rows.Count > 0)
+            {
+                string em_name = dt.Rows[0]["em_name"].ToString();
+                if (dt.Rows[0]["em_type"].ToString() == "admin" && iUserSource == "")
+                {
+                    return true;
+                }
+                dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                //如果存在该编号
+                if (dt.Rows.Count > 0)
+                {
+                    //判断如果多个岗位资源存在,用户输入的只要在其中就行
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        if (dt.Rows[i]["ur_resourcecode"].ToString() == iUserSource)
+                        {
+                            return true;
+                        }
+                    }
+                    oErrorMessage = "岗位资源编号错误或者未审核!";
+                }
+                else
+                    oErrorMessage = "岗位资源编号错误或者未审核!";
+            }
+            else
+                oErrorMessage = "用户名密码错误!";
+            return false;
+        }
+
+        /// <summary>
+        /// 分配Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetAddressRangeByMakeCode(string iSnCode, string iMakeCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oErrorMessage)
+        {
+            string id = "";
+            oMac = "";
+            oBT = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCode3 = "";
+            oErrorMessage = "";
+            DataTable dt = dh.getFieldsDataByCondition("MakeIMEIList", new string[] { "mil_mac", "mil_bt", "mil_othcode1", "mil_othcode2", "mil_othcode3" }, "mil_sncode='" + iSnCode + "' and mil_makecode='" + iMakeCode + "'");
+            if (dt.Rows.Count > 0)
+            {
+                if (dt.Rows[0]["ms_mac"].ToString() != "")
+                {
+                    id = dt.Rows[0]["ms_id"].ToString();
+                    oMac = dt.Rows[0]["ms_mac"].ToString();
+                    oBT = dt.Rows[0]["ms_bt"].ToString();
+                    oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
+                    oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
+                    oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
+                    return true;
+                }
+                //如果没有数据则从MakeIMEIList表中查询
+                else
+                {
+                    dt = dh.getFieldsDataByCondition("MakeIMEIList", new string[] { "mil_id", "mil_mac", "mil_bt", "mil_meid", "mil_netcode", "mil_psn", "mil_imei1", "mil_imei2", "mil_imei3", "mil_othcode1", "mil_othcode2", "mil_othcode3" }, "mil_sncode='" + iSnCode + "' and mil_makecode='" + iMakeCode + "'");
+                    if (dt.Rows.Count > 0)
+                    {
+                        id = dt.Rows[0]["mil_id"].ToString();
+                        oMac = dt.Rows[0]["mil_mac"].ToString();
+                        oBT = dt.Rows[0]["mil_bt"].ToString();
+                        oCode1 = dt.Rows[0]["mil_othcode1"].ToString();
+                        oCode2 = dt.Rows[0]["mil_othcode2"].ToString();
+                        oCode3 = dt.Rows[0]["mil_othcode3"].ToString();
+                        return true;
+                    }
+                    else
+                    {
+                        dt = dh.getFieldsDataByCondition("MakeIMEIList", new string[] { "mil_id", "mil_mac", "mil_bt", "mil_meid", "mil_netcode", "mil_psn", "mil_imei1", "mil_imei2", "mil_imei3", "mil_othcode1", "mil_othcode2", "mil_othcode3" }, "mil_sncode is null and mil_makecode is null order by mil_sncode");
+                        if (dt.Rows.Count > 0)
+                        {
+                            id = dt.Rows[0]["mil_id"].ToString();
+                            oMac = dt.Rows[0]["mil_mac"].ToString();
+                            oBT = dt.Rows[0]["mil_bt"].ToString();
+                            oCode1 = dt.Rows[0]["mil_othcode1"].ToString();
+                            oCode2 = dt.Rows[0]["mil_othcode2"].ToString();
+                            oCode3 = dt.Rows[0]["mil_othcode3"].ToString();
+                            //将已经分配的序列号的SN和MakeCode更新到MakeIMEIList表中
+                            dh.UpdateByCondition("MakeIMEIList", "mil_sncode='" + iSnCode + "',mil_makecode='" + iMakeCode + "',mil_status='已使用'", "mil_id=" + id);
+                            return true;
+                        }
+                        else
+                        {
+                            oErrorMessage = "当前序列号无可分配地址";
+                            return false;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                oErrorMessage = "序列号" + iSnCode + "不存在";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
+        /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetIMEIOrNetCodeRange(string iSnCode, string iMakeCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oErrorMessage)
+        {
+            string id = "";
+            oBT = "";
+            oMEID = "";
+            oMac = "";
+            oPSN = "";
+            oNetCode = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCode3 = "";
+            oErrorMessage = "";
+            //先判断MakeSerial表的数据,是否已经烧入了,如已经烧入直接从MakeSerial表取数据
+            //condition iIMEI1,iNETCode
+            DataTable dt = dh.getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3" }, "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "' and ms_netcode like '%" + iNetCode + "%' and ms_imei1 like '%" + iIMEI1 + "%'");
+            if (dt.Rows.Count > 0)
+            {
+                if (dt.Rows[0]["ms_mac"].ToString() != "")
+                {
+                    id = dt.Rows[0]["ms_id"].ToString();
+                    oMac = dt.Rows[0]["ms_mac"].ToString();
+                    oBT = dt.Rows[0]["ms_bt"].ToString();
+                    oPSN = dt.Rows[0]["ms_psn"].ToString();
+                    oNetCode = dt.Rows[0]["ms_netcode"].ToString();
+                    oMEID = dt.Rows[0]["ms_meid"].ToString();
+                    oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
+                    oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
+                    oIMEI3 = dt.Rows[0]["ms_imei3"].ToString();
+                    oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
+                    oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
+                    oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
+                    return true;
+                }
+                //如果没有数据则从MakeIMEIList表中查询
+                else
+                {
+                    dt = dh.getFieldsDataByCondition("MakeIMEIList", new string[] { "mil_id", "mil_mac", "mil_bt", "mil_meid", "mil_netcode", "mil_psn", "mil_imei1", "mil_imei2", "mil_imei3", "mil_othcode1", "mil_othcode2", "mil_othcode3" }, "mil_sncode='" + iSnCode + "' and mil_makecode='" + iMakeCode + "'  and mil_netcode like '%" + iNetCode + "%' and mil_imei1 like '%" + iIMEI1 + "%'");
+                    if (dt.Rows.Count > 0)
+                    {
+                        id = dt.Rows[0]["mil_id"].ToString();
+                        oMac = dt.Rows[0]["mil_mac"].ToString();
+                        oBT = dt.Rows[0]["mil_bt"].ToString();
+                        oPSN = dt.Rows[0]["mil_psn"].ToString();
+                        oNetCode = dt.Rows[0]["mil_netcode"].ToString();
+                        oMEID = dt.Rows[0]["mil_meid"].ToString();
+                        oIMEI1 = dt.Rows[0]["mil_imei1"].ToString();
+                        oIMEI2 = dt.Rows[0]["mil_imei2"].ToString();
+                        oIMEI3 = dt.Rows[0]["mil_imei3"].ToString();
+                        oCode1 = dt.Rows[0]["mil_othcode1"].ToString();
+                        oCode2 = dt.Rows[0]["mil_othcode2"].ToString();
+                        oCode3 = dt.Rows[0]["mil_othcode3"].ToString();
+                        return true;
+                    }
+                    else
+                    {
+                        dt = dh.getFieldsDataByCondition("MakeIMEIList", new string[] { "mil_id", "mil_mac", "mil_bt", "mil_meid", "mil_netcode", "mil_psn", "mil_imei1", "mil_imei2", "mil_imei3", "mil_othcode1", "mil_othcode2", "mil_othcode3" }, "mil_sncode is null and mil_makecode is null and mil_netcode like '%" + iNetCode + "%' and mil_imei1 like '%" + iIMEI1 + "%' order by mil_sncode ");
+                        if (dt.Rows.Count > 0)
+                        {
+                            id = dt.Rows[0]["mil_id"].ToString();
+                            oMac = dt.Rows[0]["mil_mac"].ToString();
+                            oBT = dt.Rows[0]["mil_bt"].ToString();
+                            oPSN = dt.Rows[0]["mil_psn"].ToString();
+                            oNetCode = dt.Rows[0]["mil_netcode"].ToString();
+                            oMEID = dt.Rows[0]["mil_meid"].ToString();
+                            oIMEI1 = dt.Rows[0]["mil_imei1"].ToString();
+                            oIMEI2 = dt.Rows[0]["mil_imei2"].ToString();
+                            oIMEI3 = dt.Rows[0]["mil_imei3"].ToString();
+                            oCode1 = dt.Rows[0]["mil_othcode1"].ToString();
+                            oCode2 = dt.Rows[0]["mil_othcode2"].ToString();
+                            oCode3 = dt.Rows[0]["mil_othcode3"].ToString();
+                            //将已经分配的序列号的SN和MakeCode更新到MakeIMEIList表中
+                            dh.UpdateByCondition("MakeIMEIList", "mil_sncode='" + iSnCode + "',mil_makecode='" + iMakeCode + "',mil_status='已使用'", "mil_id=" + id);
+                            return true;
+                        }
+                        else
+                        {
+                            oErrorMessage = "当前序列号无可分配地址";
+                            return false;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                oErrorMessage = "序列号" + iSnCode + "不存在";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 获取工单的最近一条执行记录
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="oMakeCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetMakeInfo(string iSnCode, out string oMakeCode, out string oErrorMessage)
+        {
+            //取MakeProcess表中的执行记录ID最大的一个工单的号码
+            oMakeCode = "";
+            oErrorMessage = "";
+            oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_sncode='" + iSnCode + "' and ms_indate in (select max(ms_indate) from makeserial where ms_sncode='" + iSnCode + "')").ToString();
+            if (oMakeCode != "")
+                return true;
+            else
+            {
+                oErrorMessage = "当前序列号" + iSnCode + "不存在生产记录";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 获取送检批次,根据不同的iOQCStep执行不同的操作,查询到有具体的信息时返回Form和Detail的两个DataTable
+        ///  iOQCStep 有四个固定参数
+        ///  OQCSENDCHECK 生成送检批
+        ///  OQCPLANMAINTAIN 抽样计划维护
+        ///  OQCDATACOLLECTION 抽样数据采集
+        ///  OQCRESULTDETERMINE 批结果判定
+        /// </summary>
+        /// <returns></returns>
+        public static DataTable[] GetOQCBatch(string iSnCode, string iOutBoxCode, string iCheckNo, string iOQCStep, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "";
+            string ms_checkno = "";
+            DataTable dt = new DataTable();
+            if (iCheckNo != "")
+                return GetBatch(iCheckNo, iOQCStep, out oErrorMessage);
+            else if (iSnCode != "")
+            {
+                SQL = "select  ms_checkno  from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "'";
+                dt = (DataTable)dh.ExecuteSql(SQL, "select");
+                if (dt.Rows.Count == 0)
+                {
+                    oErrorMessage = "序列号" + iSnCode + "不存在";
+                    return null;
+                }
+                else
+                {
+                    if (dt.Rows[0]["ms_checkno"].ToString() == "")
+                    {
+                        oErrorMessage = "该序列号没有送检批次号";
+                        return null;
+                    }
+                    else
+                        ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+                }
+            }
+            else if (iOutBoxCode != "")
+            {
+                SQL = "select ms_checkno from MES_PACKAGE_VIEW left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + iOutBoxCode + "' ";
+                dt = (DataTable)dh.ExecuteSql(SQL, "select");
+                if (dt.Rows.Count == 0)
+                {
+                    oErrorMessage = "该箱号不存在";
+                    return null;
+                }
+                else
+                {
+                    if (dt.Rows[0]["ms_checkno"].ToString() == "")
+                    {
+                        oErrorMessage = "该箱号没有送检批次号";
+                        return null;
+                    }
+                    else
+                        ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+                }
+            }
+            if (ms_checkno != "")
+            {
+                return GetBatch(ms_checkno, iOQCStep, out oErrorMessage);
+            }
+            else
+            {
+                oErrorMessage = "送检批次不存在";
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// 获取序列号的所有串号信息
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetSNAllInfo(string iSnCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oErrorMessage)
+        {
+            oBT = "";
+            oMEID = "";
+            oMac = "";
+            oPSN = "";
+            oNetCode = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCode3 = "";
+            oErrorMessage = "";
+            //通过序列号获取最近操作的工单号
+            string MakeCode;
+            GetMakeInfo(iSnCode, out MakeCode, out oErrorMessage);
+            DataTable dt = dh.getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3" }, "ms_sncode='" + iSnCode + "'' and ms_makecode='" + MakeCode + "' ");
+            if (dt.Rows.Count > 0)
+            {
+                oMac = dt.Rows[0]["ms_mac"].ToString();
+                oBT = dt.Rows[0]["ms_bt"].ToString();
+                oPSN = dt.Rows[0]["ms_psn"].ToString();
+                oNetCode = dt.Rows[0]["ms_netcode"].ToString();
+                oMEID = dt.Rows[0]["ms_meid"].ToString();
+                oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
+                oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
+                oIMEI3 = dt.Rows[0]["ms_imei3"].ToString();
+                oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
+                oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
+                oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
+                return true;
+            }
+            else
+            {
+                oErrorMessage = "序列号" + iSnCode + "不存在";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 第一个是Form的主表信息,第二个是Grid的信息
+        /// </summary>
+        /// <param name="iCheckNo"></param>
+        /// <returns></returns>
+        private static DataTable[] GetBatch(string iCheckNo, string iOQCStep, out string oErrorMessage)
+        {
+            DataTable Form = new DataTable();
+            DataTable Grid = new DataTable();
+            oErrorMessage = "";
+            switch (iOQCStep.ToUpper())
+            {
+                case "OQCSENDCHECK":
+                    sql.Clear();
+                    sql.Append("select count(1) ob_batchqty,obd_outboxcode,obd_makecode ma_code, obd_id from OQCBatchdetail ");
+                    sql.Append("where obd_checkno = '" + iCheckNo + "' group by  obd_outboxcode,obd_makecode ,obd_id");
+                    Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    Form = (DataTable)dh.ExecuteSql("select ob_id,ob_status,ob_prodcode,ob_batchqty,ob_source,ob_checkno from OQCBatch where ob_checkno='" + iCheckNo + "'", "select");
+                    if (Form.Rows.Count > 0)
+                    {
+                        if (Form.Rows[0]["ob_source"].ToString() == "新增" && Form.Rows[0]["ob_status"].ToString() == "ENTERING")
+                        {
+                            sql.Clear();
+                            sql.Append("select ob_id,ob_status,ob_prodcode ma_prodcode,ob_batchqty,ob_source,ob_checkno,obd_id,obd_outboxcode,obd_makecode ma_code,count(1) cn from OQCBatch left join OQCBatchdetail ");
+                            sql.Append("on obd_obid = ob_id  where ob_checkno ='" + iCheckNo + "' group by ob_id,ob_status,ob_prodcode,ob_batchqty,ob_source,ob_checkno,obd_outboxcode,obd_makecode,obd_id");
+                            Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        }
+                        else
+                            oErrorMessage = "自动生成的抽检批次号不允许在该页面操作,或者该抽检批次号不是在录入状态";
+                    }
+                    else
+                        oErrorMessage = "该送检批次不存在";
+                    break;
+                case "OQCPLANMAINTAIN":
+                    sql.Clear();
+                    sql.Append("select ob_prodcode,ob_id,ob_checkno,ob_projectcode,ob_batchqty,ob_source,ob_remark,");
+                    sql.Append("ob_status,pr_id,pr_detail,pr_kind,pr_manutype,pr_qualmethod from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    sql.Clear();
+                    if (Form.Rows.Count > 0)
+                    {
+                        string pr_id;
+                        //判断状态是否是待检验
+                        if (Form.Rows[0]["ob_status"].ToString() == "UNCHECK")
+                        {
+                            //判断送检方案是否为空
+                            if (Form.Rows[0]["ob_projectcode"].ToString() == "")
+                            {
+                                //第一原则送检方案为空
+                                string qualmethod = "";
+                                if (Form.Rows[0]["pr_qualmethod"].ToString() == "")
+                                {
+                                    //判读第二原则送检方案为空
+                                    string pr_qualmethod = dh.getFieldDataByCondition("product left join productkind on pr_kind=pk_name", "pk_qualmethod", "pr_code='" + Form.Rows[0]["ob_prodcode"] + "'").ToString();
+                                    if (pr_qualmethod == "" || pr_qualmethod == null)
+                                        oErrorMessage = "该物料或者物料种类未维护检验方案,物料号:" + Form.Rows[0]["ob_prodcode"] + ",请先维护检验方案";
+                                    //判读第二原则送检方案为空
+                                    else
+                                        qualmethod = pr_qualmethod;
+                                }
+                                //第一原则送检方案不为空
+                                else
+                                {
+                                    qualmethod = Form.Rows[0]["pr_qualmethod"].ToString();
+                                }
+                                Form.Rows[0]["ob_projectcode"] = qualmethod;
+                                pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + qualmethod + "'").ToString();
+                                sql.Clear();
+                                sql.Append("select 1 choose,nvl(max(oi_id),0) oi_id,max(ci_kind) ci_kind,max(oi_sampleqty) oi_sampleqty from ");
+                                sql.Append("QUA_PROJECT left join QUA_ProjectDetail on pd_prid=pr_id  left join QUA_CheckItem on ");
+                                sql.Append("pd_ciid=ci_id  left join OQCITEMS on oi_projectcode=pr_code and oi_checkkind=ci_kind ");
+                                sql.Append("where oi_checkno='" + iCheckNo + "' and oi_projectcode='" + qualmethod + "' group by ci_kind ");
+                                Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                                if (Grid.Rows.Count == 0)
+                                {
+                                    sql.Clear();
+                                    Grid = (DataTable)dh.ExecuteSql("select distinct 0 choose,ci_kind,0 oi_id,0 oi_sampleqty   from QUA_ProjectDetail left join QUA_CheckItem on pd_ciid=ci_id where pd_prid='" + pr_id + "'", "select");
+                                    if (Grid.Rows.Count == 0)
+                                        oErrorMessage = "检验方案:" + qualmethod + "无检验项目";
+                                }
+                            }
+                            else
+                            {
+                                pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + Form.Rows[0]["pr_qualmethod"] + "'").ToString();
+                                Grid = (DataTable)dh.ExecuteSql("select distinct ci_kind ,0 oi_id , 0 oi_sampleqty   from QUA_ProjectDetail left join QUA_CheckItem on pd_ciid=ci_id where pd_prid='" + pr_id + "'", "select");
+                            }
+                        }
+                        else
+                            oErrorMessage = "只有待检验的批次才允许维护抽样计划";
+                    }
+                    else
+                        oErrorMessage = "该抽检批次不存在";
+                    break;
+                case "OQCDATACOLLECTION":
+                    sql.Clear();
+                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_batchqty,pr_detail,ob_ngqty,ob_okqty,oi_checkqty,");
+                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode left join oqcitems on oi_checkno =ob_checkno and oi_projectcode =ob_projectcode where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    //状态为UNCHECK或者CHECKING并且有抽样计划的才能操作
+                    if (Form.Rows.Count > 0)
+                    {
+                        if (Form.Rows[0]["ob_projectcode"].ToString() == "" || !(Form.Rows[0]["ob_status"].ToString() != "UNCHECK" || Form.Rows[0]["ob_status"].ToString() != "CHECKING"))
+                        {
+                            oErrorMessage = "状态为未检验或者送检中并且有抽样计划的才能操作";
+                        }
+                    }
+                    else
+                    {
+                        oErrorMessage = "抽检批次不存在";
+                    }
+                    break;
+                case "OQCRESULTDETERMINE":
+                    //更新合格数和不合格数
+                    sql.Clear();
+                    sql.Append("update OQCBATCH set (ob_ngqty,ob_okqty)=(select nvl(max(oi_ngqty), 0),max(oi_checkqty)-nvl(max(oi_ngqty) ");
+                    sql.Append(",0) from OQCItems where oi_checkno='" + iCheckNo + "') where ob_checkno='" + iCheckNo + "'");
+                    dh.ExecuteSql(sql.ToString(), "update");
+                    //查询Form数据
+                    sql.Clear();
+                    sql.Append("select ob_id,ob_makecode,ob_status,ob_prodcode,(select  max(oi_checkqty) oi_checkqty from OQCItems where oi_checkno='" + iCheckNo + "'),");
+                    sql.Append("ob_batchqty,ob_okqty,ob_ngqty,ob_maxngacceptqty,ob_source,ob_checkno,ob_result from OQCBatch where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    if (Form.Rows.Count == 0)
+                    {
+                        oErrorMessage = "该抽检批次不存在";
+                    }
+                    break;
+                default:
+                    break;
+            }
+            return new DataTable[] { Form, Grid };
+        }
+
+        /// <summary>
+        /// 记录操作日志
+        /// </summary>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSnCode"></param>
+        public static void InsertMakeProcess(string iSnCode, string iMakeCode, string result, string iUserName)
+        {
+            sql.Clear();
+            sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
+            sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode) ");
+            sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,mcd_stepcode,mcd_stepname,");
+            sql.Append("ma_craftcode,ma_craftname,ma_kind,'" + result + "',sysdate,'" + iUserName + "',ma_wccode,ma_linecode,''");
+            sql.Append("from make left join makecraftdetail on mcd_macode=ma_code left join makeserial on ms_makecode=ma_code ");
+            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "'");
+            //插入makeprocess 
+            dh.ExecuteSql(sql.ToString(), "insert");
+            sql.Clear();
+        }
+
+        /// <summary>
+        /// 记录一般操作日志
+        /// </summary>
+        /// <param name="inMan"></param>
+        /// <param name="Content"></param>
+        /// <param name="Result"></param>
+        /// <param name="Search"></param>
+        /// <param name="Code"></param>
+        public static void InsertMessageLog(string inMan, string Content, string Result, string Search, string Code)
+        {
+            sql.Clear();
+            sql.Append("insert into messagelog (ml_id,ml_date,ml_man,ml_content,ml_result,ml_search,code) ");
+            sql.Append("values (messagelog_seq.nextval,sysdate,'" + inMan + "','" + Content + "','" + Result + "','" + Search + "','" + Code + "')");
+            dh.ExecuteSql(sql.ToString(), "insert");
+        }
+
+        /// <summary>
+        /// 保存Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMac"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iCode1"></param>
+        /// <param name="iCode2"></param>
+        /// <param name="iCode3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        public static bool SetAddressInfo(string iSnCode, string iMakeCode, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
+        {
+            oErrMessage = "";
+            string sql = "update MakeSerial set ms_mac=:iMac ,ms_bt=:iBT ,ms_othcode1=:iCode1,ms_othcode2=:iCode2,ms_othcode3=:iCode3 where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'";
+            dh.ExecuteSql(sql, "update", iMac, iBT, iCode1, iCode2, iCode3);
+            return true;
+        }
+
+
+        /// <summary>
+        /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
+        /// </summary>
+        /// <param name="iSnCode">序列号</param>
+        /// <param name="iClass"></param>
+        /// <param name="iSubClass1"></param>
+        /// <param name="iSubClass2"></param>
+        /// <param name="iSubClass3"></param>
+        /// <param name="iMaxValue"></param>
+        /// <param name="iMinValue"></param>
+        /// <param name="iActualValue"></param>
+        /// <param name="iValue1"></param>
+        /// <param name="iValue2"></param>
+        /// <param name="iValue3"></param>
+        /// <param name="iTestResult"></param>
+        /// <param name="oErrMessage"></param>                                                      
+        /// <returns></returns>
+        public static bool SetTestDetail(string iSnCode, string iMakeCode, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iSourceCode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            sql.Clear();
+            sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_SUBCLASS1,STD_SUBCLASS2,");
+            sql.Append("STD_SUBCLASS3,STD_MAXVALUE,STD_MINVALUE,STD_ACTUALVALUE,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_TESTRESULT,");
+            sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
+            sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
+            sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_record)");
+            dh.ExecuteSql(sql.ToString(), "select", iSnCode, iMakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iSourceCode);
+            return true;
+        }
+
+        /// <summary>
+        /// 作业调用该方法将确认接收SN对应的IMEI及附属信息。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iIMEI2"></param>
+        /// <param name="iIMEI3"></param>
+        /// <param name="iMEID"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="iPSN"></param>
+        /// <param name="iMac"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iCode1"></param>
+        /// <param name="iCode2"></param>
+        /// <param name="iCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetIMEIInfo(string iSnCode, string iMakeCode, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNetCode, string iPSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string sql = "update MakeSerial set ms_mac=:iMac ,ms_bt=:iBT ,ms_imei1=:iIMEI1 ,ms_imei2=:iIMEI2 ,ms_imei3=:iIMEI3 ,ms_netcode=:iNetCode ,ms_psn=:iPSN ,ms_othcode1=:iCode1 ,ms_othcode2=:iCode2 ,ms_othcode3=:iCode3  where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'";
+            dh.ExecuteSql(sql, "update", iMac, iBT, iIMEI1, iIMEI2, iIMEI3, iNetCode, iPSN, iCode1, iCode2, iCode3);
+            return true;
+        }
+
+        /// <summary>
+        /// 执行不良信息采集
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iBadCode"></param>
+        /// <param name="iBadRemark"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetTestNGDetail(string iSnCode, string iMakeCode, string iUserName, string iSourceCode, string iResult, string[] iBadCode, string[] iBadRemark, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = "";
+            string StepName = "";
+            if (iResult == "" || iResult == null)
+            {
+                iResult = "检查未通过";
+            }
+            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
+            sql.Clear();
+            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,");
+            sql.Append("mb_indate,mb_stepcode,mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status,mb_badremark)");
+            sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserName + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,'',");
+            sql.Append("sp_soncode,'0',:bc_remark from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
+            sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSnCode + "'");
+            dh.BatchInsert(sql.ToString(), new string[] { "bc_code", "bc_remark" }, iBadCode, iBadRemark);
+            //更新序列号状态,待维修,返修工序
+            string st_rstepcode = dh.getFieldDataByCondition("step", "st_rstepcode", "st_code='" + StepCode + "'").ToString();
+            sql.Clear();
+            sql.Append("update makeserial set ms_status = 3,ms_nextstepcode ='" + st_rstepcode + "', ");
+            sql.Append("ms_stepcode ='" + StepCode + "' where ms_sncode ='" + iSnCode + "' and ms_makecode ='" + iMakeCode + "'");
+            dh.ExecuteSql(sql.ToString(), "update");
+            //更新makecraftdetail 工单采集记录表,根据工单号和工序编号 记录当前测试工序采集数量
+            dh.UpdateByCondition("makecraftdetail", "mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1", "mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
+            //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
+            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "'", "ms_sncode='" + iSnCode + "'");
+            //记录操作日志
+            InsertMakeProcess(iSnCode, iMakeCode, iResult, iUserName);
+            //判断当前采集点是否为扣料工序cd_ifreduce =-1 则为扣料工序
+            SetCollectionFinish(iSnCode, iMakeCode, iUserName, iSourceCode, out oErrorMessage);
+            return true;
+        }
+
+        /// <summary>
+        /// 判断是否扣料工序,执行扣料,执行上料表记录
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iSourceCode"></param>
+        public static bool SetCollectionFinish(string iSnCode, string iMakeCode, string iUserName, string iSourceCode, out string oErrorMessage)
+        {
+            string StepCode = "";
+            string StepName = "";
+            string LineCode = "";
+            oErrorMessage = "";
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+            if (StepCode == "" && StepName == "")
+            {
+                oErrorMessage = "当前岗位资源找不到对应工序,请先进行维护";
+                return false;
+            }
+            sql.Clear();
+            sql.Append("select nvl(cd_ifreduce,0) cd_ifreduce  from craft left join ");
+            sql.Append("craftdetail on cd_crid=cr_id where cr_code=(select ma_craftcode  from makeserial left join make on ma_code = ms_makecode ");
+            sql.Append("where ms_sncode = '" + iSnCode + "') and cd_stepcode='" + StepCode + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            sql.Clear();
+            if (dt.Rows.Count > 0)
+            {
+                string cd_ifreduce = dt.Rows[0][0].ToString();
+                if (cd_ifreduce == "-1")
+                {
+                    sql.Clear();
+                    sql.Append("select dsl_location,dsl_table, max(dsl_baseqty) baseqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and ");
+                    sql.Append("dsl_linecode='" + LineCode + "' and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null group by dsl_location,dsl_table");
+                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        sql.Clear();
+                        sql.Append("selet dsl_id,dsl_remainqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and dsl_linecode='" + LineCode + "' ");
+                        sql.Append("and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null and rownum<3 order by dsl_id asc ");
+                        DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        for (int j = 0; j < dt.Rows.Count; j++)
+                        {
+                            //外层循环的值dt
+                            double baseqty = (double)dt.Rows[i]["baseqty"];
+                            double dsl_remainqty = (double)dt.Rows[i]["dsl_remainqty"];
+                            //内层循环的值dt1
+                            string dsl_id = dt1.Rows[j]["dsl_id"].ToString();
+                            if (baseqty > 0)
+                            {
+                                if (dsl_remainqty <= baseqty)
+                                {
+                                    sql.Clear();
+                                    sql.Append("update devsmtlocation set dsl_remainqty=0,dsl_invalidtime =sysdate, dsl_validtime =(case when dsl_validtime ");
+                                    sql.Append("is null then sysdate else  dsl_validtime),dsl_status=-1 where dsl_id=" + dsl_id);
+                                    dh.ExecuteSql(sql.ToString(), "update");
+                                    baseqty -= dsl_remainqty;
+                                }
+                                else
+                                {
+                                    sql.Clear();
+                                    sql.Append("update devsmtlocation set dsl_remainqty=dsl_remainqty-NVL(dsl_baseqty,0),dsl_efftime=(case when");
+                                    sql.Append("dsl_validtime is null then sysdate else dsl_validtime) where dsl_id=" + dsl_id);
+                                    dh.ExecuteSql(sql.ToString(), "update");
+                                    baseqty = 0;
+                                }
+                            }
+                            else
+                            {
+                                dh.ExecuteSql("update devsmtlocation set dsl_efftime=sysdate where dsl_id=" + dsl_id, "update");
+                            }
+                        }
+                    }
+                    sql.Clear();
+                    sql.Append("insert into ReduceStepRecord (rsd_id,rsd_macode,rsd_maprodcode,rsd_table,rsd_sncode,rsd_linecode,rsd_sourcecode) select ");
+                    sql.Append("ReduceStepRecord_SEQ.nextval,'" + iMakeCode + "',ma_prodcode,'','" + iSnCode + "','" + LineCode + "','" + iSourceCode + "' ");
+                    sql.Append("from make where ma_code='" + iMakeCode + "'");
+                    dh.ExecuteSql(sql.ToString(), "insert");
+                }
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 上料采集
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iBarcode"></param>
+        /// <param name="iSonCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iSonID"></param>
+        /// <param name="iType"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetMaterialUp(string iSnCode, string iMakeCode, string iBarcode, string iSonCode, string iSourceCode, string iUserName, string iSonID, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = "";
+            string StepName = "";
+            string iRemainQty = dh.getFieldDataByCondition("barcode", "bar_remain", "bar_code='" + iBarcode + "'").ToString();
+            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
+            DataTable dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial  where cm_sncode='" + iSnCode + "' and cm_barcode='" + iBarcode + "' and cm_soncode='" + iSonCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                oErrorMessage = "条码已经上料";
+                return false;
+            }
+            else
+            {
+                sql.Clear();
+                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
+                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid)");
+                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
+                sql.Append("mcd_stepname,ma_craftcode,ma_craftname,'" + iBarcode + "',1,sysdate,'" + iUserName + "',ma_linecode,ma_wccode,");
+                sql.Append("'" + iSourceCode + "','" + iSonID + "' from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
+                sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
+                sql.Append("where ma_code='" + iMakeCode + "'and sp_id=" + iSonID + " and mcd_stepcode = '" + StepCode + "' and ms_sncode='" + iSnCode + "'");
+                dh.ExecuteSql(sql.ToString(), "insert");
+                return true;
+            }
+        }
+
+        /// <summary>
+        /// 执行下料操作
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iBarCode"></param>
+        /// <param name="iCurrentStep"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetMaterialDown(string iSnCode, string iBarCode, string iCurrentStep, string iUserName, out string oErrorMessage)
+        {
+            //序列号不为空的时候
+            oErrorMessage = "";
+            DataTable dt;
+            //对序列号进行验证
+            dt = (DataTable)dh.ExecuteSql("select  ms_status,ms_stepcode,ms_nextstepcode  from  makeserial  where  ms_sncode='" + iBarCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string ms_status = dt.Rows[0]["ms_status"].ToString();
+                string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                if (ms_status == "1" && ms_stepcode != iCurrentStep)
+                {
+                    oErrorMessage = "当前工序不是" + iCurrentStep + "\n";
+                }
+                else if (ms_status == "0" && ms_stepcode != iCurrentStep)
+                {
+                    oErrorMessage = "当前工序不是" + iCurrentStep + "";
+                }
+                else if (ms_status == "2" && ms_nextstepcode != iCurrentStep)
+                {
+                    oErrorMessage = "该序列号已经包装";
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select * from craftmaterial where cm_sncode='" + iSnCode + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        oErrorMessage = "请采集需要下料的序列号";
+                    }
+                    else
+                    {
+                        oErrorMessage = "该序列号未上料,无需下料";
+                    }
+                }
+            }
+
+            if (oErrorMessage == "")
+            {
+                dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + iSnCode + "' and cm_barcode='" + iBarCode + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    string cm_id = dt.Rows[0]["cm_id"].ToString();
+                    string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
+                    string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
+                    string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
+                    dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
+                    InsertMakeProcess(ms_macode, iSnCode, "下料成功", iUserName);
+                    int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + iSnCode + "'");
+                    if (count == 0)
+                    {
+                        dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
+                    }
+                }
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 设置良品采集结果,iResult含有“批次”按抽检批次通过
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iResult"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iSourceCode, string iUserName, string iResult, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = "";
+            string StepName = "";
+            string LineCode = "";
+            if (iResult == "" || iResult == null)
+            {
+                iResult = "测试合格";
+            }
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+            //判断是否上料工序,如果是的话执行该步骤
+            DataTable dt = dh.getFieldsDataByCondition("make left join craft on cr_code=ma_craftcode left join craftdetail on cd_crid=cr_id", new string[] { "cd_ifinput", "cr_code" }, "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'");
+            string Yes_No = dh.GetConfig("BatchNumber", "MESSetting").ToString();
+            string cr_code = "";
+            if (dt.Rows.Count > 0)
+            {
+                cr_code = dt.Rows[0]["cr_code"].ToString();
+                if (dt.Rows[0]["cd_ifinput"].ToString() != "0")
+                {
+                    sql.Clear();
+                    sql.Append("select wm_concat(mss_prodcode) code,count(1) cn from (select sum(nvl(mss_remain,0))remain,mss_prodcode,max(mss_baseqty) mss_baseqty ");
+                    sql.Append("from makesourcestock where mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "' ");
+                    sql.Append("and mss_linecode='" + LineCode + "' group by mss_prodcode)T where T.remain<mss_baseqty and rownum<20");
+                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    //如果配置的是Yes
+                    if (Yes_No != "0")
+                    {
+                        //如果批次料不足
+                        if (dt.Rows.Count > 0 && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
+                        {
+                            oErrorMessage += "批次物料:" + iSnCode + "," + dt.Rows[0]["code"] + "岗位备料不足";
+                            return false;
+                        }
+                    }
+                    //如果配置的是No 或者批次料足够
+                    else if (Yes_No == "0" || dt.Rows.Count == 0)
+                    {
+                        //扣减批次数量,插入数据至用料表
+                        sql.Clear();
+                        sql.Append("select mss_prodcode , max(mss_baseqty) baseqty from makesourcestock ");
+                        sql.Append("mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "'  and mss_linecode='" + LineCode + "' group by mss_prodcode");
+                        DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        for (int i = 0; i < dt1.Rows.Count; i++)
+                        {
+                            string prodcode = dt1.Rows[i]["mss_prodcode"].ToString();
+                            //本次上料需要扣除的数量
+                            int baseqty = int.Parse(dt1.Rows[i]["baseqty"].ToString());
+                            sql.Clear();
+                            sql.Append("select mss_remain,mss_useqty,mss_id ,mss_barcode from makesourcestock where mss_makecode='" + iMakeCode + "' and ");
+                            sql.Append("mss_stepcode='" + StepCode + "' and mss_prodcode='" + prodcode + "'  and mss_linecode='" + LineCode + "'  and mss_remain >0 order by mss_id  asc");
+                            DataTable dt2 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                            for (int j = 0; i < dt2.Rows.Count; j++)
+                            {
+                                int remain = int.Parse(dt2.Rows[j]["mss_remain"].ToString());
+                                int useqty = int.Parse(dt2.Rows[j]["mss_useqty"].ToString());
+                                string mss_id = dt2.Rows[j]["mss_id"].ToString();
+                                string barcode = dt2.Rows[j]["mss_barcode"].ToString();
+                                //如果可扣数量大于0
+                                if (baseqty > 0)
+                                {
+                                    //并且可扣数量大于剩余数量
+                                    if (baseqty > remain)
+                                    {
+                                        sql.Clear();
+                                        sql.Append("update makesourcestock set mss_useqty=nvl(mss_useqty,0)+mss_remain,mss_remain = 0 where mss_id='" + mss_id + "' ");
+                                        dh.ExecuteSql(sql.ToString(), "update");
+                                        //扣减剩余数量
+                                        baseqty -= remain;
+                                    }
+                                    else if (remain >= baseqty)
+                                    {
+                                        dh.ExecuteSql("update makesourcestock set mss_remain = mss_remain-baseqty where mss_id =" + mss_id, "select");
+                                        baseqty = 0;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            //查询批次和批数量
+            int batchqty = 0;
+            string checkno = "";
+            dt = (DataTable)dh.ExecuteSql("select count(ms_checkno) count,ms_checkno from makeserial where ms_checkno=(select ms_checkno from makeserial where ms_sncode='" + iSnCode + "') group by ms_checkno", "select");
+            if (dt.Rows.Count > 0)
+            {
+                batchqty = int.Parse(dt.Rows[0]["count"].ToString());
+                checkno = dt.Rows[0]["ms_checkno"].ToString();
+            }
+            object nextstepcode = dh.getFieldDataByCondition("makecraftdetail", "mcd_nextstepcode", "mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
+            if (iResult.Contains("批次通过") && dt.Rows.Count > 0)
+            {
+                //更新执行的数量
+                sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+                //更新makeSerial 的下一工序
+                sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_checkno='" + checkno + "'");
+            }
+            else
+            {
+                //更新执行的数量
+                sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+                //更新makeSerial 的下一工序
+                sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
+            }
+            //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
+            dh.ExecuteSQLTran(sqls.ToArray());
+            sqls.Clear();
+            //记录操作日志
+            InsertMakeProcess(iSnCode, iMakeCode, iResult, iUserName);
+            //检测下道工序是否存在,不存在 更新状态为已完成
+            if (nextstepcode == null || nextstepcode.ToString() == "")
+            {
+                if (iResult.Contains("批次通过"))
+                {
+                    sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
+                    sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + checkno + "'");
+                }
+                else
+                {
+                    sqls.Add("update make set ma_madeqty=ma_madeqty+1  where ma_code='" + iMakeCode + "'");
+                    sqls.Add("update makeserial set ms_status=2 where ms_sncode='" + iSnCode + "'");
+                }
+                dh.ExecuteSQLTran(sqls.ToArray());
+                sqls.Clear();
+            }
+            else
+            {
+                CheckNextStepIfQC(iSnCode, iMakeCode, nextstepcode.ToString(), cr_code, iUserName, out oErrorMessage);
+            }
+            // 将数据插入craftmaterial表
+            SetCollectionFinish(iSnCode, iMakeCode, iUserName, iSourceCode, out oErrorMessage);
+            return true;
+        }
+
+        /// <summary>
+        /// 获取执行步骤代码,名称和线别
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        /// <param name="LineCode"></param>
+        private static void GetStepCodeAndNameAndLineBySource(string Source, ref string StepCode, ref string StepName, ref string LineCode)
+        {
+            DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+                LineCode = dt.Rows[0]["sc_linecode"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码和名称
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        private static void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
+        {
+            DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private static string GetStepCodeBySource(string Source)
+        {
+            return dh.getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
+        }
+    }
+}

BIN
MES接口/MES接口.dll


+ 36 - 0
MES接口/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("MES接口")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MES接口")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("a52efe9c-838e-4e8c-baaa-b1c226e57a81")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 26 - 0
MES接口/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace MES接口.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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;
+            }
+        }
+    }
+}

+ 5 - 0
MES接口/Properties/Settings.settings

@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles />
+  <Settings />
+</SettingsFile>

+ 89 - 0
MES接口/UAS-MES接口.csproj

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{A52EFE9C-838E-4E8C-BAAA-B1C226E57A81}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>MES接口</RootNamespace>
+    <AssemblyName>MES接口</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <UseVSHostingProcess>true</UseVSHostingProcess>
+    <DocumentationFile>
+    </DocumentationFile>
+    <RegisterForComInterop>false</RegisterForComInterop>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="NPOI">
+      <HintPath>..\UAS-出货标签管理\tool\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="Oracle.ManagedDataAccess">
+      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.OracleClient" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ftpOperater.cs" />
+    <Compile Include="LogicHandler.cs" />
+    <Compile Include="DataHelper.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <DependentUpon>Settings.settings</DependentUpon>
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="MES接口.dll" />
+    <Content Include="tool\Oracle.ManagedDataAccess.dll" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 6 - 0
MES接口/app.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+    </configSections>
+    <connectionStrings />
+</configuration>

+ 173 - 0
MES接口/ftpOperater.cs

@@ -0,0 +1,173 @@
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+using System.Windows.Forms;
+
+namespace MES接口
+{
+    public class ftpOperater
+    {
+        public static string FTPAddress = "";
+
+        public string DownLoadTo = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + "打印标签";
+
+        private string ftpServerIP;
+        private string ftpUser;
+        private string ftpPwd;
+
+
+        public ftpOperater()
+        {
+            string[] FTPInf = "".Split('#');
+            this.ftpServerIP = "ftp://richwellgroup.com.cn";
+            this.ftpUser = "mesconfig";
+            this.ftpPwd = "Administrator1@";
+        }
+
+        public void UpLoadFile(string filepath, string filename)
+        {
+            //上传之前判断文件是否存在
+            string[] filelist = GetFileList();
+            if (filelist != null)
+                for (int i = 0; i < filelist.Length; i++)
+                {
+                    if (filelist[i] == filename)
+                    {
+                        string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (upload.ToString() != "Yes")
+                        {
+                            return;
+                        }
+                    }
+                }
+            FtpWebRequest reqFTP;
+            reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + filename));
+            reqFTP.UseBinary = true;
+            reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
+            reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
+            FileInfo file = new FileInfo(filepath + "/" + filename);
+            const int BufferSize = 2048;
+            byte[] content = new byte[BufferSize - 1 + 1];
+            int dataRead;
+            using (FileStream fs = file.OpenRead())
+            {
+                //把上传的文件写入流
+                using (Stream rs = reqFTP.GetRequestStream())
+                {
+                    do
+                    {
+                        //每次读文件流的2KB
+                        dataRead = fs.Read(content, 0, BufferSize);
+                        rs.Write(content, 0, dataRead);
+                    } while (!(dataRead < BufferSize));
+                    rs.Close();
+                }
+                fs.Close();
+            }
+        }
+
+        /// <summary>
+        /// 获取ftp服务器上的文件信息
+        /// </summary>
+        /// <returns>存储了所有文件信息的字符串数组</returns>
+        public string[] GetFileList()
+        {
+            string[] downloadFiles;
+            StringBuilder result = new StringBuilder();
+            FtpWebRequest reqFTP;
+            try
+            {
+                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/"));
+                reqFTP.UseBinary = true;
+                reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
+                reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
+                WebResponse response = reqFTP.GetResponse();
+                StreamReader reader = new StreamReader(response.GetResponseStream());
+
+                string line = reader.ReadLine();
+                while (line != null)
+                {
+                    result.Append(line);
+                    result.Append("\n");
+                    line = reader.ReadLine();
+                }
+                result.Remove(result.ToString().LastIndexOf('\n'), 1);
+                reader.Close();
+                response.Close();
+
+                return result.ToString().Split('\n');
+            }
+            catch (Exception ex)
+            {
+                System.Windows.Forms.MessageBox.Show("获取文件信息失败:" + ex.Message, "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                downloadFiles = null;
+                return downloadFiles;
+            }
+        }
+
+        /// <summary>
+        /// 获取FTP上指定文件的大小
+        /// </summary>
+        /// <param name="filename">文件名</param>
+        /// <returns>文件大小</returns>
+        public long GetFileSize(string filename)
+        {
+            FtpWebRequest reqFTP;
+            long fileSize = 0;
+            try
+            {
+                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + filename));
+                reqFTP.Method = WebRequestMethods.Ftp.GetFileSize;
+                reqFTP.UseBinary = true;
+                reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
+                FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
+                Stream ftpStream = response.GetResponseStream();
+                fileSize = response.ContentLength;
+
+                ftpStream.Close();
+                response.Close();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("获取文件大小时,出现异常:\n" + ex.Message, "获取文件大小失败!", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+            return fileSize;
+        }
+
+        /// <summary>
+        /// 实现ftp下载操作
+        /// </summary>
+        /// <param name="fileName">远程文件名</param>
+        public string Download(string fileName)
+        {
+            FtpWebRequest reqFTP;
+            //filePath = <<The full path where the file is to be created.>>, 
+            //fileName = <<Name of the file to be created(Need not be the name of the file on FTP server).>>
+            FileStream outputStream = new FileStream(DownLoadTo + @"\" + fileName, FileMode.OpenOrCreate);
+            reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + fileName));
+            reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
+            reqFTP.UseBinary = true;
+            reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
+            FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
+            Stream ftpStream = response.GetResponseStream();
+            long cl = response.ContentLength;
+            int bufferSize = 2048;
+            int readCount;
+            byte[] buffer = new byte[bufferSize];
+
+            readCount = ftpStream.Read(buffer, 0, bufferSize);
+            Encoding encoding = Encoding.UTF8;
+            Console.WriteLine(encoding.GetString(buffer));
+            while (readCount > 0)
+            {
+                outputStream.Write(buffer, 0, readCount);
+                readCount = ftpStream.Read(buffer, 0, bufferSize);
+            }
+            ftpStream.Close();
+            outputStream.Close();
+            response.Close();
+            return DownLoadTo + @"\" + fileName;
+        }
+    }
+}

BIN
MES接口/tool/Oracle.ManagedDataAccess.dll


+ 18 - 0
NotePad/App.config

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+            <section name="NotePad.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
+        </sectionGroup>
+    </configSections>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
+    </startup>
+    <userSettings>
+        <NotePad.Properties.Settings>
+            <setting name="LastFontColor" serializeAs="String">
+                <value/>
+            </setting>
+        </NotePad.Properties.Settings>
+    </userSettings>
+</configuration>

+ 40 - 0
NotePad/CustomerControls/AutoButtomRichTextBox.Designer.cs

@@ -0,0 +1,40 @@
+namespace NotePad.CustomerControls
+{
+    partial class AutoButtomRichTextBox
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // AutoButtomRichTextBox
+            // 
+            this.ResumeLayout(false);
+        }
+
+        #endregion
+    }
+}

+ 30 - 0
NotePad/CustomerControls/AutoButtomRichTextBox.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace NotePad.CustomerControls
+{
+    public partial class AutoButtomRichTextBox : RichTextBox
+    {
+        public AutoButtomRichTextBox()
+        {
+            InitializeComponent();
+        }
+
+        protected override CreateParams CreateParams
+        {
+            get
+            {
+                CreateParams cp = base.CreateParams;
+                cp.ExStyle |= 0x20;
+                return cp;
+            }
+        }
+    }
+}

+ 123 - 0
NotePad/CustomerControls/AutoButtomRichTextBox.resx

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

+ 36 - 0
NotePad/CustomerControls/RoundPanel.Designer.cs

@@ -0,0 +1,36 @@
+namespace NotePad.CustomerControls
+{
+    partial class RoundPanel
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 163 - 0
NotePad/CustomerControls/RoundPanel.cs

@@ -0,0 +1,163 @@
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+using System.Drawing.Drawing2D;
+
+namespace NotePad.CustomerControls
+{
+    public partial class RoundPanel : Panel
+    {
+        private Color _borderColor = Color.FromArgb(23, 169, 254);
+        private int _radius = 10;
+        private RoundStyle _roundeStyle;
+        private const int WM_PAINT = 0xF;
+
+        public RoundPanel()
+        {
+            InitializeComponent();
+        }
+        public enum RoundStyle
+        {
+            /// <summary>
+            /// 四个角都不是圆角。
+            /// </summary>
+            None = 0,
+            /// <summary>
+            /// 四个角都为圆角。
+            /// </summary>
+            All = 1,
+            /// <summary>
+            /// 左边两个角为圆角。
+            /// </summary>
+            Left = 2,
+            /// <summary>
+            /// 右边两个角为圆角。
+            /// </summary>
+            Right = 3,
+            /// <summary>
+            /// 上边两个角为圆角。
+            /// </summary>
+            Top = 4,
+            /// <summary>
+            /// 下边两个角为圆角。
+            /// </summary>
+            Bottom = 5,
+        }
+        /// <summary>
+        /// 建立带有圆角样式的路径。
+        /// </summary>
+        /// <param name="rect">用来建立路径的矩形。</param>
+        /// <param name="_radius">圆角的大小。</param>
+        /// <param name="style">圆角的样式。</param>
+        /// <param name="correction">是否把矩形长宽减 1,以便画出边框。</param>
+        /// <returns>建立的路径。</returns>
+        GraphicsPath CreatePath(Rectangle rect, int radius, RoundStyle style, bool correction)
+        {
+            GraphicsPath path = new GraphicsPath();
+            int radiusCorrection = correction ? 1 : 0;
+            switch (style)
+            {
+                case RoundStyle.None:
+                    path.AddRectangle(rect);
+                    break;
+                case RoundStyle.All:
+                    path.AddArc(rect.X, rect.Y, radius, radius, 180, 90);
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Y, radius, radius, 270, 90);
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Bottom - radius - radiusCorrection, radius, radius, 0, 90);
+                    path.AddArc(rect.X, rect.Bottom - radius - radiusCorrection, radius, radius, 90, 90);
+                    break;
+                case RoundStyle.Left:
+                    path.AddArc(rect.X, rect.Y, radius, radius, 180, 90);
+                    path.AddLine(rect.Right - radiusCorrection, rect.Y, rect.Right - radiusCorrection, rect.Bottom - radiusCorrection);
+                    path.AddArc(rect.X, rect.Bottom - radius - radiusCorrection, radius, radius, 90, 90);
+                    break;
+                case RoundStyle.Right:
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Y, radius, radius, 270, 90);
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Bottom - radius - radiusCorrection, radius, radius, 0, 90);
+                    path.AddLine(rect.X, rect.Bottom - radiusCorrection, rect.X, rect.Y);
+                    break;
+                case RoundStyle.Top:
+                    path.AddArc(rect.X, rect.Y, radius, radius, 180, 90);
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Y, radius, radius, 270, 90);
+                    path.AddLine(rect.Right - radiusCorrection, rect.Bottom - radiusCorrection, rect.X, rect.Bottom - radiusCorrection);
+                    break;
+                case RoundStyle.Bottom:
+                    path.AddArc(rect.Right - radius - radiusCorrection, rect.Bottom - radius - radiusCorrection, radius, radius, 0, 90);
+                    path.AddArc(rect.X, rect.Bottom - radius - radiusCorrection, radius, radius, 90, 90);
+                    path.AddLine(rect.X, rect.Y, rect.Right - radiusCorrection, rect.Y);
+                    break;
+            }
+            path.CloseFigure(); //这句很关键,缺少会没有左边线。
+            return path;
+        }
+
+        [DefaultValue(typeof(Color), "23, 169, 254"), Description("控件边框颜色")]
+        public Color BorderColor
+        {
+            get { return _borderColor; }
+            set
+            {
+                _borderColor = value;
+                base.Invalidate();
+            }
+        }
+
+        [DefaultValue(typeof(int), "10"), Description("圆角弧度大小")]
+        public int Radius
+        {
+            get { return _radius; }
+            set
+            {
+                _radius = value;
+                base.Invalidate();
+            }
+        }
+        public RoundStyle RoundeStyle
+        {
+            get { return _roundeStyle; }
+            set
+            {
+                _roundeStyle = value;
+                base.Invalidate();
+            }
+        }
+        protected override void WndProc(ref Message m)
+        {
+            try
+            {
+                base.WndProc(ref m);
+                if (m.Msg == WM_PAINT)
+                {
+                    if (this.Radius > 0)
+                    {
+                        using (Graphics g = Graphics.FromHwnd(this.Handle))
+                        {
+                            Rectangle r = new Rectangle();
+                            r.Width = this.Width;
+                            r.Height = this.Height;
+                            DrawBorder(g, r, this.RoundeStyle, this.Radius);
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        private void DrawBorder(Graphics g, Rectangle rect, RoundStyle roundStyle, int radius)
+        {
+            rect.Width -= 1;
+            rect.Height -= 1;
+            using (GraphicsPath path = CreatePath(rect, radius, roundStyle, false))
+            {
+                using (Pen pen = new Pen(this.BorderColor))
+                {
+                    g.DrawPath(pen, path);
+                }
+            }
+        }
+    }
+}

+ 65 - 0
NotePad/Helper/AssemblyHelper.cs

@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace NotePad.Helper
+{
+    public class AssemblyHelper
+    {
+        #region 常量
+        /// <summary>
+        /// 程序集的名称
+        /// </summary>
+        private static string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;
+        #endregion
+
+        #region 变量
+        /// <summary>
+        /// 当前程序集
+        /// </summary>
+        private static Assembly CurrentAssembly = Assembly.GetExecutingAssembly();
+
+        #endregion
+
+        #region 方法
+        /// <summary>
+        /// 在嵌入的资源文件中查找相应的图片
+        /// </summary>
+        /// <param name="name">资源图片的文件名称+扩展名</param>
+        /// <returns></returns>
+        public static Image GetImage(string name)
+        {
+            Image image = null;
+            try
+            {
+                if (!string.IsNullOrEmpty(name))
+                {
+                    StringBuilder sb = new StringBuilder();
+                    if (name[0] != '.')
+                        sb.Append(AssemblyHelper.CurrentAssemblyName + "." + name);
+                    else
+                        sb.Append(AssemblyHelper.CurrentAssemblyName + name);
+                    using (Stream stream = CurrentAssembly.GetManifestResourceStream(sb.ToString()))
+                    {
+                        if (stream == null)
+                            throw new Exception("加载资源文件失败,失败原因:可能丢失" + CurrentAssemblyName + ".dll文件。");
+                        else
+                            image = Image.FromStream(stream);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return image;
+        }
+
+        #endregion
+    }
+}

+ 21 - 0
NotePad/Helper/WriteNote.cs

@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+
+namespace NotePad.Helper
+{
+    class WriteNote
+    {
+        public static void Write(string Note, string NoteData)
+        {
+            if (NoteData == "")
+            {
+            
+                FileStream fs = new FileStream(NotePadForm.Folder + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+                fs.Close();
+                File.WriteAllText(NotePadForm.Folder + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", Note);
+            }
+            else
+                File.WriteAllText(NotePadForm.Folder + NoteData + ".txt", Note);
+        }
+    }
+}

BIN
NotePad/MP3/人武训练的日子.mp3


+ 216 - 0
NotePad/NotePad.Designer.cs

@@ -0,0 +1,216 @@
+namespace NotePad
+{
+    partial class NotePadForm
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotePadForm));
+            this.BackImageTimer = new System.Windows.Forms.Timer(this.components);
+            this.Save = new CCWin.SkinControl.SkinButton();
+            this.NoteList = new CCWin.SkinControl.SkinListBox();
+            this.LastWriteTime = new CCWin.SkinControl.SkinLabel();
+            this.NoteTimerPicker = new System.Windows.Forms.DateTimePicker();
+            this.MusicPlayer = new AxWMPLib.AxWindowsMediaPlayer();
+            this.FontPanel = new NotePad.CustomerControls.RoundPanel();
+            this.skinLabel1 = new CCWin.SkinControl.SkinLabel();
+            this.ColorPicker = new CCWin.SkinControl.SkinPictureBox();
+            this.FontPicker = new CCWin.SkinControl.SkinPictureBox();
+            this.NotePadTextArea = new NotePad.CustomerControls.AutoButtomRichTextBox();
+            ((System.ComponentModel.ISupportInitialize)(this.MusicPlayer)).BeginInit();
+            this.FontPanel.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ColorPicker)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.FontPicker)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // Save
+            // 
+            this.Save.BackColor = System.Drawing.Color.Transparent;
+            this.Save.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
+            this.Save.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.Save.DownBack = null;
+            this.Save.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Save.Location = new System.Drawing.Point(486, 510);
+            this.Save.MouseBack = null;
+            this.Save.Name = "Save";
+            this.Save.NormlBack = null;
+            this.Save.Size = new System.Drawing.Size(75, 35);
+            this.Save.TabIndex = 1;
+            this.Save.Text = "保存";
+            this.Save.UseVisualStyleBackColor = false;
+            this.Save.Click += new System.EventHandler(this.Save_Click);
+            // 
+            // NoteList
+            // 
+            this.NoteList.Back = null;
+            this.NoteList.BackColor = System.Drawing.Color.Transparent;
+            this.NoteList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.NoteList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.NoteList.FormattingEnabled = true;
+            this.NoteList.ItemHeight = 30;
+            this.NoteList.Location = new System.Drawing.Point(32, 107);
+            this.NoteList.MouseColor = System.Drawing.Color.DeepSkyBlue;
+            this.NoteList.Name = "NoteList";
+            this.NoteList.RowBackColor2 = System.Drawing.Color.SkyBlue;
+            this.NoteList.Size = new System.Drawing.Size(183, 394);
+            this.NoteList.TabIndex = 3;
+            this.NoteList.SelectedIndexChanged += new System.EventHandler(this.NoteList_SelectedIndexChanged);
+            // 
+            // LastWriteTime
+            // 
+            this.LastWriteTime.AutoSize = true;
+            this.LastWriteTime.BackColor = System.Drawing.Color.Transparent;
+            this.LastWriteTime.BorderColor = System.Drawing.Color.White;
+            this.LastWriteTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.LastWriteTime.Location = new System.Drawing.Point(255, 75);
+            this.LastWriteTime.Name = "LastWriteTime";
+            this.LastWriteTime.Size = new System.Drawing.Size(0, 20);
+            this.LastWriteTime.TabIndex = 4;
+            // 
+            // NoteTimerPicker
+            // 
+            this.NoteTimerPicker.CustomFormat = "yyyy-MM-dd";
+            this.NoteTimerPicker.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
+            this.NoteTimerPicker.Location = new System.Drawing.Point(32, 71);
+            this.NoteTimerPicker.Name = "NoteTimerPicker";
+            this.NoteTimerPicker.Size = new System.Drawing.Size(183, 25);
+            this.NoteTimerPicker.TabIndex = 6;
+            this.NoteTimerPicker.ValueChanged += new System.EventHandler(this.NoteTimerPicker_ValueChanged);
+            // 
+            // MusicPlayer
+            // 
+            this.MusicPlayer.Enabled = true;
+            this.MusicPlayer.Location = new System.Drawing.Point(383, 50);
+            this.MusicPlayer.Name = "MusicPlayer";
+            this.MusicPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("MusicPlayer.OcxState")));
+            this.MusicPlayer.Size = new System.Drawing.Size(222, 45);
+            this.MusicPlayer.TabIndex = 7;
+            // 
+            // FontPanel
+            // 
+            this.FontPanel.BackColor = System.Drawing.Color.Transparent;
+            this.FontPanel.BorderColor = System.Drawing.Color.CornflowerBlue;
+            this.FontPanel.Controls.Add(this.skinLabel1);
+            this.FontPanel.Controls.Add(this.ColorPicker);
+            this.FontPanel.Controls.Add(this.FontPicker);
+            this.FontPanel.Location = new System.Drawing.Point(611, 50);
+            this.FontPanel.Name = "FontPanel";
+            this.FontPanel.RoundeStyle = NotePad.CustomerControls.RoundPanel.RoundStyle.All;
+            this.FontPanel.Size = new System.Drawing.Size(180, 45);
+            this.FontPanel.TabIndex = 2;
+            // 
+            // skinLabel1
+            // 
+            this.skinLabel1.AutoSize = true;
+            this.skinLabel1.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel1.BorderColor = System.Drawing.Color.White;
+            this.skinLabel1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel1.Location = new System.Drawing.Point(6, 12);
+            this.skinLabel1.Name = "skinLabel1";
+            this.skinLabel1.Size = new System.Drawing.Size(88, 25);
+            this.skinLabel1.TabIndex = 7;
+            this.skinLabel1.Text = "字体设置";
+            // 
+            // ColorPicker
+            // 
+            this.ColorPicker.BackColor = System.Drawing.Color.Transparent;
+            this.ColorPicker.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.ColorPicker.Image = global::NotePad.Properties.Resources.colorpicker;
+            this.ColorPicker.Location = new System.Drawing.Point(138, 7);
+            this.ColorPicker.Name = "ColorPicker";
+            this.ColorPicker.Size = new System.Drawing.Size(33, 31);
+            this.ColorPicker.TabIndex = 5;
+            this.ColorPicker.TabStop = false;
+            this.ColorPicker.Click += new System.EventHandler(this.ColorPicker_Click);
+            // 
+            // FontPicker
+            // 
+            this.FontPicker.BackColor = System.Drawing.Color.Transparent;
+            this.FontPicker.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.FontPicker.Image = global::NotePad.Properties.Resources.fontpicker;
+            this.FontPicker.Location = new System.Drawing.Point(94, 7);
+            this.FontPicker.Name = "FontPicker";
+            this.FontPicker.Size = new System.Drawing.Size(33, 31);
+            this.FontPicker.TabIndex = 6;
+            this.FontPicker.TabStop = false;
+            this.FontPicker.Click += new System.EventHandler(this.FontPicker_Click);
+            // 
+            // NotePadTextArea
+            // 
+            this.NotePadTextArea.AcceptsTab = true;
+            this.NotePadTextArea.BackColor = System.Drawing.SystemColors.MenuHighlight;
+            this.NotePadTextArea.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.NotePadTextArea.Location = new System.Drawing.Point(250, 107);
+            this.NotePadTextArea.Name = "NotePadTextArea";
+            this.NotePadTextArea.Size = new System.Drawing.Size(539, 394);
+            this.NotePadTextArea.TabIndex = 0;
+            this.NotePadTextArea.Text = "";
+            // 
+            // NotePadForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.White;
+            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.ClientSize = new System.Drawing.Size(838, 554);
+            this.Controls.Add(this.MusicPlayer);
+            this.Controls.Add(this.NoteTimerPicker);
+            this.Controls.Add(this.LastWriteTime);
+            this.Controls.Add(this.NoteList);
+            this.Controls.Add(this.FontPanel);
+            this.Controls.Add(this.Save);
+            this.Controls.Add(this.NotePadTextArea);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.MaximizeBox = false;
+            this.Name = "NotePadForm";
+            this.Text = "NCHU-NotePad";
+            this.Load += new System.EventHandler(this.NotePad_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.MusicPlayer)).EndInit();
+            this.FontPanel.ResumeLayout(false);
+            this.FontPanel.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ColorPicker)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.FontPicker)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Timer BackImageTimer;
+        private CustomerControls.AutoButtomRichTextBox NotePadTextArea;
+        private CCWin.SkinControl.SkinButton Save;
+        private CustomerControls.RoundPanel FontPanel;
+        private CCWin.SkinControl.SkinLabel skinLabel1;
+        private CCWin.SkinControl.SkinPictureBox ColorPicker;
+        private CCWin.SkinControl.SkinPictureBox FontPicker;
+        private CCWin.SkinControl.SkinListBox NoteList;
+        private CCWin.SkinControl.SkinLabel LastWriteTime;
+        private System.Windows.Forms.DateTimePicker NoteTimerPicker;
+        private AxWMPLib.AxWindowsMediaPlayer MusicPlayer;
+    }
+}

+ 169 - 0
NotePad/NotePad.cs

@@ -0,0 +1,169 @@
+using System;
+using CCWin;
+using System.Drawing;
+using NotePad.Properties;
+using System.Windows.Forms;
+using System.Drawing.Imaging;
+using NotePad.Helper;
+using System.IO;
+using CCWin.SkinControl;
+using CCWin.SkinClass;
+
+namespace NotePad
+{
+    public partial class NotePadForm : CCSkinMain
+    {
+        //图片的张数
+        static int ImageCount = 15;
+        //存放图片对象
+        object[] BackImage = new object[ImageCount];
+        //当前展示的图片的索引
+        int ImageIndex = 0;
+        //保存的子文件夹
+        public static string Folder = @"Note\";
+
+        public NotePadForm()
+        {
+            InitializeComponent();
+            this.StartPosition = FormStartPosition.CenterScreen;
+            NotePadTextArea.Font = (Font)Settings.Default["LastFont"];
+            NotePadTextArea.ForeColor = (Color)Settings.Default["LastFontColor"];
+        }
+
+        private void NotePad_Load(object sender, EventArgs e)
+        {
+            BackImage[0] = Resources.psb;
+            BackImage[1] = Resources.psb__5_;
+            BackImage[2] = Resources.psb__1_;
+            BackImage[3] = Resources.psb__3_;
+            BackImage[4] = Resources._3_校园;
+            BackImage[5] = Resources.IMG_2478;
+            BackImage[6] = Resources.IMG_2576;
+            BackImage[7] = Resources.IMG_3056;
+            BackImage[8] = Resources.IMG_2439;
+            BackImage[9] = Resources.image4;
+            BackImage[10] = Resources.image1;
+            BackImage[11] = Resources.image2;
+            BackImage[12] = Resources._2_校园;
+            BackImage[13] = Resources._1_考试作业校园;
+            BackImage[14] = Resources.psb__4_;
+            GetNoteList();
+            //初始化背景图片
+            BackgroundImage = TransparentImage((Bitmap)BackImage[ImageIndex], (float)0.2);
+            ImageIndex = ImageIndex + 1;
+            //计时器刷新图片
+            BackImageTimer.Interval = 5 * 1000;
+            BackImageTimer.Tick += ChangeBackGroundImage;
+            BackImageTimer.Start();
+            //播放音乐
+            MusicPlayer.URL = Application.StartupPath + @"\人武训练的日子.mp3";
+            MusicPlayer.Ctlcontrols.play();
+
+        }
+
+        /// <summary>
+        /// 切换背景图片
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ChangeBackGroundImage(object sender, EventArgs e)
+        {
+            Bitmap bitmap = (Bitmap)BackImage[ImageIndex];
+            BackgroundImage = TransparentImage(bitmap, (float)0.2);
+            ImageIndex = ImageIndex + 1;
+            if (ImageIndex == ImageCount )
+                ImageIndex = 0;
+        }
+
+        /// <summary>
+        /// 实现图片渐变
+        /// </summary>
+        /// <param name="srcImage"></param>
+        /// <param name="opacity"></param>
+        /// <returns></returns>
+        private Image TransparentImage(Image srcImage, float opacity)
+        {
+            float[][] nArray ={ new float[] {1, 0, 0, 0, 0},
+                        new float[] {0, 1, 0, 0, 0},
+                        new float[] {0, 0, 1, 0, 0},
+                        new float[] {0, 0, 0, opacity, 0},
+                        new float[] {0, 0, 0, 0, 1}};
+            ColorMatrix matrix = new ColorMatrix(nArray);
+            ImageAttributes attributes = new ImageAttributes();
+            attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
+            Bitmap resultImage = new Bitmap(srcImage.Width, srcImage.Height);
+            Graphics g = Graphics.FromImage(resultImage);
+            g.DrawImage(srcImage, new Rectangle(0, 0, srcImage.Width, srcImage.Height), 0, 0, srcImage.Width, srcImage.Height, GraphicsUnit.Pixel, attributes);
+            return resultImage;
+        }
+
+        private void ColorPicker_Click(object sender, EventArgs e)
+        {
+            ColorDialog ColorForm = new ColorDialog();
+            if (ColorForm.ShowDialog() == DialogResult.OK)
+            {
+                NotePadTextArea.SelectionColor = ColorForm.Color;
+                Settings.Default["LastFontColor"] = ColorForm.Color;
+                Settings.Default.Save();
+            }
+        }
+
+        private void FontPicker_Click(object sender, EventArgs e)
+        {
+            FontDialog Font = new FontDialog();
+            if (Font.ShowDialog() == DialogResult.OK)
+            {
+                NotePadTextArea.Font = Font.Font;
+                Settings.Default["LastFont"] = Font.Font;
+                Settings.Default.Save();
+            }
+        }
+
+        private void Save_Click(object sender, EventArgs e)
+        {
+            WriteNote.Write(NotePadTextArea.Rtf, NoteList.SelectedIndex >= 0 ? NoteList.Items[NoteList.SelectedIndex].Text : "");
+            GetNoteList();
+        }
+
+        private void NoteList_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            NotePadTextArea.Clear();
+            string FileName = Folder + NoteList.Items[NoteList.SelectedIndex].Text + ".txt";
+            NotePadTextArea.Rtf = File.ReadAllText(FileName);
+            LastWriteTime.Text = File.GetLastWriteTime(FileName).ToString();
+        }
+
+        private void GetNoteList()
+        {
+            NoteList.Items.Clear();
+            //读取记录文件
+            DirectoryInfo theFolder = new DirectoryInfo(Folder);
+            foreach (FileInfo NextFile in theFolder.GetFiles())
+            {
+                SkinListBoxItem item = new SkinListBoxItem(NextFile.Name.Remove(NextFile.Name.Length - 4));
+                this.NoteList.Items.Add(item);
+            }
+        }
+
+        private void GetNoteList(string NoteDate)
+        {
+            NoteList.Items.Clear();
+            //读取记录文件
+            DirectoryInfo theFolder = new DirectoryInfo(Folder);
+            foreach (FileInfo NextFile in theFolder.GetFiles())
+            {
+                if (NextFile.Name.Contains(NoteDate))
+                {
+                    SkinListBoxItem item = new SkinListBoxItem(NextFile.Name.Remove(NextFile.Name.Length - 4));
+                    this.NoteList.Items.Add(item);
+                }
+            }
+        }
+
+        private void NoteTimerPicker_ValueChanged(object sender, EventArgs e)
+        {
+            NoteTimerPicker.Format = DateTimePickerFormat.Custom;
+            GetNoteList(NoteTimerPicker.Text.ToString("yyyy-MM-dd"));
+        }
+    }
+}

+ 180 - 0
NotePad/NotePad.csproj

@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E61A90F6-40F8-4B3A-9A2F-BEC44B87E5D7}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>NotePad</RootNamespace>
+    <AssemblyName>NotePad</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <TargetFrameworkProfile />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CSkin">
+      <HintPath>Tool\CSkin.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="CustomerControls\AutoButtomRichTextBox.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="CustomerControls\AutoButtomRichTextBox.Designer.cs">
+      <DependentUpon>AutoButtomRichTextBox.cs</DependentUpon>
+    </Compile>
+    <Compile Include="CustomerControls\RoundPanel.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="CustomerControls\RoundPanel.Designer.cs">
+      <DependentUpon>RoundPanel.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Helper\AssemblyHelper.cs" />
+    <Compile Include="Helper\WriteNote.cs" />
+    <Compile Include="NotePad.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="NotePad.Designer.cs">
+      <DependentUpon>NotePad.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="CustomerControls\AutoButtomRichTextBox.resx">
+      <DependentUpon>AutoButtomRichTextBox.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="NotePad.resx">
+      <DependentUpon>NotePad.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <DependentUpon>Resources.resx</DependentUpon>
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Tool\" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="MP3\人武训练的日子.mp3" />
+    <Content Include="Pic\1.考试作业校园.jpg" />
+    <Content Include="Pic\2.校园.jpg" />
+    <Content Include="Pic\3.校园 .JPG" />
+    <Content Include="Pic\colorpicker.png" />
+    <Content Include="Pic\icon.ico" />
+    <Content Include="Pic\image1.jpg" />
+    <Content Include="Pic\image2.jpg" />
+    <Content Include="Pic\image3.jpg" />
+    <Content Include="Pic\image4.jpg" />
+    <Content Include="Pic\image5.jpg" />
+    <Content Include="Pic\image6.jpg" />
+    <Content Include="Pic\image7.jpg" />
+    <Content Include="Pic\IMG_1558.JPG" />
+    <Content Include="Pic\IMG_2439.JPG" />
+    <Content Include="Pic\IMG_2478.JPG" />
+    <Content Include="Pic\IMG_2576.JPG" />
+    <Content Include="Pic\IMG_2982.JPG" />
+    <Content Include="Pic\IMG_3005.JPG" />
+    <Content Include="Pic\IMG_3056.JPG" />
+    <Content Include="Pic\IMG_3062.JPG" />
+    <None Include="Pic\psb.jpg" />
+    <None Include="Pic\psb %285%29.jpg" />
+    <None Include="Pic\psb %284%29.jpg" />
+    <None Include="Pic\psb %283%29.jpg" />
+    <None Include="Pic\psb %281%29.jpg" />
+    <None Include="Resources\image6.jpg" />
+    <None Include="Resources\image7.jpg" />
+    <None Include="Resources\font_color_32px_1187333_easyicon.net.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <COMReference Include="AxWMPLib">
+      <Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
+      <VersionMajor>1</VersionMajor>
+      <VersionMinor>0</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>aximp</WrapperTool>
+      <Isolated>False</Isolated>
+    </COMReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 422 - 0
NotePad/NotePad.resx

@@ -0,0 +1,422 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="BackImageTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <data name="MusicPlayer.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
+        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
+        ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAtwAAAAIB
+        AAAAAQAAAAAAAAAAAAAAAKIAAAAAAwAACAAAAAAABQAAAAAAAADwPwMAAAAAAAUAAAAAAAAAAAAIAAIA
+        AAAAAAMAAQAAAAsA//8DAAAAAAALAP//CAACAAAAAAADADIAAAALAAAACAAKAAAAZgB1AGwAbAAAAAsA
+        AAALAAAACwD//wsA//8LAAAACAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAALAAAANAYAAOcB
+        AAAL
+</value>
+  </data>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAA
+        AAD4+Pj/7e3t/+zs7P/u7u7/7u7u//X19f/t7e3/7e3t/+7u7v/r6+v/7Ozs/+/v7//t7e3/7e3t//v7
+        +//8/Pz/9vb2//v7+//5+fn/+fn5//r6+v/4+Pj/+Pj4//r6+v/v7ur/0Mu//7Wsmv+fk3z/jYBl/4Bx
+        U/93Z0f/c2JB/3NiQf94Z0f/gHFT/42AZf+ek3z/taya/9DKv//v7ur//v7+////////////////////
+        ///////////////////////////////////////////////////39/f/5ubm/+Hh4f/f39//5eXl/+Tk
+        5P/j4+P/5OTk/+Dg4P/09PT/9vb2/+vr6//s7Oz/7Ozs/+rq6v/6+vr/9vb2//f39//4+Pj/9PT0//X1
+        9f/5+fn/+Pj4//j4+P/9/f3//f39//v7+//8/Pz/+/v7//v7+//6+vr/29jP/62kkf+OgWf/cWA//3Bf
+        Pv93Z0f/jYBl/6CVfv+tpJH/t6+e/7uzo/+7s6P/t6+e/62kkf+glX7/jYBl/3dnR/9xYD//cWA//4Z4
+        XP+vppP/3tvT//7+/f//////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        //////////////////////////////////////////////////////////////X08v++t6f/hXda/3Fg
+        P/94aEn/n5R+/8a/sv/n5d///f39////////////////////////////////////////////////////
+        ///9/fz/5+Xf/8bAsv+flH7/eGhJ/3FgP/+Fd1r/vran//X08v//////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////9fTy/7Ss
+        mv94aEn/cmFA/5qOdv/Ry8D/+vr4////////////////////////////////////////////////////
+        //////////////////////////////////////////////r6+P/Ry8D/mo52/3JhQP94aEn/tKya//X0
+        8v//////////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ///9/f3/xL6v/3tsTf9zY0L/qJ6J/+nn4v/+/v7/////////////////////////////////////////
+        ///9/f3/+/v6///////39/X/9vb0//7+/v/+/v7///////////////////////////////////////7+
+        /v/q5+L/qJ6J/3NjQv97bE3/xL2v//39/f//////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ///////////////////p5+L/kYRq/3BfPv+ckXn/6efi//////////////////////////////////r6
+        +f/+/v7/6efh/8bBtP/+/v7/ta6d/6adiP/+/v7/squZ/7u0pP/o5uH/vLam/8/Kv//+/v7/5+Tf//Lw
+        7f/////////////////////////////////p5+L/nJF5/3FgP/+RhGr/6ufi////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        //////////////////////////////7+/v/Lxbn/d2dH/35vUf/SzcL//v7+////////////////////
+        ///9/f3//v7+/9fTyv+ooIv//v7+/7qzo/+elX///v7+/7mzo//Oyr7//v7+/6+olf/Dva//0MvB/+jm
+        4f++uKn/8vHu/7KqmP+qoo//+vr5/8fBtP/t7Of///////////////////////7+/v/SzcL/fm9R/3dn
+        R//Lxbn//v7+////////////////////////////////////////////////////////////////////
+        //////////////////////////////////////////////38/P+vppP/cWA//5qOdv/z8u//////////
+        ///////////////////e29P/3drS/97b1P/d2tL/oZiC//7+/v+1rp3/4t/Z//r5+P/p5+L/5+Xf////
+        ///z8u//8/Lv//z8+//Qy8D/9vb0/+Dd1f/GwbT/zci8/8fCtf/c2dH/ubOi////////////////////
+        //////////////Py7/+ajnb/cWA//6+mk//9/Pz/////////////////////////////////////////
+        //////////////////////////////////////////////////////////////r6+f+ek3z/cWA//7au
+        nP/9/f3//////////////////f39//7+/v//////4t/Y/66nlf+5s6P//v7+/9vXz///////////////
+        /////////////////////////////////////////////////////////v7+//v7+v/d2tP/xsCz//v7
+        +v///////v7+/87Jvv/m5N7//////////////////f39/7aunP9xYD//npN9//r6+f//////////////
+        //////////////////////////////////////////////////////////////////////////////r6
+        +f+ajXb/cmJB/8jCtf/+/v7/////////////////9PPw/7y2p//Py8D///////7+/v/V0cj/9/b0////
+        ////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////9nWzv/X08r/xsG0//7+/f/9/Pz////////////+/v7/yMK1/3Ji
+        Qf+ajnb/+vr5////////////////////////////////////////////////////////////////////
+        //////////////39/P+ek3z/c2JB/87Ivf/////////////////+/v7/7uzo/+ro4//Bu63/0s7D////
+        ///////////////////////////////////+/v7/9vb2/+bm5f/S0Mr/w8G3/7y4rf+7t6z/wb60/87M
+        xf/h4d7/8vPz//7+/v/////////////////////////////////p5+L/08/F//Px7//Lx7v/5eLc//Tz
+        8P/////////////////NyLz/cmJB/5+Tff/9/Pz/////////////////////////////////////////
+        //////////////////////////////7+/v+vppP/cWA//8jCtf/+/v7////////////+/v7/5ePd/52U
+        ff/u7en/1dHH/9vXz////////////////////////v7+/+zt7P/AvbP/lY56/3pvVP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bF8//3ZqTf+MhW//tbGl/+Pk4f/8/f3///////////////////////7+
+        /v/o5uH/pJuG/56Vf//08/D//Pv7/////////////////8jCtf9xYD//r6aT//7+/v//////////////
+        ///////////////////////////////////////////////////Lxbn/cWA//7aunP/+/v7/////////
+        ///6+vn/6unk/9LOw/+wqZb/2tfO///////////////////////9/f3/3d3a/52Xhf9zZ0r/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9vYkP/j4hz/8/O
+        x//6+/v//////////////////v7+//Lx7f/i4Nn/4d/Y/8vGuv/////////////////+/v7/tq6c/3Fg
+        P//Lxbn////////////////////////////////////////////////////////////q5+L/d2dI/5qO
+        dv/9/f3////////////5+Pf/3NjQ/6ujkP/+/v7/29jQ//////////////////7+/v/q6uj/nZeG/29j
+        RP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/jYVw/9ra1v/+/v7//////////////////Pz7/8bBtP/+/v7/2dbN/+/u
+        6v////////////39/f+ajnb/d2dI/+rn4v//////////////////////////////////////////////
+        ///9/f3/kYRq/35vUf/z8u/////////////7+/r/+vr5/9PPxf+qoo7/7ezn//////////////////z8
+        /P/Fwrr/d2xQ/21gQP9tYED/bWBA/21gQP9tYED/bWBA/3BjRP+Fel7/c2dI/35zVv9tYED/em5R/39z
+        Vv9xZEX/fHBT/3xwU/9tYED/bWBA/21gQP9tYED/bWBA/21gQP9wZEX/rqmc//f4+P//////////////
+        ///8/Pv/vrip/7Colv/5+Pf/////////////////8/Lv/35vUf+RhGr//f39////////////////////
+        ////////////////////////xL2v/3BfPv/SzcL////////////+/v7/7u3p/6ylkv/y8e7//v7+//7+
+        /v////////////j4+P+moZL/bmFB/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/0c3C/3Bj
+        RP+Ngmn/vLan/3JlRv+qo5D/lYx0/7Colv+spJH/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/2xf
+        P/+Ph3L/7e3s//////////////////r6+f/Y1Mv/7u3p/7qzo//9/f3////////////SzcL/cF8+/8S+
+        r///////////////////////////////////////9fTy/3tsTf+ckXn//v7+/////////////f38/7qz
+        o/++uKn/2dbN//////////////////X29v+XkH3/bF8//21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bF8//8nFt/9tYED/zci8/8rFuf+DeF3/raWS/35zV/94a07/v7mr/21gQP9tYED/bWBA/21g
+        QP9vYUL/bWBA/21gQP9tYED/bWBA/4J5YP/n6Ob/////////////////7u3p/6mhjf/V0cf/6efh////
+        /////////v7+/5yRef97bE3/9fTy/////////////////////////////////7Ssmv9zY0L/6ufi////
+        ////////7+7q/9HNwv/+/v7/19TK//////////////////j4+P+XkH3/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/25hQf+gl4L/bWBA/42Caf+Rh2//cGNE/6ujkP97b1L/n5aA/4+F
+        bP9tYED/bWBA/21gQP9sXz//m5J8/21gQP9tYED/bWBA/21gQP9tYED/gXhf/+vr6v////////////7+
+        /v/U0Mb//v7+/+Hf2P/v7ur////////////p5+L/c2NC/7Wsmv////////////////////////////X0
+        8v94aEn/qJ2J//7+/v///////////8rFuf/r6eX/y8a5//////////////////z8/P+moZL/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/iH5j/8W/sv9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP+Lgmz/9fX1/////////////////8W/sv+spJH/0MvB//7+/v///////////6idif94aEn/9fTy////
+        //////////////////++t6f/cmFA/+nn4v////////////Py7//7+/r/x8K1/9vXz/////////////7+
+        /v/Fwrr/bmFB/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/9jVzP/Bu67/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/6WgkP/9/f3////////////Z1s3/rqeU//Py7//19PL/////////
+        ///p5+L/cmFA/763p//////////////////+/v3/hXda/5qOdv////////////7+/v/W0sj/qKGN/93a
+        0v/////////////////q6uj/d2xQ/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/6CY
+        g//+/v7/vbao/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9uYkL/0M/J/////////////////+nn
+        4v+9t6j/vben//7+/v///////v7+/5qOdv+Fd1r//v7+////////////3tvT/3FgP//Ry8D/////////
+        ///8/Pv/yMO2/5qQef/5+Pf////////////9/f3/nZeG/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/31xVP/08/D//////7iyov9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/4J5
+        YP/29/b////////////h3tf/yMO2/7y1pv/+/v7////////////Ry8D/cF8+/97b0////////////6+m
+        k/94aEn/+vr4////////////19TK//z8+//x8Oz//f38////////////3d3a/29jRP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/3FkRf/d2tP///////////+zrJv/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/vrux//////////////////z8+//QzMH/ysW5////////////+vr4/3ho
+        Sf+vppP///////7+/v+GeFz/n5R9/////////////f39/8jDtf+1rp3/9fTx/////////////v7+/5yX
+        hf9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/25hQv/MyL3/////////////////rqeV/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/4F3Xv/4+Pj////////////r6eX/6ujj//7+
+        /v////////////////+flH7/hnhc//7+/v/v7ur/cWA//8bAsv////////////Tz8f/RzcP/zsm+//X0
+        8v///////////+zt7P9zZ0n/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/3BjRP/Lxrv/////////
+        /////////////6qij/9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9sXz//0M/I////
+        /////////////9vYz//JxLf/1dHH////////////xr+y/3FgP//v7ur/0Mq//3BfPv/n5d//////////
+        ///Oyr//087E//X08v////////////////+/vLL/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/3tv
+        Uv/a187///////////////////////////+lnYn/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/52Xhf/+/v7////////////Bu63/6efi/////////////////+fl3/9xYD//0Mu//7Ws
+        mv93Z0f//f38///////+/v7/2NXM/7Krmf/p5+L////////////+/v7/lY56/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bmFB/6Oahv/z8u//////////////////////////////////oZiD/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP96cFX/9vf2/////////////f39//X08v/+/v7/+fn4////
+        ///9/fz/d2dH/7Wsmv+ek3z/jYBl/////////////v7+/+He1/+/uav/6ujj////////////9vb2/3lv
+        U/9tYED/bWBA/3dqTP+SiG//gHVZ/2xfP/9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9yZUb/opmF/+Th2//+/v7//////////////////////////////////////5yT
+        ff9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/+Dg3f////////////7+
+        /v/Kxbn/o5qF/+He1////////////42AZf+fk3z/jYBl/6CVfv//////////////////////////////
+        /////////////+Xm5P9tYED/bWBA/21gQP9tYED/bmFB/6CXgv/W0sj/zMe7/6+olv+Xjnf/hHle/3dr
+        Tf9vYkL/bmFB/3JlRv99cVX/kIZt/6ujkP/PysD/9vb0////////////////////////////////////
+        //////////////////+Yjnf/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP/Dwbf/////////////////4d7X//n49/////////////////+glX7/jYBl/4BxU/+upJH/////////
+        ///////////////////////////////////Rz8n/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bmJC/6KZ
+        hf/p6OP///////7+/v/+/v7//v7+//7+/v/+/v7//v7+////////////////////////////////////
+        ////////////////////////////////////////k4lx/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/rqqb////////////////////////////////////////////raSR/4Bx
+        U/93Z0f/t66d////////////////////////////////////////////wr+2/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/b2JD/6Sch//r6eX/////////////////////////////////////////
+        /////////////////////////////////////////////////////////////4+Ea/9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/5+aif//////////////////////////////
+        /////////////7evnv93Z0f/c2JB/7uzo////////////////////////////////////////////7u3
+        q/9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cGND/6aeiv/t6+f/////////
+        ////////////////////////////////////////////////////////////////////////////////
+        //+KgGb/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP+YkX7/////////
+        //////////////////////////////////+7s6P/c2JB/3NiQf+7s6P/////////////////////////
+        //////////////////+5tqr/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/cGNE/6ihjv/u7en/////////////////////////////////////////////////////////
+        ////////////////////////hXpf/21gQP90aUv/f3Vb/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/l5B9////////////////////////////////////////////u7Oj/3NiQf94Z0f/t6+d////
+        ////////////////////////////////////////v7ux/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cWRF/6ujkP/v7uv/////////////////////////
+        /////////////////////////////////////////v7+/4F1Wf9tYED/oJyP/4B2Xf9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/5yWhP///////////////////////////////////////////7ev
+        nf93Z0f/gHFT/66kkf///////////////////////////////////////////8vJwf9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cmVG/62l
+        k//x8Oz///////////////////////////////////////////////////////7+/v98cFT/gXde/7/B
+        wf99c1n/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP+oo5T/////////////////////////
+        //////////////////+tpJH/gHFT/42AZf+glX7/////////////////////////////////////////
+        ///e3tr/bF8//21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP96blL/lIx3/6+ol//y8e7/////////////////////////////////////////
+        ///+/v7/gndd/7a3s//AwsL/em9U/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/u7it////
+        ////////////////////////////////////////oJV+/42AZf+fk3z/jYBl////////////////////
+        ////////////////////////8fLy/3RoSv9tYED/bWBA/21gQP9/dFj/dmpN/2xfP/9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/3pvUv+mopL/1djW/9ne3f/Gx8H/mZF9/7Orm//z8/D/////////
+        /////////////////////////v7+/5KLeP/AwsL/v8HB/3dsUP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bF8//9bUz////////////////////////////////////////v7+/42AZf+fk3z/taya/3dn
+        R//9/f3///////////////////////////////////////39/f+JgWv/bWBA/21gQP9tYED/bmFB/5SM
+        d/+9vLL/urmv/6uomf+hnIv/nJaD/5yWhP+jno3/sa6h/8bIwf/Z3t3/2t/e/9rf3v/a397/2t/e/9ne
+        3f/IysT/nJWC/7Wunv/19PL///////////////////////7+/v+RiXb/wMLC/7/Bwf90aEv/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/3NoSv/w8fD///////////////////////////////////////39
+        /P93Z0f/taya/9DKv/9xYD//5+Xf////////////////////////////////////////////sKyf/21g
+        QP9tYED/bWBA/21gQP9tYED/bmFC/5aPev/Lzcj/2t/e/9rf3v/a397/2t/e/9rf3v/a397/2t/e/9rf
+        3v/a397/2t/e/9rf3v/a397/2t/e/9ne3f94bU//dmlL/7avn//29fP////////////7+/r/kYp3/8DC
+        wv/AwsL/cWVG/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP+Oh3L//v7+////////////////////
+        ///////////////////n5d//cF8+/9DLv//v7ur/cWA//8a/sv//////////////////////////////
+        /////////////9/f3P9uYUL/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bmJC/5iRff/Mzsr/2t/e/9rf
+        3v/a397/2t/e/9rf3v/a397/2t/e/9rf3v/a397/2t/e/9rf3v/Z3t3/hnxk/6yqo/+wr6n/mZOB/7q0
+        pf/39vT/9/b0/5ONe//AwsL/wMLC/25hQv9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/vrux////
+        ////////////////////////////////////////xr+y/3FgP//v7ur//v7+/4Z4XP+flH7/////////
+        /////////////////////////v7+///////7/Pz/ioJs/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/b2JD/5mTf//O0Mv/2t/e/9rf3v/a397/2t/e/9rf3v/a397/2t/e/9rf3v/a397/2t/e/4yE
+        b//AwsL/wMLC/8DCwv+0tK//lo98/7Krmv+VkH//wMLC/77Av/9sXz//bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/dWlN/+7v7v////////////7+/v/+/v7//////////////////////5+Ufv+GeFz//v7+////
+        //+vppP/eGhJ//r6+P//////////////////////6Obh/6WdiP/7+/r//////8nHv/9sXz//bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cGNE/5uVgv/P0c3/2t/e/9rf3v/a397/2t/e/9rf
+        3v/a397/2t/e/9rf3v+MhG//wMLC/8DCwv/AwsL/wMLC/7/Bwf+xsKr/qaee/8DCwv+8vbv/bF8//21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/6ahkv/+/v7/08/F/5mQef+XjXb/6efi/8jDt/////////////r6
+        +P94aEn/r6aT////////////3tvT/3BfPv/Ry8D////////////+/v7/xcCy/7Sunf+DeFz/gXVY//Lx
+        7v/4+fn/h39n/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cGRF/52X
+        hP/Q0s7/2t/e/9rf3v/a397/2t/e/9rf3v/Z3dz/e3BV/66tpv/AwsL/wMLC/8DCwv/AwsL/wMLC/8DC
+        wv/AwsL/ubm2/21gQP9tYED/bWBA/21gQP9tYED/bWBA/3RpTP/p6ef//////+zq5f+xqpj/e25R/46E
+        av+qo5D/9PPx///////Ry8D/cF8+/97b0/////////////7+/f+Fd1r/mo52/////////////////6mh
+        jf+SiHD/j4Vs/8G8rv/c2dH//////9PTzf9vYkP/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/cWRG/5+Zh//R1ND/2t/e/9rf3v/a397/19vZ/2xfP/9tYED/hn1n/7Cv
+        qP/AwsL/wMLC/8DCwv/AwsL/wMLC/7a2sv9tYED/bWBA/21gQP9tYED/bWBA/21gQP+zr6P/////////
+        ///39/X/0s7D/5qQef9zZ0j/fXBU/7ixof/+/v7/mo52/4V3Wv/+/v7/////////////////vran/3Jh
+        QP/p5+L///////r6+f+akXr/uLKh/42Daf/k4dv/qqKP///////9/f3/paCQ/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cmVH/6Cbif/S1dH/2t/e/9TY
+        1f9sXz//bWBA/21gQP9tYED/iH9p/7Gxq//AwsL/wMLC/8DCwv+zs63/bWBA/21gQP9tYED/bWBA/21g
+        QP+IgGn/9/f3////////////+fj3/7Osm/+/uav/i4Bm/5eNdv/c2dH/6efi/3JhQP++t6f/////////
+        //////////////X08v94aEn/qJ6J///////Lx7v/3tzU/+Xj3f/y8e7/oZmE/8vGuv////////////T0
+        9P+Hf2f/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/c2ZI/6KdjP/LzMb/bWBA/21gQP9tYED/bWBA/21gQP9tYEH/iYFs/7Oyrf/AwsL/sK+p/21g
+        QP9tYED/bWBA/21gQP92a0//4uLf//////////////////////////////////Hw7P/7+/r//////6ie
+        if94aEn/9fXy////////////////////////////taya/3NjQv/q5+L/////////////////////////
+        ////////////////////////5+fl/3xyV/9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/cWRF/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9uYUH/i4Nv/6Kekv9tYED/bWBA/21gQP9xZUf/z87I//7+/v//////////////////////////////
+        /////////////+rn4v9zY0L/taya//////////////////////////////////X08v97bE3/nJF5//7+
+        /v/////////////////////////////////////////////////g39z/e3BV/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9xZUf/x8W+//7+/v//////////////
+        //////////////////////////////7+/v+ckXn/e2xN//X08v//////////////////////////////
+        ////////xL2v/3FgP//SzcL//////////////////////////////////////////////////////+Pj
+        4f+CeWD/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP92ak3/zszG//7+
+        /v/////////////////////////////////////////////////SzcL/cWA//8S9r///////////////
+        //////////////////////////////39/f+RhGr/fm9R//Py7///////////////////////////////
+        ////////9vXz//z8/P//////7/Dv/5mSgP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP+GfWX/4ODd////////////+vr5/7avn//////////////////////////////////z8u//fm9R/5GE
+        av/9/fz/////////////////////////////////////////////////6ufi/3dnSP+ajnb//f39////
+        /////////////////////////v7+/4d8Yf+WjXX/+vn4///////7+/v/w8G4/3pvVP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/3NmSf+uqpz/9fb1////////////+fn3/83Ivf+9tqf/2dXM//7+/v//////////////
+        ///9/f3/mo52/3dnSP/q5+L/////////////////////////////////////////////////////////
+        ///Lxbn/cWA//7aunP/+/v7//////////////////f79/7ewoP99cVT/gHVY/+bk3v//////////////
+        ///w8PD/sKye/3htUv9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/cmZI/5+ZiP/k5OL//v7+//////////////////Tz8P+spJH/fXFU/6Wd
+        iP/+/v7////////////+/v7/tq6c/3FgP//Lxbn/////////////////////////////////////////
+        /////////////////////////v7+/6+mk/9xYD//yMK1//7+/v///////////+Ph2v+Rh2//wr2v/9/c
+        1f/6+fj////////////////////////////y8vL/wr+2/5CJdP9zZ0n/bWBA/21gQP9tYED/bWBA/21g
+        QP9tYED/bWBA/21gQP9tYED/bWBA/3BjRP+Hfmj/tbGl/+np6P/+/v7/////////////////////////
+        ///+/v7/uLGh//Hw7f+hmYT//v7+////////////yMK1/3FgP/+vppP//v7+////////////////////
+        ///////////////////////////////////////////////////9/fz/n5N8/3JiQf/NyLz//v7+////
+        ///o5uD/mI93/+3s6P/////////////////////////////////////////////////+/v7/7/Dw/9LR
+        y/+2sqb/oZuK/5OMeP+LhG7/i4Nt/5CJdf+dl4X/sKyf/8vJwf/q6un//Pz8////////////////////
+        /////////////////////////////////////////f38///////+/v7/zci8/3NiQf+fk3z//fz8////
+        //////////////////////////////////////////////////////////////////////////////r6
+        +f+ajnb/cmJB/8jCtf/+/v7///////7+/v////////////////////////////////////////////39
+        /f/t6+f/3drS//7+/v/////////////////+/v7//v7+//7+/v/+/v7/////////////////9fXy/+3r
+        5v/4+Pb////////////////////////////////////////////////////////////+/v7/yMK1/3Ji
+        Qf+ZjXX/+/r5////////////////////////////////////////////////////////////////////
+        ////////////////////////+vr5/56TfP9xYD//tq6c//39/f//////////////////////////////
+        //////////////7+/v+spJH/g3hd/5iPd//39vT/w72v/+Xj3f//////////////////////////////
+        /////////////97b0/+JfmP/29jP////////////////////////////////////////////////////
+        ///9/f3/tq6c/3FgP/+ek33/+vr5////////////////////////////////////////////////////
+        ///////////////////////////////////////////////////9/fz/r6aT/3FgP/+ajnb/8/Lv////
+        ////////////////////////////////////////+/v6/3hrTf+poY7/gHVY/8zIvP+spJL//v7+////
+        ////////////////////////////////////////qaGO/8fCtf/+/v7/////////////////////////
+        ///////////////////z8u//mo52/3FgP/+vppP//f38////////////////////////////////////
+        //////////////////////////////////////////////////////////////////////////////7+
+        /v/Lxbn/d2dI/35vUf/SzcL//v7+//////////////////////////////////39/P96blD/o5qF/31x
+        VP/6+vn////////////////////////////////////////////5+ff/zcm+/66nlP+nn4v/2dbN/+jm
+        4P////////////////////////////7+/v/SzcL/fm9R/3dnSP/Lxbn//v7+////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////+rn4v+RhGr/cF8+/5yRef/p5+L/////////////////////////
+        ///6+fj/g3hc/93a0/+0rp3/7+3q/////////////////////////////////////////////f39/6ae
+        iv+/uar/jYJp/7Krmv/39vT//////////////////////+nn4v+ckXn/cF8+/5GEav/q6OL/////////
+        ////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////f39/8S9r/97bE3/c2NC/6ie
+        if/p5+L//v7+////////////9fTy/9HNw//o5uH/19TL////////////////////////////////////
+        ///////////////////+/v7//v7+/8G7rf/+/v7/////////////////6efi/6ieif9zY0L/e2xN/8S+
+        r//9/f3/////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ////////9fTy/7Wsmv94aEn/cmFA/5qOdv/Qy8D/+vr4////////////////////////////////////
+        //////////////////////////////////////////////////////////////r6+P/Ry8D/mo52/3Jh
+        QP94aEn/taya//X08v//////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////9fTy/763p/+Fd1r/cF8+/3hoSf+flH7/xr+y/+fl
+        3//9/fz///////////////////////////////////////////////////////39/P/n5d//xsCy/5+U
+        ff94aEn/cWA//4V3Wv++t6f/9fTy////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////////////////////v79/97b
+        0/+vppP/hnhc/3FgP/9xYD//d2dH/42AZf+glX7/raSR/7eunf+7s6P/u7Oj/7evnf+tpJH/oJV+/42A
+        Zf93Z0f/cF8+/3FgP/+GeFz/r6aT/97b0//+/v3/////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        //////////////////////////////7+/v/v7ur/0Mu//7Wsmv+ek3z/jYBl/4BxU/93Z0f/c2JB/3Ni
+        Qf93Z0f/gHFT/42AZf+fk33/taya/9DKv//v7ur//v7+////////////////////////////////////
+        ////////////////////////////////////////////////////////////////////////////////
+        ////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+</value>
+  </data>
+</root>

BIN
NotePad/Pic/1.考试作业校园.jpg


BIN
NotePad/Pic/2.校园.jpg


BIN
NotePad/Pic/3.校园 .JPG


BIN
NotePad/Pic/IMG_1558.JPG


BIN
NotePad/Pic/IMG_2439.JPG


BIN
NotePad/Pic/IMG_2478.JPG


BIN
NotePad/Pic/IMG_2576.JPG


BIN
NotePad/Pic/IMG_2982.JPG


BIN
NotePad/Pic/IMG_3005.JPG


BIN
NotePad/Pic/IMG_3056.JPG


BIN
NotePad/Pic/IMG_3062.JPG


BIN
NotePad/Pic/colorpicker.png


BIN
NotePad/Pic/icon.ico


BIN
NotePad/Pic/image1.jpg


BIN
NotePad/Pic/image2.jpg


BIN
NotePad/Pic/image3.jpg


BIN
NotePad/Pic/image4.jpg


BIN
NotePad/Pic/image5.jpg


BIN
NotePad/Pic/image6.jpg


BIN
NotePad/Pic/image7.jpg


BIN
NotePad/Pic/psb (1).jpg


BIN
NotePad/Pic/psb (3).jpg


BIN
NotePad/Pic/psb (4).jpg


BIN
NotePad/Pic/psb (5).jpg


BIN
NotePad/Pic/psb.jpg


+ 42 - 0
NotePad/Program.cs

@@ -0,0 +1,42 @@
+using System;
+using System.IO;
+using System.Security.Principal;
+using System.Windows.Forms;
+
+namespace NotePad
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            try
+            {
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
+                if (!Directory.Exists("Note"))
+                    Directory.CreateDirectory("Note");
+                if (principal.IsInRole(WindowsBuiltInRole.Administrator))
+                    Application.Run(new NotePadForm());
+                else
+                {
+                    //创建启动对象
+                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+                    // 设置运行文件
+                    startInfo.FileName = Application.ExecutablePath;
+                    //设置启动动作,确保以管理员身份运行
+                    startInfo.Verb = "runas";
+                    //如果不是管理员,则启动UAC
+                    System.Diagnostics.Process.Start(startInfo);
+                }
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.Message);
+            }
+        }
+    }
+}

+ 36 - 0
NotePad/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("NotePad")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NotePad")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("e61a90f6-40f8-4b3a-9a2f-bec44b87e5d7")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 253 - 0
NotePad/Properties/Resources.Designer.cs

@@ -0,0 +1,253 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace NotePad.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 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() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [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("NotePad.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap _1_考试作业校园 {
+            get {
+                object obj = ResourceManager.GetObject("_1_考试作业校园", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap _2_校园 {
+            get {
+                object obj = ResourceManager.GetObject("_2_校园", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap _3_校园 {
+            get {
+                object obj = ResourceManager.GetObject("_3_校园", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap colorpicker {
+            get {
+                object obj = ResourceManager.GetObject("colorpicker", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap fontpicker {
+            get {
+                object obj = ResourceManager.GetObject("fontpicker", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似于 (Icon) 的 System.Drawing.Icon 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Icon icon {
+            get {
+                object obj = ResourceManager.GetObject("icon", resourceCulture);
+                return ((System.Drawing.Icon)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap image1 {
+            get {
+                object obj = ResourceManager.GetObject("image1", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap image2 {
+            get {
+                object obj = ResourceManager.GetObject("image2", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap image4 {
+            get {
+                object obj = ResourceManager.GetObject("image4", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap IMG_2439 {
+            get {
+                object obj = ResourceManager.GetObject("IMG_2439", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap IMG_2478 {
+            get {
+                object obj = ResourceManager.GetObject("IMG_2478", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap IMG_2576 {
+            get {
+                object obj = ResourceManager.GetObject("IMG_2576", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap IMG_3056 {
+            get {
+                object obj = ResourceManager.GetObject("IMG_3056", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Logo {
+            get {
+                object obj = ResourceManager.GetObject("Logo", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap psb {
+            get {
+                object obj = ResourceManager.GetObject("psb", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap psb__1_ {
+            get {
+                object obj = ResourceManager.GetObject("psb__1_", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap psb__3_ {
+            get {
+                object obj = ResourceManager.GetObject("psb__3_", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap psb__4_ {
+            get {
+                object obj = ResourceManager.GetObject("psb__4_", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap psb__5_ {
+            get {
+                object obj = ResourceManager.GetObject("psb__5_", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}

+ 178 - 0
NotePad/Properties/Resources.resx

@@ -0,0 +1,178 @@
+<?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>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="colorpicker" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\colorpicker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="fontpicker" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\font_color_32px_1187333_easyicon.net.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="image1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\image1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="image2" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\image2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="image4" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\image6.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\image4.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="IMG_2439" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\img_2439.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="IMG_2478" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\img_2478.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="IMG_2576" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\img_2576.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="IMG_3056" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\img_3056.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="_1_考试作业校园" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\1.考试作业校园.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="_2_校园" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\2.校园.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="_3_校园" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\pic\3.校园 .jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="psb" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Pic\psb.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="psb__1_" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Pic\psb (1).jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="psb__3_" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Pic\psb (3).jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="psb__4_" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Pic\psb (4).jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="psb__5_" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Pic\psb (5).jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

+ 48 - 0
NotePad/Properties/Settings.Designer.cs

@@ -0,0 +1,48 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace NotePad.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::System.Drawing.Font LastFont {
+            get {
+                return ((global::System.Drawing.Font)(this["LastFont"]));
+            }
+            set {
+                this["LastFont"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::System.Drawing.Color LastFontColor {
+            get {
+                return ((global::System.Drawing.Color)(this["LastFontColor"]));
+            }
+            set {
+                this["LastFontColor"] = value;
+            }
+        }
+    }
+}

+ 12 - 0
NotePad/Properties/Settings.settings

@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="NotePad.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="LastFont" Type="System.Drawing.Font" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="LastFontColor" Type="System.Drawing.Color" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+  </Settings>
+</SettingsFile>

BIN
NotePad/Resources/font_color_32px_1187333_easyicon.net.png


BIN
NotePad/Resources/image6.jpg


BIN
NotePad/Resources/image7.jpg


BIN
NotePad/Tool/CSkin.dll


BIN
NotePad/Tool/WMPLib.dll


+ 12 - 0
TestProject/App.config

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+    </configSections>
+    <connectionStrings>
+        <add name="MES" connectionString="Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*("
+            providerName="" />
+    </connectionStrings>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 136 - 0
TestProject/DrawHelper.cs

@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TestProject
+{
+    class DrawHelper
+    {
+        #region RendererBackground 渲染背景图片,使背景图片不失真
+
+        /// <summary>
+        /// 渲染背景图片,使背景图片不失真
+        /// </summary>
+        /// <param name="g"></param>
+        /// <param name="rect"></param>
+        /// <param name="backgroundImage"></param>
+        /// <param name="method"></param>
+        public static void RendererBackground(Graphics g, Rectangle rect, Image backgroundImage, bool method)
+        {
+            if (!method)
+            {
+                g.DrawImage(backgroundImage, new Rectangle(rect.X + 0, rect.Y, 5, rect.Height), 0, 0, 5, backgroundImage.Height, GraphicsUnit.Pixel);
+                g.DrawImage(backgroundImage, new Rectangle(rect.X + 5, rect.Y, rect.Width - 10, rect.Height), 5, 0, backgroundImage.Width - 10, backgroundImage.Height, GraphicsUnit.Pixel);
+                g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - 5, rect.Y, 5, rect.Height), backgroundImage.Width - 5, 0, 5, backgroundImage.Height, GraphicsUnit.Pixel);
+            }
+            else
+            {
+                DrawHelper.RendererBackground(g, rect, 5, backgroundImage);
+            }
+        }
+
+        /// <summary>
+        /// 渲染背景图片,使背景图片不失真
+        /// </summary>
+        /// <param name="g"></param>
+        /// <param name="rect"></param>
+        /// <param name="cut"></param>
+        /// <param name="backgroundImage"></param>
+        public static void RendererBackground(Graphics g, Rectangle rect, int cut, Image backgroundImage)
+        {
+            //左上角
+            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y, cut, cut), 0, 0, cut, cut, GraphicsUnit.Pixel);
+            //上边
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y, rect.Width - cut * 2, cut), cut, 0, backgroundImage.Width - cut * 2, cut, GraphicsUnit.Pixel);
+            //右上角
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y, cut, cut), backgroundImage.Width - cut, 0, cut, cut, GraphicsUnit.Pixel);
+            //左边
+            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y + cut, cut, rect.Height - cut * 2), 0, cut, cut, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
+            //左下角
+            g.DrawImage(backgroundImage, new Rectangle(rect.X, rect.Y + rect.Height - cut, cut, cut), 0, backgroundImage.Height - cut, cut, cut, GraphicsUnit.Pixel);
+            //右边
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y + cut, cut, rect.Height - cut * 2), backgroundImage.Width - cut, cut, cut, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
+            //右下角
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + rect.Width - cut, rect.Y + rect.Height - cut, cut, cut), backgroundImage.Width - cut, backgroundImage.Height - cut, cut, cut, GraphicsUnit.Pixel);
+            //下边
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y + rect.Height - cut, rect.Width - cut * 2, cut), cut, backgroundImage.Height - cut, backgroundImage.Width - cut * 2, cut, GraphicsUnit.Pixel);
+            //平铺中间
+            g.DrawImage(backgroundImage, new Rectangle(rect.X + cut, rect.Y + cut, rect.Width - cut * 2, rect.Height - cut * 2), cut, cut, backgroundImage.Width - cut * 2, backgroundImage.Height - cut * 2, GraphicsUnit.Pixel);
+        }
+
+        #endregion
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="g"></param>
+        /// <param name="image"></param>
+        /// <param name="x1"></param>
+        /// <param name="y1"></param>
+        /// <param name="width1"></param>
+        /// <param name="height1"></param>
+        /// <param name="x2"></param>
+        /// <param name="y2"></param>
+        /// <param name="width2"></param>
+        /// <param name="height2"></param>
+        public static void DrawImage(Graphics g, Image image, int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2)
+        {
+            g.DrawImage(image, new Rectangle(x1, y1, width1, height1), x2, y2, width2, height2, GraphicsUnit.Pixel);
+        }
+
+        #region CreateRoundPath 构建圆角路径
+
+        /// <summary>
+        /// 构建圆角路径
+        /// </summary>
+        /// <param name="rect"></param>
+        /// <param name="cornerRadius"></param>
+        /// <returns></returns>
+        public static GraphicsPath CreateRoundPath(Rectangle rect, int cornerRadius)
+        {
+            GraphicsPath roundedRect = new GraphicsPath();
+            roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
+            roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
+            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
+            roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
+            roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
+            roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
+            roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
+            roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
+            roundedRect.CloseFigure();
+            return roundedRect;
+        }
+
+        /// <summary>
+        /// 构建圆角路径
+        /// </summary>
+        /// <param name="r"></param>
+        /// <param name="r1"></param>
+        /// <param name="r2"></param>
+        /// <param name="r3"></param>
+        /// <param name="r4"></param>
+        /// <returns></returns>
+        public static GraphicsPath CreateRoundRect(RectangleF r, float r1, float r2, float r3, float r4)
+        {
+            float x = r.X;
+            float y = r.Y;
+            float width = r.Width;
+            float height = r.Height;
+            GraphicsPath path = new GraphicsPath();
+            path.AddBezier(x, y + r1, x, y, x + r1, y, x + r1, y);
+            path.AddLine(x + r1, y, (x + width) - r2, y);
+            path.AddBezier((x + width) - r2, y, x + width, y, x + width, y + r2, x + width, y + r2);
+            path.AddLine((float)(x + width), (float)(y + r2), (float)(x + width), (float)((y + height) - r3));
+            path.AddBezier((float)(x + width), (float)((y + height) - r3), (float)(x + width), (float)(y + height), (float)((x + width) - r3), (float)(y + height), (float)((x + width) - r3), (float)(y + height));
+            path.AddLine((float)((x + width) - r3), (float)(y + height), (float)(x + r4), (float)(y + height));
+            path.AddBezier(x + r4, y + height, x, y + height, x, (y + height) - r4, x, (y + height) - r4);
+            path.AddLine(x, (y + height) - r4, x, y + r1);
+            return path;
+        }
+        #endregion
+    }
+}

+ 32 - 0
TestProject/EMouseEnum.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TestProject
+{
+    public enum EMouseEnum
+    {
+        /// <summary>
+        /// 默认
+        /// </summary>
+        Normal, 
+        /// <summary>
+        /// 鼠标划过
+        /// </summary>
+        Move,
+        /// <summary>
+        /// 鼠标按下
+        /// </summary>
+        Down,
+        /// <summary>
+        /// 鼠标释放
+        /// </summary>
+        Up,
+        /// <summary>
+        /// 鼠标离开
+        /// </summary>
+        Leave,
+    }
+}

+ 93 - 0
TestProject/Form1.Designer.cs

@@ -0,0 +1,93 @@
+namespace TestProject
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.qqButton1 = new TestProject.QQButton();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(632, 124);
+            this.button1.Margin = new System.Windows.Forms.Padding(4);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(100, 29);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(373, 112);
+            this.button2.Margin = new System.Windows.Forms.Padding(4);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(100, 29);
+            this.button2.TabIndex = 1;
+            this.button2.Text = "button2";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // qqButton1
+            // 
+            this.qqButton1.ForeColor = System.Drawing.SystemColors.ControlText;
+            this.qqButton1.IsShowBorder = true;
+            this.qqButton1.Location = new System.Drawing.Point(159, 112);
+            this.qqButton1.Name = "qqButton1";
+            this.qqButton1.Size = new System.Drawing.Size(166, 97);
+            this.qqButton1.TabIndex = 2;
+            this.qqButton1.Text = "12312";
+            this.qqButton1.UseVisualStyleBackColor = true;
+            this.qqButton1.Click += new System.EventHandler(this.qqButton1_Click);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1063, 578);
+            this.Controls.Add(this.qqButton1);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
+        private QQButton qqButton1;
+    }
+}
+

+ 36 - 0
TestProject/Form1.cs

@@ -0,0 +1,36 @@
+using MES接口;
+using System;
+using System.Windows.Forms;
+
+namespace TestProject
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            LogicHandler lg = new LogicHandler();
+            string ErrorMessage = "";
+            LogicHandler.SetAddressInfo("EZ01", "123123123123", "123", "123", "123", "123", out ErrorMessage);
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+        
+        }
+
+        private void qqButton1_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
TestProject/Form1.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>

+ 86 - 0
TestProject/Form2.Designer.cs

@@ -0,0 +1,86 @@
+namespace TestProject
+{
+    partial class Form2
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("");
+            this.BackColorTimer = new System.Windows.Forms.Timer(this.components);
+            this.rtfRichTextBox1 = new CCWin.SkinControl.RtfRichTextBox();
+            this.skinListView1 = new CCWin.SkinControl.SkinListView();
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.SuspendLayout();
+            // 
+            // rtfRichTextBox1
+            // 
+            this.rtfRichTextBox1.BackColor = System.Drawing.Color.SeaShell;
+            this.rtfRichTextBox1.HiglightColor = CCWin.SkinControl.RtfRichTextBox.RtfColor.White;
+            this.rtfRichTextBox1.Location = new System.Drawing.Point(448, 46);
+            this.rtfRichTextBox1.Name = "rtfRichTextBox1";
+            this.rtfRichTextBox1.Size = new System.Drawing.Size(865, 531);
+            this.rtfRichTextBox1.TabIndex = 0;
+            this.rtfRichTextBox1.Text = "";
+            this.rtfRichTextBox1.TextColor = CCWin.SkinControl.RtfRichTextBox.RtfColor.Green;
+            // 
+            // skinListView1
+            // 
+            this.skinListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1});
+            this.skinListView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
+            listViewItem1});
+            this.skinListView1.Location = new System.Drawing.Point(29, 61);
+            this.skinListView1.Name = "skinListView1";
+            this.skinListView1.OwnerDraw = true;
+            this.skinListView1.Size = new System.Drawing.Size(121, 383);
+            this.skinListView1.TabIndex = 1;
+            this.skinListView1.UseCompatibleStateImageBehavior = false;
+            this.skinListView1.View = System.Windows.Forms.View.Details;
+            // 
+            // Form2
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.SkyBlue;
+            this.ClientSize = new System.Drawing.Size(1351, 666);
+            this.Controls.Add(this.skinListView1);
+            this.Controls.Add(this.rtfRichTextBox1);
+            this.Name = "Form2";
+            this.Text = "记事本";
+            this.Load += new System.EventHandler(this.Form2_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Timer BackColorTimer;
+        private CCWin.SkinControl.RtfRichTextBox rtfRichTextBox1;
+        private CCWin.SkinControl.SkinListView skinListView1;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+    }
+}

+ 34 - 0
TestProject/Form2.cs

@@ -0,0 +1,34 @@
+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;
+using CCWin;
+using System.Net.Mail;
+
+namespace TestProject
+{
+    public partial class Form2 : CCSkinMain
+    {
+        int TimerCount = 0;
+        public Form2()
+        {
+            InitializeComponent();
+        }
+
+        private void Form2_Load(object sender, EventArgs e)
+        {
+           
+        }
+
+        private void ChangeBackColor(object sender, EventArgs e)
+        {
+            
+           
+        }
+    }
+}

+ 123 - 0
TestProject/Form2.resx

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

+ 49 - 0
TestProject/Program.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Security.Principal;
+using System.Windows.Forms;
+
+namespace TestProject
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            try
+            {
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
+                //设置应用程序处理异常方式:ThreadException处理
+                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+                //处理UI线程异常
+                Application.EnableVisualStyles();
+                Application.SetCompatibleTextRenderingDefault(false);
+                //启用异常记录日志的操作
+                //如果是管理员的身份
+                if (principal.IsInRole(WindowsBuiltInRole.Administrator))
+                {
+                    Application.Run(new Form2());
+                }
+                else
+                {
+                    //创建启动对象 
+                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+                    // 设置运行文件
+                    startInfo.FileName = Application.ExecutablePath;
+                    //设置启动动作,确保以管理员身份运行
+                    startInfo.Verb = "runas";
+                    //如果不是管理员,则启动UAC 
+                    System.Diagnostics.Process.Start(startInfo);
+                    //退出 System.Windows.Forms.Application.Exit(); 
+                }
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
+    }
+}

+ 36 - 0
TestProject/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("TestProject")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TestProject")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("92488a73-91d7-4797-9794-67c4d9d86d09")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 133 - 0
TestProject/Properties/Resources.Designer.cs

@@ -0,0 +1,133 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace TestProject.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 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() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [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("TestProject.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap down {
+            get {
+                object obj = ResourceManager.GetObject("down", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap focus {
+            get {
+                object obj = ResourceManager.GetObject("focus", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap gray {
+            get {
+                object obj = ResourceManager.GetObject("gray", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap highlight {
+            get {
+                object obj = ResourceManager.GetObject("highlight", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Light {
+            get {
+                object obj = ResourceManager.GetObject("Light", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap normal {
+            get {
+                object obj = ResourceManager.GetObject("normal", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap White_side {
+            get {
+                object obj = ResourceManager.GetObject("White_side", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}

+ 142 - 0
TestProject/Properties/Resources.resx

@@ -0,0 +1,142 @@
+<?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>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="focus" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\focus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="gray" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\gray.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="down" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="highlight" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\highlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="White_side" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\White-side.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="Light" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\Light.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

+ 35 - 0
TestProject/Properties/Settings.Designer.cs

@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace TestProject.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+        }
+    }
+}

+ 14 - 0
TestProject/Properties/Settings.settings

@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="TestProject.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="MES" Roaming="true" GenerateDefaultValueInCode="false" Type="(Connection string)" Scope="Application">
+      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;ConnectionString&gt;Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(&lt;/ConnectionString&gt;
+  &lt;ProviderName /&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+      <Value Profile="(Default)">Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 36 - 0
TestProject/QQButton.Designer.cs

@@ -0,0 +1,36 @@
+namespace TestProject
+{
+    partial class QQButton
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 205 - 0
TestProject/QQButton.cs

@@ -0,0 +1,205 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using TestProject.Properties;
+using System.Drawing.Text;
+using System.Drawing.Drawing2D;
+
+namespace TestProject
+{
+    public partial class QQButton : Button
+    {
+        private EMouseEnum _mouseState = EMouseEnum.Normal;
+
+        private bool _isShowBorder = true;
+
+        private TextFormatFlags _textAlign = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter;
+
+        public QQButton()
+        {
+            InitializeComponent();
+        }
+
+        internal EMouseEnum MouseState
+        {
+            get { return this._mouseState; }
+            set
+            {
+                this._mouseState = value;
+                base.Invalidate();
+            }
+        }
+
+        /// <summary>
+        /// 整个按钮的区域
+        /// </summary>
+        internal Rectangle AllRect
+        {
+            get { return new Rectangle(0, 0, this.Width, this.Height); }
+        }
+
+        /// <summary>
+        /// 是否显示发光边框
+        /// </summary>
+        [Description("是否显示发光边框")]
+        public virtual bool IsShowBorder
+        {
+            get { return this._isShowBorder; }
+            set { this._isShowBorder = value; }
+        }
+        /// <summary>
+        /// 文字区域
+        /// </summary>
+        internal Rectangle TextRect
+        {
+            get { return new Rectangle(2, 2, this.AllRect.Width - 4, this.AllRect.Height - 4); }
+        }
+
+        /// <summary>
+        /// 按钮上文字的对齐方式
+        /// </summary>
+        [Description("按钮上文字的对齐方式")]
+        new public ContentAlignment TextAlign
+        {
+            get { return base.TextAlign; }
+            set
+            {
+                base.TextAlign = value;
+                switch (base.TextAlign)
+                {
+                    case ContentAlignment.BottomCenter:
+                        this._textAlign = TextFormatFlags.Bottom |
+                                          TextFormatFlags.HorizontalCenter |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.BottomLeft:
+                        this._textAlign = TextFormatFlags.Bottom |
+                                          TextFormatFlags.Left |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.BottomRight:
+                        this._textAlign = TextFormatFlags.Bottom |
+                                          TextFormatFlags.Right |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.MiddleCenter:
+                        this._textAlign = TextFormatFlags.SingleLine |
+                                          TextFormatFlags.HorizontalCenter |
+                                          TextFormatFlags.VerticalCenter;
+                        break;
+                    case ContentAlignment.MiddleLeft:
+                        this._textAlign = TextFormatFlags.Left |
+                                          TextFormatFlags.VerticalCenter |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.MiddleRight:
+                        this._textAlign = TextFormatFlags.Right |
+                                          TextFormatFlags.VerticalCenter |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.TopCenter:
+                        this._textAlign = TextFormatFlags.Top |
+                                          TextFormatFlags.HorizontalCenter |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.TopLeft:
+                        this._textAlign = TextFormatFlags.Top |
+                                          TextFormatFlags.Left |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                    case ContentAlignment.TopRight:
+                        this._textAlign = TextFormatFlags.Top |
+                                          TextFormatFlags.Right |
+                                          TextFormatFlags.SingleLine;
+                        break;
+                }
+                base.Invalidate(this.TextRect);
+            }
+        }
+
+        protected override void OnPaint(PaintEventArgs pevent)
+        {
+            Graphics g = pevent.Graphics;
+            g.SmoothingMode = SmoothingMode.AntiAlias;
+            g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
+            switch (MouseState)
+            {
+                case EMouseEnum.Leave:
+                case EMouseEnum.Normal:
+                    if (base.Focused)
+                    {
+                        if (this.IsShowBorder)
+                        {
+                            using (Image focus = Resources.focus)
+                            {
+                                DrawHelper.RendererBackground(g, this.TextRect, focus, true);
+                            }
+                        }
+                        else
+                        {
+                            DrawHelper.RendererBackground(g, this.TextRect, Resources.normal, true);
+                        }
+                    }
+                    else
+                    {
+                        DrawHelper.RendererBackground(g, this.TextRect, Resources.normal, true);
+                    }
+                    break;
+                case EMouseEnum.Up:
+                case EMouseEnum.Move:
+                    DrawHelper.RendererBackground(g, this.TextRect, Resources.highlight, true);
+                    break;
+                case EMouseEnum.Down:
+                    DrawHelper.RendererBackground(g, this.TextRect, Resources.Light, true);
+                    break;
+            }
+            TextRenderer.DrawText(g, this.Text, this.Font, this.TextRect, this.ForeColor, this._textAlign);
+        }
+
+        /// <summary>
+        /// 引发 System.Windows.Forms.Form.MouseEnter 事件。
+        /// </summary>
+        /// <param name="e">包含事件数据的 System.EventArgs。</param>
+        protected override void OnMouseEnter(EventArgs e)
+        {
+            base.OnMouseEnter(e);
+            this.MouseState = EMouseEnum.Move;
+        }
+
+        /// <summary>
+        /// 引发 System.Windows.Forms.Form.MouseLeave 事件。
+        /// </summary>
+        /// <param name="e">包含事件数据的 System.EventArgs。</param>
+        protected override void OnMouseLeave(EventArgs e)
+        {
+            base.OnMouseLeave(e);
+            this.MouseState = EMouseEnum.Leave;
+        }
+
+        /// <summary>
+        /// 引发 System.Windows.Forms.Form.MouseDown 事件。
+        /// </summary>
+        /// <param name="mevent">包含事件数据的 System.Windows.Forms.MouseEventArgs。</param>
+        protected override void OnMouseDown(MouseEventArgs mevent)
+        {
+            base.OnMouseDown(mevent);
+            this.MouseState = EMouseEnum.Down;
+        }
+
+        /// <summary>
+        /// 引发 System.Windows.Forms.Form.MouseUp 事件。
+        /// </summary>
+        /// <param name="mevent">包含事件数据的 System.Windows.Forms.MouseEventArgs。</param>
+        protected override void OnMouseUp(MouseEventArgs mevent)
+        {
+            base.OnMouseUp(mevent);
+            this.MouseState = EMouseEnum.Up;
+        }
+    }
+}

+ 123 - 0
TestProject/QQButton.resx

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

BIN
TestProject/Resources/Light.png


BIN
TestProject/Resources/White-side.png


BIN
TestProject/Resources/down.png


BIN
TestProject/Resources/focus.png


BIN
TestProject/Resources/gray.png


BIN
TestProject/Resources/highlight.png


BIN
TestProject/Resources/normal.png


BIN
TestProject/Resources/timg (1).jpg


BIN
TestProject/Resources/timg (1)1.jpg


+ 183 - 0
TestProject/TestProject.csproj

@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{92488A73-91D7-4797-9794-67C4D9D86D09}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>TestProject</RootNamespace>
+    <AssemblyName>TestProject</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <IsWebBootstrapper>true</IsWebBootstrapper>
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <PublishUrl>ftp://192.168.253.9/LabelMachine/</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Web</InstallFrom>
+    <UpdateEnabled>true</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <InstallUrl>http://192.168.253.9:82/</InstallUrl>
+    <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
+    <WebPage>publish.htm</WebPage>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>4FA99E585616700DE7B55D9E1B52AECEA80A31C9</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>
+    </ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CSkin">
+      <HintPath>tool\CSkin.dll</HintPath>
+    </Reference>
+    <Reference Include="MES接口">
+      <HintPath>tool\MES接口.dll</HintPath>
+      <EmbedInteropTypes>False</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="Oracle.ManagedDataAccess">
+      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DrawHelper.cs" />
+    <Compile Include="EMouseEnum.cs" />
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Form2.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form2.Designer.cs">
+      <DependentUpon>Form2.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="QQButton.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="QQButton.Designer.cs">
+      <DependentUpon>QQButton.cs</DependentUpon>
+    </Compile>
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Form2.resx">
+      <DependentUpon>Form2.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <EmbeddedResource Include="QQButton.resx">
+      <DependentUpon>QQButton.cs</DependentUpon>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.5.2 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\down.png" />
+    <None Include="Resources\focus.png" />
+    <None Include="Resources\gray.png" />
+    <None Include="Resources\highlight.png" />
+    <None Include="Resources\Light.png" />
+    <None Include="Resources\normal.png" />
+    <None Include="Resources\White-side.png" />
+    <Content Include="Resources\timg %281%29.jpg" />
+    <None Include="Resources\timg %281%291.jpg" />
+    <Content Include="tool\MES接口.dll" />
+    <Content Include="tool\MES接口.XML" />
+    <Content Include="tool\Oracle.ManagedDataAccess.dll" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

BIN
TestProject/tool/CSkin.dll


+ 562 - 0
TestProject/tool/MES接口.XML

@@ -0,0 +1,562 @@
+<?xml version="1.0"?>
+<doc>
+    <assembly>
+        <name>MES接口</name>
+    </assembly>
+    <members>
+        <member name="M:MES接口.ftpOperater.GetFileList">
+            <summary>
+            获取ftp服务器上的文件信息
+            </summary>
+            <returns>存储了所有文件信息的字符串数组</returns>
+        </member>
+        <member name="M:MES接口.ftpOperater.GetFileSize(System.String)">
+            <summary>
+            获取FTP上指定文件的大小
+            </summary>
+            <param name="filename">文件名</param>
+            <returns>文件大小</returns>
+        </member>
+        <member name="M:MES接口.ftpOperater.Download(System.String)">
+            <summary>
+            实现ftp下载操作
+            </summary>
+            <param name="fileName">远程文件名</param>
+        </member>
+        <member name="T:MES接口.LogicHandler">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:MES接口.LogicHandler.#ctor">
+            <summary>
+            
+            </summary>
+        </member>
+        <member name="M:MES接口.LogicHandler.CheckUserLogin(System.String,System.String,System.String@)">
+            <summary>
+            验证用户身份信息
+            </summary>
+            <param name="iUserCode"></param>
+            <param name="iPassWord"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.CheckUserLoginAndSource(System.String,System.String,System.String,System.String@)">
+            <summary>
+            验证用户身份信息和岗位资源
+            </summary>
+            <param name="iUserCode"></param>
+            <param name="iPassWord"></param>
+            <param name="iUserSource"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.CheckCurrentStep(System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            检测当前工序是否正确
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iSource"></param>
+            <param name="iCaller"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetOQCBatch(System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            获取送检批次,根据不同的iOQCStep执行不同的操作,查询到有具体的信息时返回Form和Detail的两个DataTable
+             iOQCStep 有四个固定参数
+             OQCSENDCHECK 生成送检批
+             OQCPLANMAINTAIN 抽样计划维护
+             OQCDATACOLLECTION 抽样数据采集
+             OQCRESULTDETERMINE 批结果判定
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetBatch(System.String,System.String,System.String@)">
+            <summary>
+             第一个是Form的主表信息,第二个是Grid的信息
+            </summary>
+            <param name="iCheckNo"></param>
+            <param name="iOQCStep"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.CheckNextStepIfQC(System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            判断下一工序是否是送检工序
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetTestDetail(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
+            </summary>
+            <param name="iSNCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iClass"></param>
+            <param name="iSubClass1"></param>
+            <param name="iSubClass2"></param>
+            <param name="iSubClass3"></param>
+            <param name="iMaxValue"></param>
+            <param name="iMinValue"></param>
+            <param name="iActualValue"></param>
+            <param name="iValue1"></param>
+            <param name="iValue2"></param>
+            <param name="iValue3"></param>
+            <param name="iTestResult"></param>
+            <param name="iSource"></param>
+            <param name="oErrMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetAddressRangeByMakeCode(System.String,System.String,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@)">
+            <summary>
+            分配Mac地址和BT地址
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="oMac"></param>
+            <param name="oBT"></param>
+            <param name="oCode1"></param>
+            <param name="oCode2"></param>
+            <param name="oCode3"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetAddressInfo(System.String,System.String,System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            保存Mac地址和BT地址
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMac"></param>
+            <param name="iBT"></param>
+            <param name="iCode1"></param>
+            <param name="iCode2"></param>
+            <param name="iCode3"></param>
+            <param name="oErrMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetIMEIOrNetCodeRange(System.String,System.String,System.String,System.String,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@)">
+            <summary>
+            输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
+            如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iIMEI1"></param>
+            <param name="iNetCode"></param>
+            <param name="oIMEI1"></param>
+            <param name="oIMEI2"></param>
+            <param name="oIMEI3"></param>
+            <param name="oMEID"></param>
+            <param name="oNetCode"></param>
+            <param name="oPSN"></param>
+            <param name="oMac"></param>
+            <param name="oBT"></param>
+            <param name="oCode1"></param>
+            <param name="oCode2"></param>
+            <param name="oCode3"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetIMEIInfo(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            作业调用该方法将确认接收SN对应的IMEI及附属信息。
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iIMEI1"></param>
+            <param name="iIMEI2"></param>
+            <param name="iIMEI3"></param>
+            <param name="iMEID"></param>
+            <param name="iNetCode"></param>
+            <param name="iPSN"></param>
+            <param name="iMac"></param>
+            <param name="iBT"></param>
+            <param name="iCode1"></param>
+            <param name="iCode2"></param>
+            <param name="iCode3"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetSNAllInfo(System.String,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@,System.String@)">
+            <summary>
+            获取序列号的所有串号信息
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="oIMEI1"></param>
+            <param name="oIMEI2"></param>
+            <param name="oIMEI3"></param>
+            <param name="oMEID"></param>
+            <param name="oNetCode"></param>
+            <param name="oPSN"></param>
+            <param name="oMac"></param>
+            <param name="oBT"></param>
+            <param name="oCode1"></param>
+            <param name="oCode2"></param>
+            <param name="oCode3"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetTestResult(System.String,System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            设置良品采集结果
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iSource"></param>
+            <param name="iUserName"></param>
+            <param name="iResult"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetTestNGDetail(System.String,System.String,System.String,System.String,System.String,System.String[],System.String[],System.String@)">
+            <summary>
+            执行不良信息采集
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iUserName"></param>
+            <param name="iSource"></param>
+            <param name="iResult"></param>
+            <param name="iBadCode"></param>
+            <param name="iBadRemark"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetCollectionFinish(System.String,System.String,System.String,System.String,System.String)">
+            <summary>
+            已有StepCode和StepName的情况下类的内部调用
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iUserName"></param>
+            <param name="StepCode"></param>
+            <param name="StepName"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetMakeInfo(System.String,System.String@,System.String@)">
+            <summary>
+            获取工单的最近一条执行记录
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="oMakeCode"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetCollectionFinish(System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            判断是否扣料工序,执行扣料,执行上料表记录
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iUserName"></param>
+            <param name="iSource"></param>
+            <param name="oErrorMessage"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.InsertMessageLog(System.String,System.String,System.String,System.String,System.String)">
+            <summary>
+            记录一般操作日志
+            </summary>
+            <param name="inMan"></param>
+            <param name="Content"></param>
+            <param name="Result"></param>
+            <param name="Search"></param>
+            <param name="Code"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetMaterialUp(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            上料采集
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="iBarcode"></param>
+            <param name="iSonCode"></param>
+            <param name="iSource"></param>
+            <param name="iUserName"></param>
+            <param name="iSonID"></param>
+            <param name="iType"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.SetMaterialDown(System.String,System.String,System.String,System.String,System.String@)">
+            <summary>
+            执行下料操作
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iBarCode"></param>
+            <param name="iCurrentStep"></param>
+            <param name="iUserName"></param>
+            <param name="oErrorMessage"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetStepCodeAndNameAndLineBySource(System.String,System.String@,System.String@,System.String@)">
+            <summary>
+            获取执行步骤代码,名称和线别
+            </summary>
+            <param name="Source"></param>
+            <param name="StepCode"></param>
+            <param name="StepName"></param>
+            <param name="LineCode"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetStepCodeAndNameBySource(System.String,System.String@,System.String@)">
+            <summary>
+            获取步骤代码和名称
+            </summary>
+            <param name="Source"></param>
+            <param name="StepCode"></param>
+            <param name="StepName"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.GetStepCodeBySource(System.String)">
+            <summary>
+            获取步骤代码
+            </summary>
+            <param name="Source"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.CheckIfFirstMakeSerial(System.String,System.String,System.String)">
+            <summary>
+            判断当前工序是否是第一道工序
+            </summary>
+            <param name="iSncode"></param>
+            <param name="iMakecode"></param>
+            <param name="iSource"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.LogicHandler.InsertMakeProcess(System.String,System.String,System.String,System.String)">
+            <summary>
+             记录操作日志
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+            <param name="result"></param>
+            <param name="iUserName"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.UpDateNextStepCode(System.String,System.String)">
+            <summary>
+            更新到下一步骤
+            </summary>
+            <param name="iSnCode"></param>
+            <param name="iMakeCode"></param>
+        </member>
+        <member name="M:MES接口.LogicHandler.AddField(System.String[])">
+            <summary>
+            
+            </summary>
+            <param name="Fields"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.#ctor">
+            <summary>
+            执行构造函数的时候打开数据库的链接
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.GetColumnDataType(System.String)">
+            <summary>
+            根据表名获取该表字段数据类型
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.getFieldDataByCondition(System.String,System.String,System.String)">
+            <summary>
+            获取第一行第一列的信息
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.ExecutePrintSQL(System.String,System.String[])">
+            <summary>
+            执行打印的SQL
+            </summary>
+            <param name="SQL">SQL语句</param>
+            <param name="Parameters">动态添加的参数,主要根据条码枪扫描获取</param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.getRowCount(System.String,System.String)">
+            <summary>
+            获取指定表的记录的条数 ,带条件
+            </summary>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.getRowCount(System.String)">
+            <summary>
+            获取指定表的记录的条数 ,不带条件
+            </summary>
+            <param name="TableName"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.getFieldsDataByCondition(System.String,System.String[],System.String)">
+            <summary>
+            通过表名和获取单行的记录
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.InsertDataTable(System.Data.DataTable,System.String)">
+            <summary>
+            将DataTable导入到指定的表中
+            </summary>
+            <param name="DataTable"></param>
+            <param name="TableName"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.getFieldsDatasByPageing(System.String,System.String,System.Int32,System.Int32,System.String,System.String[])">
+            <summary>
+            按分页获取数据
+            </summary>
+            <param name="TableName">表名</param>
+            <param name="Fields">查询字段</param>
+            <param name="CurrentPage">当前页面</param>
+            <param name="PageSize">页面展示条数</param>
+            <param name="Caller"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.getFieldsDatasByCondition(System.String,System.String[],System.String)">
+            <summary>
+            通过表名,字段和条件获取DataTable类型的数据
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.getFieldsDatas(System.String,System.String)">
+            <summary>
+            通过表名,字段获取DataTable类型的数据
+            </summary>
+        </member>
+        <member name="M:MES接口.DataHelper.UpDateTableByCondition(System.Data.DataTable,System.String,System.String,System.String[])">
+            <summary>
+            根据DataTable和指定的表名更新数据,如果需要保存新增的数据则需要传递一条Insert的SQL
+            </summary>
+            <param name="DataTable"></param>
+            <param name="TableName"></param>
+            <param name="Condition"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.GetDbFindDataTable(System.String,System.String)">
+            <summary>
+            获取DbFind的数据的DataTable的结构
+            </summary>
+            <param name="field"></param>
+            <param name="caller"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.GetConfigureData(System.String,System.String,System.String)">
+            <summary>
+             获取配置列表中的数据,支持DaatList,Form,DetailGrid
+            </summary>
+            <param name="Caller"></param>
+            <param name="Type"></param>
+            <param name="condition"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.GetConfigureData(System.String,System.String)">
+            <summary>
+            查询配置的字段,Type是查询DataList,Form还是DetailGrid
+            </summary>
+            <param name="Caller"></param>
+            <param name="Type"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.CheckExist(System.String,System.String)">
+            <summary>
+            检测内容是否存在
+            </summary>
+            <param name="TableName"></param>
+            <param name="Condition"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.ExecuteSql(System.String,System.String,System.Object[])">
+            <summary>
+            直接执行SQL,同时传入SQL的类型
+            </summary>
+            <param name="SQL"></param>
+            <param name="Type"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.CheckSQL(System.String)">
+            <summary>
+            为了同步BS端的条码维护,检测时允许问号的存在,在检测时默认将问号换成:Param参数
+            </summary>
+            <param name="SQL"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.GetSerialNumberByCaller(System.String)">
+            <summary>
+            根据Caller获取流水号
+            </summary>
+            <param name="Caller"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.DeleteDataByID(System.String,System.String,System.String[])">
+            <summary>
+            根据主键ID删除表的数据
+            </summary>
+            <param name="TableName">表名</param>
+            <param name="ID">主键</param>
+            <param name="DeleteID">需要删除主键ID的数组</param>
+        </member>
+        <member name="M:MES接口.DataHelper.GetSEQ(System.String)">
+            <summary>
+            通过序列的名称获取序列
+            </summary>
+            <param name="SeqName"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.BatchInsert(System.String,System.Object[][])">
+            <summary>
+            批量通过SQL来执行插入操作 ,参数的第一个数一个string[]数组,用来传递需要添加的参数的名称
+            之后的是名称参数数组对应的 ,所有的插入参数数据长度必须是一致的
+            </summary>
+            <param name="sql"></param>
+            <param name="names"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.GetDataList(System.String,System.String)">
+            <summary>
+            查询DataList配置的字段
+            </summary>
+            <param name="TableName"></param>
+            <param name="Caller"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.GetConfig(System.String,System.String)">
+            <summary>
+            取Configs表中的配置,进行该客户是否执行某个操作
+            </summary>
+            <param name="Code"></param>
+            <param name="Caller"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.UpdateByCondition(System.String,System.String,System.String)">
+            <summary>
+            通过条件更新
+            </summary>
+            <param name="TableName"></param>
+            <param name="update"></param>
+            <param name="condition"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.CallProcedure(System.String,System.String[])">
+            <summary>
+            调用存储过程
+            </summary>
+            <param name="ProcedureName"></param>
+            <param name="param"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.ExecuteSQLTran(System.String[])">
+            <summary>
+            出现异常进行回滚的执行方法
+            </summary>
+            <param name="SQL"></param>
+        </member>
+        <member name="M:MES接口.DataHelper.AddField(System.String[])">
+            <summary>
+            用于将string 的数组转换成SQL的查询内容
+            </summary>
+            <param name="Fields"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.GetCaptionFromField(System.String)">
+            <summary>
+            通过查询的内容获取到字段的描述
+            </summary>
+            <param name="field"></param>
+            <returns></returns>
+        </member>
+        <member name="M:MES接口.DataHelper.GetField(System.String)">
+            <summary>
+            通过查询的语句获取查询的字段
+            </summary>
+            <param name="field"></param>
+            <returns></returns>
+        </member>
+    </members>
+</doc>

BIN
TestProject/tool/MES接口.dll


BIN
TestProject/tool/Oracle.ManagedDataAccess.dll


+ 45 - 0
UAS-MES/App.config

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="UAS_MES.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+    </sectionGroup>
+    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="UAS_MES.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+  <connectionStrings>
+    <add name="MES" connectionString="Password=select!#%*(;User ID=UAS_MES;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.17.158.219)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));" />
+  </connectionStrings>
+  <startup useLegacyV2RuntimeActivationPolicy="true"> 
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
+    <supportedRuntime version="v2.0.50727" />
+  </startup>
+  <userSettings>
+    <UAS_MES.Properties.Settings>
+      <setting name="ProjectName" serializeAs="String">
+        <value>优软科技MES</value>
+      </setting>
+      <setting name="LastLoginUser" serializeAs="String">
+        <value />
+      </setting>
+      <setting name="FTPAddress" serializeAs="String">
+        <value>ftp://192.168.253.9/MESSetting/|mesconfig|Administrator1@#</value>
+      </setting>
+      <setting name="LastLoginSob" serializeAs="String">
+        <value />
+      </setting>
+      <setting name="LastLoginResource" serializeAs="String">
+        <value />
+      </setting>
+    </UAS_MES.Properties.Settings>
+  </userSettings>
+  <applicationSettings>
+    <UAS_MES.Properties.Settings>
+      <setting name="MES" serializeAs="String">
+        <value>Password=select!#%*(;User ID=UAS_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.17.158.219)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+      </setting>
+    </UAS_MES.Properties.Settings>
+  </applicationSettings>
+</configuration>

+ 339 - 0
UAS-MES/BarTender.Designer.cs

@@ -0,0 +1,339 @@
+namespace 优软MES
+{
+   partial class BarTender
+   {
+      /// <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()
+      {
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+            this.txtFolderPath = new System.Windows.Forms.TextBox();
+            this.btnOpen = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.substringGrid = new System.Windows.Forms.DataGridView();
+            this.label2 = new System.Windows.Forms.Label();
+            this.cboPrinters = new System.Windows.Forms.ComboBox();
+            this.btnPrint = new System.Windows.Forms.Button();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.txtIdenticalCopies = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.txtSerializedCopies = new System.Windows.Forms.TextBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.lstLabelBrowser = new System.Windows.Forms.ListView();
+            this.thumbnailCacheWorker = new System.ComponentModel.BackgroundWorker();
+            this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
+            this.picUpdatingFormat = new System.Windows.Forms.PictureBox();
+            this.lblNoSubstrings = new System.Windows.Forms.Label();
+            this.lblFormatError = new System.Windows.Forms.Label();
+            this.headBar1 = new 优软MES.CustomControl.HeadBar();
+            ((System.ComponentModel.ISupportInitialize)(this.substringGrid)).BeginInit();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.picUpdatingFormat)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // txtFolderPath
+            // 
+            this.txtFolderPath.Location = new System.Drawing.Point(99, 46);
+            this.txtFolderPath.Name = "txtFolderPath";
+            this.txtFolderPath.ReadOnly = true;
+            this.txtFolderPath.Size = new System.Drawing.Size(315, 21);
+            this.txtFolderPath.TabIndex = 8;
+            // 
+            // btnOpen
+            // 
+            this.btnOpen.Location = new System.Drawing.Point(420, 47);
+            this.btnOpen.Name = "btnOpen";
+            this.btnOpen.Size = new System.Drawing.Size(75, 21);
+            this.btnOpen.TabIndex = 0;
+            this.btnOpen.Text = "打开";
+            this.btnOpen.UseVisualStyleBackColor = true;
+            this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(17, 49);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(77, 12);
+            this.label1.TabIndex = 7;
+            this.label1.Text = "选择文件夹:";
+            // 
+            // substringGrid
+            // 
+            this.substringGrid.AllowUserToAddRows = false;
+            this.substringGrid.AllowUserToDeleteRows = false;
+            this.substringGrid.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+            this.substringGrid.BackgroundColor = System.Drawing.Color.White;
+            this.substringGrid.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.substringGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+            this.substringGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.substringGrid.DefaultCellStyle = dataGridViewCellStyle2;
+            this.substringGrid.Location = new System.Drawing.Point(504, 72);
+            this.substringGrid.MultiSelect = false;
+            this.substringGrid.Name = "substringGrid";
+            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.substringGrid.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
+            this.substringGrid.Size = new System.Drawing.Size(389, 300);
+            this.substringGrid.TabIndex = 3;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(504, 51);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(65, 12);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "具名数据源";
+            // 
+            // cboPrinters
+            // 
+            this.cboPrinters.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cboPrinters.FormattingEnabled = true;
+            this.cboPrinters.Location = new System.Drawing.Point(98, 17);
+            this.cboPrinters.Name = "cboPrinters";
+            this.cboPrinters.Size = new System.Drawing.Size(282, 20);
+            this.cboPrinters.Sorted = true;
+            this.cboPrinters.TabIndex = 1;
+            // 
+            // btnPrint
+            // 
+            this.btnPrint.Enabled = false;
+            this.btnPrint.Location = new System.Drawing.Point(306, 63);
+            this.btnPrint.Name = "btnPrint";
+            this.btnPrint.Size = new System.Drawing.Size(75, 21);
+            this.btnPrint.TabIndex = 6;
+            this.btnPrint.Text = "打印";
+            this.btnPrint.UseVisualStyleBackColor = true;
+            this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 19);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(77, 12);
+            this.label3.TabIndex = 0;
+            this.label3.Text = "选择打印机:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 44);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(65, 12);
+            this.label4.TabIndex = 2;
+            this.label4.Text = "打印份数:";
+            // 
+            // txtIdenticalCopies
+            // 
+            this.txtIdenticalCopies.Location = new System.Drawing.Point(98, 42);
+            this.txtIdenticalCopies.Name = "txtIdenticalCopies";
+            this.txtIdenticalCopies.ReadOnly = true;
+            this.txtIdenticalCopies.Size = new System.Drawing.Size(112, 21);
+            this.txtIdenticalCopies.TabIndex = 3;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 68);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(113, 12);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "&Serialized Copies:";
+            // 
+            // txtSerializedCopies
+            // 
+            this.txtSerializedCopies.Location = new System.Drawing.Point(98, 66);
+            this.txtSerializedCopies.Name = "txtSerializedCopies";
+            this.txtSerializedCopies.ReadOnly = true;
+            this.txtSerializedCopies.Size = new System.Drawing.Size(112, 21);
+            this.txtSerializedCopies.TabIndex = 5;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.txtIdenticalCopies);
+            this.groupBox1.Controls.Add(this.label5);
+            this.groupBox1.Controls.Add(this.txtSerializedCopies);
+            this.groupBox1.Controls.Add(this.label4);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.btnPrint);
+            this.groupBox1.Controls.Add(this.cboPrinters);
+            this.groupBox1.Location = new System.Drawing.Point(504, 378);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(389, 91);
+            this.groupBox1.TabIndex = 6;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "打印工作区";
+            // 
+            // lstLabelBrowser
+            // 
+            this.lstLabelBrowser.BackColor = System.Drawing.Color.White;
+            this.lstLabelBrowser.HideSelection = false;
+            this.lstLabelBrowser.Location = new System.Drawing.Point(20, 72);
+            this.lstLabelBrowser.MultiSelect = false;
+            this.lstLabelBrowser.Name = "lstLabelBrowser";
+            this.lstLabelBrowser.Size = new System.Drawing.Size(475, 397);
+            this.lstLabelBrowser.TabIndex = 1;
+            this.lstLabelBrowser.UseCompatibleStateImageBehavior = false;
+            this.lstLabelBrowser.VirtualMode = true;
+            this.lstLabelBrowser.CacheVirtualItems += new System.Windows.Forms.CacheVirtualItemsEventHandler(this.lstLabelBrowser_CacheVirtualItems);
+            this.lstLabelBrowser.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lstLabelBrowser_RetrieveVirtualItem);
+            this.lstLabelBrowser.SelectedIndexChanged += new System.EventHandler(this.lstLabelBrowser_SelectedIndexChanged);
+            // 
+            // thumbnailCacheWorker
+            // 
+            this.thumbnailCacheWorker.WorkerReportsProgress = true;
+            this.thumbnailCacheWorker.WorkerSupportsCancellation = true;
+            this.thumbnailCacheWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.thumbnailCacheWorker_DoWork);
+            this.thumbnailCacheWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.thumbnailCacheWorker_ProgressChanged);
+            // 
+            // folderBrowserDialog
+            // 
+            this.folderBrowserDialog.ShowNewFolderButton = false;
+            // 
+            // picUpdatingFormat
+            // 
+            this.picUpdatingFormat.BackColor = System.Drawing.Color.White;
+            this.picUpdatingFormat.Image = global::优软MES.Properties.Resources.updating;
+            this.picUpdatingFormat.Location = new System.Drawing.Point(688, 221);
+            this.picUpdatingFormat.Name = "picUpdatingFormat";
+            this.picUpdatingFormat.Size = new System.Drawing.Size(28, 23);
+            this.picUpdatingFormat.TabIndex = 34;
+            this.picUpdatingFormat.TabStop = false;
+            this.picUpdatingFormat.Visible = false;
+            // 
+            // lblNoSubstrings
+            // 
+            this.lblNoSubstrings.AutoSize = true;
+            this.lblNoSubstrings.BackColor = System.Drawing.Color.White;
+            this.lblNoSubstrings.Location = new System.Drawing.Point(631, 183);
+            this.lblNoSubstrings.Name = "lblNoSubstrings";
+            this.lblNoSubstrings.Size = new System.Drawing.Size(125, 12);
+            this.lblNoSubstrings.TabIndex = 4;
+            this.lblNoSubstrings.Text = "当前文件不存在数据源";
+            this.lblNoSubstrings.Visible = false;
+            // 
+            // lblFormatError
+            // 
+            this.lblFormatError.AutoSize = true;
+            this.lblFormatError.BackColor = System.Drawing.Color.White;
+            this.lblFormatError.Location = new System.Drawing.Point(675, 206);
+            this.lblFormatError.Name = "lblFormatError";
+            this.lblFormatError.Size = new System.Drawing.Size(53, 12);
+            this.lblFormatError.TabIndex = 5;
+            this.lblFormatError.Text = "打开错误";
+            this.lblFormatError.Visible = false;
+            // 
+            // headBar1
+            // 
+            this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.headBar1.Location = new System.Drawing.Point(0, 0);
+            this.headBar1.Name = "headBar1";
+            this.headBar1.Size = new System.Drawing.Size(919, 32);
+            this.headBar1.TabIndex = 35;
+            this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
+            // 
+            // BarTender
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(919, 493);
+            this.Controls.Add(this.headBar1);
+            this.Controls.Add(this.lblFormatError);
+            this.Controls.Add(this.lblNoSubstrings);
+            this.Controls.Add(this.picUpdatingFormat);
+            this.Controls.Add(this.lstLabelBrowser);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.substringGrid);
+            this.Controls.Add(this.txtFolderPath);
+            this.Controls.Add(this.btnOpen);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.MaximizeBox = false;
+            this.Name = "BarTender";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "标签打印";
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.LabelPrint_FormClosed);
+            this.Load += new System.EventHandler(this.LabelPrint_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.substringGrid)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.picUpdatingFormat)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+      }
+
+      #endregion
+
+      private System.Windows.Forms.TextBox txtFolderPath;
+      private System.Windows.Forms.Button btnOpen;
+      private System.Windows.Forms.Label label1;
+      private System.Windows.Forms.DataGridView substringGrid;
+      private System.Windows.Forms.Label label2;
+      private System.Windows.Forms.ComboBox cboPrinters;
+      private System.Windows.Forms.Button btnPrint;
+      private System.Windows.Forms.Label label3;
+      private System.Windows.Forms.Label label4;
+      private System.Windows.Forms.TextBox txtIdenticalCopies;
+      private System.Windows.Forms.Label label5;
+      private System.Windows.Forms.TextBox txtSerializedCopies;
+      private System.Windows.Forms.GroupBox groupBox1;
+      private System.Windows.Forms.ListView lstLabelBrowser;
+      private System.ComponentModel.BackgroundWorker thumbnailCacheWorker;
+      private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog;
+      private System.Windows.Forms.PictureBox picUpdatingFormat;
+      private System.Windows.Forms.Label lblNoSubstrings;
+      private System.Windows.Forms.Label lblFormatError;
+        private CustomControl.HeadBar headBar1;
+    }
+}
+

+ 562 - 0
UAS-MES/BarTender.cs

@@ -0,0 +1,562 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+using Seagull.BarTender.Print;
+using System.Data;
+using System.Runtime.InteropServices;
+
+namespace MES接口
+{
+    public partial class BarTender : Form
+   {
+      #region Fields
+      // Common strings.
+      //format.BaseName 获取当前文件名,不包括后缀
+      //format.Title 获取全部文件名,包括后缀
+      //format.Status 文件是否被加载
+      [DllImport("user32.dll")]
+      public static extern bool ReleaseCapture();
+      [DllImport("user32.dll")]
+      public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+      public const int WM_SYSCOMMAND = 0x0112;
+      public const int SC_MOVE = 0xF010;
+      public const int HTCAPTION = 0x0002;
+
+      private const string appName = "Label Print";
+      private const string dataSourced = "Data Sourced";
+      private Engine engine = null; // 新建打印机引擎
+      private LabelFormatDocument format = null; // 当前打开的BTW文件对象
+      private bool isClosing = false; // 正在关闭时此选项设置为true,会阻止缩略图加载.
+
+      // 标签预览
+      private string[] browsingFormats; // 当前选取的文件夹下的Btw文件
+      Hashtable listItems; // A hash table containing ListViewItems and indexed by format name.
+                           // It keeps track of what formats have had their image loaded.
+      Queue<int> generationQueue; // A queue containing indexes into browsingFormats
+                                  // to facilitate the generation of thumbnails
+
+      // 预览文件的索引
+      int topIndex; // The top visible index in the lstLabelBrowser
+      int selectedIndex; // 预览框选中文件的索引
+      #endregion
+
+      #region Enumerations
+      // Indexes into our image list for the label browser.
+      enum ImageIndex { LoadingFormatImage = 0, FailureToLoadFormatImage = 1 };
+      #endregion
+
+      #region Constructor
+      /// <summary>
+      /// 构造函数初始化
+      /// </summary>
+      public BarTender()
+      {
+         InitializeComponent();
+      }
+      #endregion
+
+      #region Delegates
+      delegate void DelegateShowMessageBox(string message);
+      #endregion
+
+      #region Event Handlers
+      #region Form Event Handlers
+      /// <summary>
+      /// 页面启动的时候执行,和打印机进行连接
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void LabelPrint_Load(object sender, EventArgs e)
+      {
+         this.headBar1.MouseDown += new MouseEventHandler(this.headBar1_MouseDown);
+            // 创建一个打印机进程
+         try
+         {
+            engine = new Engine(true);
+         }
+         catch (PrintEngineException exception)
+         {
+            // 不能打印进程返回错误信息直接退出程序
+            MessageBox.Show(this, exception.Message, appName);
+            this.Close(); 
+            return;
+         }
+
+         // 获取打印机列表
+         Printers printers = new Printers();
+         foreach (Printer printer in printers)
+         {
+            cboPrinters.Items.Add(printer.PrinterName);
+         }
+
+         if (printers.Count > 0)
+         {
+            // 设置下拉框选中默认打印机
+            cboPrinters.SelectedItem = printers.Default.PrinterName;
+         }
+
+         // 设置预览框中的图标
+         lstLabelBrowser.View = View.LargeIcon;
+         lstLabelBrowser.LargeImageList = new ImageList();
+         lstLabelBrowser.LargeImageList.ImageSize = new Size(100, 100);
+         lstLabelBrowser.LargeImageList.Images.Add(Properties.Resources.LoadingFormat);
+         lstLabelBrowser.LargeImageList.Images.Add(Properties.Resources.LoadingError);
+
+         // 初始化一个队列
+         listItems = new Hashtable();
+         generationQueue = new Queue<int>();
+
+         //设置打印份数的最大值
+         txtIdenticalCopies.MaxLength = 9;
+         txtSerializedCopies.MaxLength = 9;
+      }
+
+      /// <summary>
+      /// 关闭窗口的时候执行该方法
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void LabelPrint_FormClosed(object sender, FormClosedEventArgs e)
+      {
+         isClosing = true;
+
+         // 关闭窗口之前向后台请求取消尚未打印的内容 
+         thumbnailCacheWorker.CancelAsync();
+         while (thumbnailCacheWorker.IsBusy)
+         {
+            Application.DoEvents();
+         };
+
+         // 如果已经启动了打印机,停止打印机并且不保存修改的文件SubString
+         if (engine != null)
+            engine.Stop(SaveOptions.DoNotSaveChanges);
+      }
+
+      /// <summary>
+      ///打开文件夹的时候,选择该文件夹下面后缀名为.BTW的文件进行显示
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void btnOpen_Click(object sender, EventArgs e)
+      {
+         //选择文件的时提示的描述
+         folderBrowserDialog.Description = "选择一个包含打印文件(*.BTW)的文件夹";
+         DialogResult result = folderBrowserDialog.ShowDialog();
+         if (result == DialogResult.OK)
+         {
+            lock (generationQueue)
+            {
+               generationQueue.Clear();
+            }
+            //清空之前选择的内容
+            listItems.Clear();
+            //将文件夹的路径赋值给TextBox
+            txtFolderPath.Text = folderBrowserDialog.SelectedPath;
+            //为选取的时候打印按钮为Disabled
+            btnPrint.Enabled = false;
+            //读取该文件夹下面的BTW文件,browsingFormats是文件名的字符串数组
+            browsingFormats = System.IO.Directory.GetFiles(txtFolderPath.Text, "*.btw");
+
+            // ListView序列化的长度
+            lstLabelBrowser.VirtualListSize = browsingFormats.Length;
+         }
+      }
+
+      /// <summary>
+      /// 点击打印按钮的时候执行
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void btnPrint_Click(object sender, EventArgs e)
+      {
+         // 正在打印的时候锁定该进程
+         // 用户点击也不展示SubString
+         lock (engine)
+         {
+            bool success = true;
+            // 设置打印参数
+            if (format.PrintSetup.SupportsIdenticalCopies)
+            {   
+               int copies = 1;
+               success = Int32.TryParse(txtIdenticalCopies.Text, out copies) && (copies >= 1);
+               if (!success)
+                  MessageBox.Show(this, "打印的份数必须大于1的整数", appName);
+               else
+               {
+                  format.PrintSetup.IdenticalCopiesOfLabel = copies;
+               }
+            }
+            // 数据源是数据库的时候
+            // Assign number of serialized copies if it is not datasourced.
+            if (success && (format.PrintSetup.SupportsSerializedLabels))
+            {
+               int copies = 1;
+               success = int.TryParse(txtSerializedCopies.Text, out copies) && (copies >= 1);
+               if (!success)
+               {
+                  MessageBox.Show(this, "打印份数必须是大于1的数字", appName);
+               }
+               else
+               {
+                  format.PrintSetup.NumberOfSerializedLabels = copies;
+               }
+            }
+
+            // 所有的验证条件通过执行打印
+            if (success)
+            {
+               Cursor.Current = Cursors.WaitCursor;
+
+               // 选择打印机的名称
+               if (cboPrinters.SelectedItem != null)
+                  format.PrintSetup.PrinterName = cboPrinters.SelectedItem.ToString();
+
+                    //int waitForCompletionTimeout = 10000; // 10 seconds
+                    //Result result = format.Print(appName, waitForCompletionTimeout, out messages);
+                    //string messageString = "\n\nMessages:";
+
+                    //foreach (Seagull.BarTender.Print.Message message in messages)
+                    //{
+                    //   messageString += "\n\n" + message.Text;
+                    //}
+
+                    //if (result == Result.Failure)
+                    //   MessageBox.Show(this, "Print Failed" + messageString, appName);
+                    //else
+                    //   MessageBox.Show(this, "Label was successfully sent to printer." + messageString, appName);
+                }
+         }
+      }
+      #endregion
+
+      #region List View Event Handlers
+      /// <summary>
+      /// 选中预览文件的时候读取SubString
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void lstLabelBrowser_SelectedIndexChanged(object sender, EventArgs e)
+      {
+         if (lstLabelBrowser.SelectedIndices.Count == 1)
+         {
+            selectedIndex = lstLabelBrowser.SelectedIndices[0];
+            EnableControls(false);
+            picUpdatingFormat.Visible = true;
+
+            // 启动后台加载函数读取内容
+            // 读取到的数据显示在DataGridView当中
+            BackgroundWorker formatLoader = new BackgroundWorker();
+            formatLoader.DoWork += new DoWorkEventHandler(formatLoader_DoWork);
+            formatLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(formatLoader_RunWorkerCompleted);
+            formatLoader.RunWorkerAsync(selectedIndex);
+         }
+         else if (lstLabelBrowser.SelectedIndices.Count == 0)
+         {
+            EnableControls(false);
+            picUpdatingFormat.Visible = false;
+         }
+      }
+      /// <summary>
+      /// 读取完文件夹的时候展示问价在该区域
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      private void lstLabelBrowser_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
+      {
+         int btwFileIndex = e.ItemIndex;
+
+         //如果不存在这个项目则设置成默认的图片
+         if (listItems[browsingFormats[btwFileIndex]] == null)
+         {
+            e.Item = new ListViewItem(browsingFormats[btwFileIndex]);
+            e.Item.ImageIndex = (int)ImageIndex.LoadingFormatImage;
+            listItems.Add(browsingFormats[btwFileIndex], e.Item);
+         }
+         else
+         {
+            e.Item = (ListViewItem)listItems[browsingFormats[btwFileIndex]];
+         }
+
+         // 将索引添加到队列.
+         if (e.Item.ImageIndex == (int)ImageIndex.LoadingFormatImage)
+         {
+            lock (generationQueue)
+            {
+               if (!generationQueue.Contains(btwFileIndex))
+                  generationQueue.Enqueue(btwFileIndex);
+            }
+         }
+
+         // 将东西放进队列的时候,如果队列没有被占用则开始执行任务
+         if (!thumbnailCacheWorker.IsBusy && (generationQueue.Count > 0))
+         {
+            thumbnailCacheWorker.RunWorkerAsync();
+         }
+      }
+
+      /// <summary>
+      /// 缓存读取的文件列表
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="cacheEvent"></param>
+      private void lstLabelBrowser_CacheVirtualItems(object sender, CacheVirtualItemsEventArgs cacheEvent)
+      {
+         topIndex = cacheEvent.StartIndex;
+
+         lock (generationQueue)
+         {
+            for (int index = cacheEvent.StartIndex; index <= cacheEvent.EndIndex; ++index)
+            {
+               ListViewItem listViewItem = (ListViewItem)listItems[browsingFormats[index]];
+
+               if ((listViewItem != null) && (listViewItem.ImageIndex == (int)ImageIndex.LoadingFormatImage))
+               {
+                  if (!generationQueue.Contains(index))
+                     generationQueue.Enqueue(index);
+               }
+            }
+         }
+
+         // 任务资源可用的时候执行
+         if (!thumbnailCacheWorker.IsBusy && (generationQueue.Count > 0))
+         {
+            thumbnailCacheWorker.RunWorkerAsync();
+         }
+      }
+      #endregion
+
+      #region Thumbnail Event Handlers
+      /// <summary>
+      /// Called when a thumbnail was loaded so it can be shown.
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      void thumbnailCacheWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
+      {
+         object[] args = e.UserState as object[];
+           
+         ListViewItem item = (ListViewItem)args[0];
+
+         // 100 means we got the image successfully.
+         if (e.ProgressPercentage == 100)
+         {
+            Image thumbnail = (Image)args[1];
+            lstLabelBrowser.LargeImageList.Images.Add(item.Text, thumbnail);
+            item.ImageIndex = lstLabelBrowser.LargeImageList.Images.IndexOfKey(item.Text);
+         }
+         else if (e.ProgressPercentage == 0) // 0 means we did not successfully get the format image.
+         {
+            item.ImageIndex = (int)ImageIndex.FailureToLoadFormatImage;
+         }
+         item.ListView.Invalidate(item.Bounds);
+      }
+
+      /// <summary>
+      /// 后台启用函数加载缩略图
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      void thumbnailCacheWorker_DoWork(object sender, DoWorkEventArgs e)
+      {
+         BackgroundWorker worker = (BackgroundWorker)sender;
+
+         int index;
+         string fileName;
+
+         // Loop until the queue of items that need to be loaded is empty or the worker was cancelled.
+         while ((generationQueue.Count > 0) && !worker.CancellationPending && !isClosing)
+         {
+            lock (generationQueue)
+            {
+               // Get the index to use.
+               index = generationQueue.Dequeue();
+            }
+            
+            // If this is way out of our view don't bother generating it.
+            if (Math.Abs(index - topIndex) < 30)
+            {
+               fileName = browsingFormats[index];
+
+               // 检查文件是否出缩略图外都已经加载完成了
+               ListViewItem item = (ListViewItem)listItems[fileName];
+               if (item == null)
+               {
+                  item = new ListViewItem(fileName);
+                  item.ImageIndex = (int)ImageIndex.LoadingFormatImage;
+                  listItems.Add(fileName, item);
+               }
+
+               // 没有缩略图的时候就给个默认的
+               if (item.ImageIndex == (int)ImageIndex.LoadingFormatImage)
+               {
+                  try
+                  {
+                     Console.WriteLine(fileName);
+                     Image btwImage = LabelFormatThumbnail.Create(fileName, Color.Gray, 100, 100);
+
+                     object[] progressReport = new object[] { item, btwImage };
+                     worker.ReportProgress(100, progressReport);
+                  }
+                  catch
+                  {
+                     object[] progressReport = new object[] { item, null };
+                     worker.ReportProgress(0, progressReport);
+                  }
+               }
+            }
+         }
+      }
+      #endregion
+
+      #region Format Loader Event Handlers
+      /// <summary>
+      ///在另一个进程中进行文件的读取,不用占用当前的界面
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      void formatLoader_DoWork(object sender, DoWorkEventArgs e)
+      {
+         int index = (int)e.Argument;
+         string errorMessage = "";
+
+         // 确保安全先锁定打印机,因为可能正在执行打印任务
+         lock (engine)
+         {
+            //确保用户选中该列表
+            if (selectedIndex == index)
+            {
+               try
+               {
+                  if (format != null)
+                  //是否保存对文件的编辑
+                  format.Close(SaveOptions.SaveChanges);
+                  format = engine.Documents.Open(browsingFormats[index]);
+               }
+               catch (System.Runtime.InteropServices.COMException comException)
+               {
+                  errorMessage = String.Format("Unable to open format: {0}\nReason: {1}", browsingFormats[index], comException.Message);
+                  format = null;
+               }
+            }
+         }
+         // 后台执行只能调用MessageBox来显示信息
+         if (errorMessage.Length != 0)
+            Invoke(new DelegateShowMessageBox(ShowMessageBox), errorMessage);
+      }
+
+      /// <summary>
+      /// 文件加载完的时候执行
+      /// 填充打印份数默认值为1,如果存在SubString则读取出来
+      /// </summary>
+      /// <param name="sender"></param>
+      /// <param name="e"></param>
+      void formatLoader_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+      {
+         // 确保正在操作的时候不会丢失该文件
+         lock (engine)
+         {
+            if (format != null)
+            {
+               EnableControls(true);
+               cboPrinters.SelectedItem = format.PrintSetup.PrinterName;
+               picUpdatingFormat.Visible = false;
+               lblFormatError.Visible = false;
+
+               //支持打印多份的时候
+               if (format.PrintSetup.SupportsIdenticalCopies == false)
+               {
+                  txtIdenticalCopies.Text = dataSourced;
+                  txtIdenticalCopies.ReadOnly = true;
+               }
+               else
+               {
+                  txtIdenticalCopies.Text = format.PrintSetup.IdenticalCopiesOfLabel.ToString();
+                  txtIdenticalCopies.ReadOnly = false;
+               }
+
+               //数据源是数据库的时候 
+               if (format.PrintSetup.SupportsSerializedLabels == false)
+               {
+                  txtSerializedCopies.Text = dataSourced;
+                  txtSerializedCopies.ReadOnly = true;
+               }
+               else
+               {
+                  txtSerializedCopies.Text = format.PrintSetup.NumberOfSerializedLabels.ToString();
+                  txtSerializedCopies.ReadOnly = false;
+               }
+                    //DataTable dt = new DataTable();
+                    //DataRow row = dt.NewRow();
+                    //dt.Columns.Add(new DataColumn("name"));
+                    //dt.Columns.Add(new DataColumn("sex"));
+                    //dt.Columns.Add(new DataColumn("age"));
+                    //row["name"] = "John";
+                    //row["sex"] = "Smith";
+                    //row["age"] = "18";
+                    //dt.Rows.Add(row);
+                    //MessageBox.Show(format.SubStrings[0].Name);
+                    //获取具名数据源
+                    if (format.SubStrings.Count > 0){
+                  BindingSource bindingSource = new BindingSource();
+                  bindingSource.DataSource = format.SubStrings;
+                  substringGrid.DataSource = bindingSource;
+                  substringGrid.AutoResizeColumns();
+                  lblNoSubstrings.Visible = false;
+               }else{
+                  lblNoSubstrings.Visible = true;
+               }
+               substringGrid.Invalidate();
+            }
+            else // 没有文件的时候,隐藏标签信息
+            {
+               picUpdatingFormat.Visible = false;
+               lblNoSubstrings.Visible = false;
+               lblFormatError.Visible = true;
+            }
+         }
+      }
+      #endregion
+      #endregion
+
+      #region Methods
+      /// <summary>
+      ///打开的文件无效禁用所有的控件
+      /// </summary>
+      /// <param name="enable"></param>
+      void EnableControls(bool enable)
+      {
+         txtIdenticalCopies.Enabled = enable;
+         txtSerializedCopies.Enabled = enable;
+         btnPrint.Enabled = enable;
+
+         if (!enable)
+         {
+            txtIdenticalCopies.Text = "";
+            txtSerializedCopies.Text = "";
+            substringGrid.DataSource = null;
+            lblFormatError.Visible = false;
+            lblNoSubstrings.Visible = false;
+         }
+      }
+
+      /// <summary>
+      /// 重写一个展示消息的方法
+      /// </summary>
+      /// <param name="message">展示的信息</param>
+        void ShowMessageBox(string message)
+        {
+            MessageBox.Show(this, message, appName);
+        }
+
+        #endregion
+
+        private void headBar1_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
+    }
+}

+ 126 - 0
UAS-MES/BarTender.resx

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

+ 224 - 0
UAS-MES/Batch_Generation_Code.Designer.cs

@@ -0,0 +1,224 @@
+namespace 优软MES
+{
+    partial class Batch_Generation_Code
+    {
+        /// <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.Panel0 = new System.Windows.Forms.Panel();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.Screen_Button = new System.Windows.Forms.Button();
+            this.pi_status = new System.Windows.Forms.TextBox();
+            this.wh_code = new 优软MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.pr_code = new 优软MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.pi_inoutno = new 优软MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.timePickerWithCombo1 = new 优软MES.CustomControl.TimePickerWithCombo.TimePickerWithCombo();
+            this.BGC_DataGrid = new 优软MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.Panel0.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.BGC_DataGrid)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // Panel0
+            // 
+            this.Panel0.Controls.Add(this.label5);
+            this.Panel0.Controls.Add(this.label4);
+            this.Panel0.Controls.Add(this.label3);
+            this.Panel0.Controls.Add(this.label2);
+            this.Panel0.Controls.Add(this.label1);
+            this.Panel0.Controls.Add(this.Screen_Button);
+            this.Panel0.Controls.Add(this.pi_status);
+            this.Panel0.Controls.Add(this.wh_code);
+            this.Panel0.Controls.Add(this.pr_code);
+            this.Panel0.Controls.Add(this.pi_inoutno);
+            this.Panel0.Controls.Add(this.timePickerWithCombo1);
+            this.Panel0.Dock = System.Windows.Forms.DockStyle.Top;
+            this.Panel0.Location = new System.Drawing.Point(0, 0);
+            this.Panel0.Name = "Panel0";
+            this.Panel0.Size = new System.Drawing.Size(1448, 161);
+            this.Panel0.TabIndex = 12;
+            this.Panel0.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel0_Paint);
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Location = new System.Drawing.Point(40, 122);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(77, 14);
+            this.label5.TabIndex = 21;
+            this.label5.Text = "物料编号:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(444, 124);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(56, 14);
+            this.label4.TabIndex = 20;
+            this.label4.Text = "仓 库:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(935, 75);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(56, 14);
+            this.label3.TabIndex = 19;
+            this.label3.Text = "状 态:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(444, 75);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(56, 14);
+            this.label2.TabIndex = 18;
+            this.label2.Text = "日 期:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(40, 76);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(77, 14);
+            this.label1.TabIndex = 17;
+            this.label1.Text = "入库单号:";
+            // 
+            // Screen_Button
+            // 
+            this.Screen_Button.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Screen_Button.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Screen_Button.Image = global::优软MES.Properties.Resources._2_0btn_36;
+            this.Screen_Button.Location = new System.Drawing.Point(16, 14);
+            this.Screen_Button.Name = "Screen_Button";
+            this.Screen_Button.Size = new System.Drawing.Size(111, 33);
+            this.Screen_Button.TabIndex = 16;
+            this.Screen_Button.Text = "筛选";
+            this.Screen_Button.UseVisualStyleBackColor = true;
+            this.Screen_Button.Click += new System.EventHandler(this.Screen_Button_Click);
+            // 
+            // pi_status
+            // 
+            this.pi_status.Location = new System.Drawing.Point(1007, 74);
+            this.pi_status.Name = "pi_status";
+            this.pi_status.Size = new System.Drawing.Size(247, 21);
+            this.pi_status.TabIndex = 15;
+            // 
+            // wh_code
+            // 
+            this.wh_code.Caller = null;
+            this.wh_code.FormName = null;
+            this.wh_code.Location = new System.Drawing.Point(517, 120);
+            this.wh_code.Name = "wh_code";
+            this.wh_code.SetValueField = null;
+            this.wh_code.Size = new System.Drawing.Size(247, 21);
+            this.wh_code.TabIndex = 14;
+            // 
+            // pr_code
+            // 
+            this.pr_code.Caller = null;
+            this.pr_code.FormName = null;
+            this.pr_code.Location = new System.Drawing.Point(123, 120);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.SetValueField = null;
+            this.pr_code.Size = new System.Drawing.Size(247, 21);
+            this.pr_code.TabIndex = 13;
+            // 
+            // pi_inoutno
+            // 
+            this.pi_inoutno.Caller = null;
+            this.pi_inoutno.FormName = null;
+            this.pi_inoutno.Location = new System.Drawing.Point(123, 74);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.SetValueField = null;
+            this.pi_inoutno.Size = new System.Drawing.Size(247, 21);
+            this.pi_inoutno.TabIndex = 12;
+            // 
+            // timePickerWithCombo1
+            // 
+            this.timePickerWithCombo1.BeginTime = null;
+            this.timePickerWithCombo1.BeginTimeText = null;
+            this.timePickerWithCombo1.EndTime = null;
+            this.timePickerWithCombo1.EndTimeText = null;
+            this.timePickerWithCombo1.Location = new System.Drawing.Point(517, 75);
+            this.timePickerWithCombo1.Name = "timePickerWithCombo1";
+            this.timePickerWithCombo1.Size = new System.Drawing.Size(376, 22);
+            this.timePickerWithCombo1.TabIndex = 11;
+            // 
+            // BGC_DataGrid
+            // 
+            this.BGC_DataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.BGC_DataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.BGC_DataGrid.Location = new System.Drawing.Point(0, 161);
+            this.BGC_DataGrid.Name = "BGC_DataGrid";
+            this.BGC_DataGrid.RowTemplate.Height = 23;
+            this.BGC_DataGrid.Size = new System.Drawing.Size(1448, 444);
+            this.BGC_DataGrid.TabIndex = 13;
+            this.BGC_DataGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.BGC_DataGrid_CellContentClick);
+            // 
+            // Batch_Generation_Code
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
+            this.ClientSize = new System.Drawing.Size(1448, 605);
+            this.Controls.Add(this.BGC_DataGrid);
+            this.Controls.Add(this.Panel0);
+            this.Name = "Batch_Generation_Code";
+            this.Text = "批量生成条码";
+            this.Load += new System.EventHandler(this.Batch_Generation_Code_Load);
+            this.SizeChanged += new System.EventHandler(this.Batch_Generation_Code_SizeChanged);
+            this.Panel0.ResumeLayout(false);
+            this.Panel0.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.BGC_DataGrid)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Panel Panel0;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button Screen_Button;
+        private System.Windows.Forms.TextBox pi_status;
+        private CustomControl.TextBoxWithIcon.SearchTextBox wh_code;
+        private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
+        private CustomControl.TextBoxWithIcon.SearchTextBox pi_inoutno;
+        private CustomControl.TimePickerWithCombo.TimePickerWithCombo timePickerWithCombo1;
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum BGC_DataGrid;
+    }
+}

+ 123 - 0
UAS-MES/Batch_Generation_Code.cs

@@ -0,0 +1,123 @@
+using System;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using 优软MES.DataOperate;
+using 优软MES.Properties;
+using 优软MES.PublicMethod;
+
+namespace 优软MES
+{
+    public partial class Batch_Generation_Code : Form
+    {
+        string caller = "BarcodeIn!Deal";
+        string formname = "Batch_Generation_Code";
+        string defaultCondition = "pi_statuscode='UNPOST' and nvl(pr_tracekind,0)>0 ";
+        string[] hiddenfield = { };
+        DataHelper dh = new DataHelper();
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        public Batch_Generation_Code()
+        {
+            InitializeComponent();
+            DataTable dt = dh.GetConfigureData(caller, "DataList", defaultCondition);
+            //添加图片列
+            DataGridViewImageColumn ic = new DataGridViewImageColumn();
+            ic.Image = Resources.write_15_893687707641px_1181413_easyicon_net;
+            ic.Width = 40;
+            ic.Name = "操作";
+            ic.ToolTipText = "修改当前行数据";
+            BGC_DataGrid.DataSource = dt;
+            BGC_DataGrid.Columns.Add(ic);
+            //带有DbFind的需要传递Caller 和Form的名称
+            //BaseUtil.HideField(BGC_DataGrid,hiddenfield);
+            pi_inoutno.Caller = caller;
+            pi_inoutno.FormName = formname;
+            pr_code.Caller = caller;
+            pr_code.FormName = formname;
+            wh_code.Caller = caller;
+            wh_code.FormName = formname;
+        }
+
+        private void Screen_Button_Click(object sender, EventArgs e)
+        {
+            string beginTime = timePickerWithCombo1.BeginTime;
+            string endTime = timePickerWithCombo1.EndTime;
+            //因为是自定义控件,所以需要获取控件的子控件,然后再去获取值
+            string pi_inoutno = this.pi_inoutno.Text;
+            string pr_code = this.pr_code.Text;
+            string pd_location = wh_code.Text;
+            string pi_status = this.pi_status.Text;
+            StringBuilder condition = new StringBuilder();
+            if (!string.IsNullOrWhiteSpace(beginTime) && !string.IsNullOrWhiteSpace(endTime))
+            {
+                condition.Append(" to_char(pi_date,'yyyy/MM/dd hh:mm:ss') between '" + beginTime + "' and '" + endTime + "'");
+            }
+            if (!string.IsNullOrEmpty(pi_inoutno))
+            {
+                if (condition.Length == 0)
+                {
+                    condition.Append("  pi_inoutno like '%" + pi_inoutno + "%' ");
+                }
+                else
+                {
+                    condition.Append(" and pi_inoutno like '%" + pi_inoutno + "%'");
+                }
+            }
+            if (!string.IsNullOrEmpty(pr_code))
+            {
+                if (condition.Length == 0)
+                {
+                    condition.Append("  pr_code like '%" + pr_code + "%'");
+                }
+                else
+                {
+                    condition.Append(" and pr_code like '%" + pr_code + "%'");
+                }
+            }
+            if (!string.IsNullOrEmpty(pd_location))
+            {
+                if (condition.Length == 0)
+                {
+                    condition.Append("  pd_whcode like '%" + pd_location + "%'");
+                }
+                else
+                {
+                    condition.Append(" and pd_whcode like '%" + pd_location + "%'");
+                }
+            }
+            if (condition.Length != 0)
+            {
+                BGC_DataGrid.DataSource = dh.GetConfigureData(caller, "DataList", condition.ToString());
+            }
+            else
+            {
+                BGC_DataGrid.DataSource = dh.GetConfigureData(caller, "DataList", defaultCondition);
+            }
+        }
+
+        private void BGC_DataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (BGC_DataGrid.Columns[e.ColumnIndex].Name == "操作")
+            {
+                Batch_Generation_CodeDetail BGCD = new Batch_Generation_CodeDetail(BGC_DataGrid.Rows[e.RowIndex].Cells["ID"].Value.ToString());
+                BGCD.ShowDialog();
+            }
+        }
+
+        private void Batch_Generation_Code_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+        }
+
+        private void Batch_Generation_Code_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Panel0_Paint(object sender, PaintEventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
UAS-MES/Batch_Generation_Code.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>

+ 498 - 0
UAS-MES/Batch_Generation_CodeDetail.Designer.cs

@@ -0,0 +1,498 @@
+namespace 优软MES
+{
+    partial class Batch_Generation_CodeDetail
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Batch_Generation_CodeDetail));
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.Panel0 = new System.Windows.Forms.Panel();
+            this.pd_pdno = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.bi_location_label = new System.Windows.Forms.Label();
+            this.pd_inqty = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.pr_tracekind = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.GenerateCode = new System.Windows.Forms.Button();
+            this.GenerateCodeAndBoxNum = new System.Windows.Forms.Button();
+            this.PrintAllBoxNum = new System.Windows.Forms.Button();
+            this.label10 = new System.Windows.Forms.Label();
+            this.pd_qty = new System.Windows.Forms.TextBox();
+            this.PrintCode = new System.Windows.Forms.Button();
+            this.label9 = new System.Windows.Forms.Label();
+            this.bi_madedate = new System.Windows.Forms.DateTimePicker();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.pr_unit = new System.Windows.Forms.Label();
+            this.pi_title = new System.Windows.Forms.Label();
+            this.pi_cardcode = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pd_prodcode = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.pd_inoutno = new System.Windows.Forms.Label();
+            this.bi_vendbarcode = new System.Windows.Forms.TextBox();
+            this.pr_zxbzs = new System.Windows.Forms.TextBox();
+            this.lable1 = new System.Windows.Forms.Label();
+            this.bi_boxnum = new System.Windows.Forms.TextBox();
+            this.bi_location = new 优软MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+          
+            this.closeButton1 = new 优软MES.CustomControl.ButtonUtil.CloseButton();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            this.Panel0.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.AllowUserToAddRows = false;
+            this.dataGridView1.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.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Location = new System.Drawing.Point(0, 193);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.RowTemplate.Height = 23;
+            this.dataGridView1.Size = new System.Drawing.Size(1278, 367);
+            this.dataGridView1.TabIndex = 2;
+            // 
+            // Panel0
+            // 
+            this.Panel0.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.Panel0.Controls.Add(this.pd_pdno);
+            this.Panel0.Controls.Add(this.label8);
+            this.Panel0.Controls.Add(this.bi_location);
+            this.Panel0.Controls.Add(this.bi_location_label);
+            this.Panel0.Controls.Add(this.pd_inqty);
+            this.Panel0.Controls.Add(this.label13);
+            this.Panel0.Controls.Add(this.pr_tracekind);
+            this.Panel0.Controls.Add(this.label11);
+       
+            this.Panel0.Controls.Add(this.closeButton1);
+            this.Panel0.Controls.Add(this.GenerateCode);
+            this.Panel0.Controls.Add(this.GenerateCodeAndBoxNum);
+            this.Panel0.Controls.Add(this.PrintAllBoxNum);
+            this.Panel0.Controls.Add(this.label10);
+            this.Panel0.Controls.Add(this.pd_qty);
+            this.Panel0.Controls.Add(this.PrintCode);
+            this.Panel0.Controls.Add(this.label9);
+            this.Panel0.Controls.Add(this.bi_madedate);
+            this.Panel0.Controls.Add(this.label7);
+            this.Panel0.Controls.Add(this.label6);
+            this.Panel0.Controls.Add(this.pr_unit);
+            this.Panel0.Controls.Add(this.pi_title);
+            this.Panel0.Controls.Add(this.pi_cardcode);
+            this.Panel0.Controls.Add(this.label5);
+            this.Panel0.Controls.Add(this.label4);
+            this.Panel0.Controls.Add(this.label3);
+            this.Panel0.Controls.Add(this.pr_detail);
+            this.Panel0.Controls.Add(this.pd_prodcode);
+            this.Panel0.Controls.Add(this.label2);
+            this.Panel0.Controls.Add(this.label1);
+            this.Panel0.Controls.Add(this.pd_inoutno);
+            this.Panel0.Controls.Add(this.bi_vendbarcode);
+            this.Panel0.Controls.Add(this.pr_zxbzs);
+            this.Panel0.Controls.Add(this.lable1);
+            this.Panel0.Controls.Add(this.bi_boxnum);
+            this.Panel0.Location = new System.Drawing.Point(0, 0);
+            this.Panel0.Name = "Panel0";
+            this.Panel0.Size = new System.Drawing.Size(1278, 187);
+            this.Panel0.TabIndex = 3;
+            // 
+            // pd_pdno
+            // 
+            this.pd_pdno.AutoSize = true;
+            this.pd_pdno.Location = new System.Drawing.Point(232, 21);
+            this.pd_pdno.Name = "pd_pdno";
+            this.pd_pdno.Size = new System.Drawing.Size(0, 12);
+            this.pd_pdno.TabIndex = 63;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(192, 20);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(41, 12);
+            this.label8.TabIndex = 62;
+            this.label8.Text = "序号:";
+            // 
+            // bi_location_label
+            // 
+            this.bi_location_label.AutoSize = true;
+            this.bi_location_label.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bi_location_label.ForeColor = System.Drawing.Color.Black;
+            this.bi_location_label.Location = new System.Drawing.Point(23, 78);
+            this.bi_location_label.Name = "bi_location_label";
+            this.bi_location_label.Size = new System.Drawing.Size(41, 12);
+            this.bi_location_label.TabIndex = 60;
+            this.bi_location_label.Text = "仓位:";
+            this.bi_location_label.Visible = false;
+            // 
+            // pd_inqty
+            // 
+            this.pd_inqty.AutoSize = true;
+            this.pd_inqty.Location = new System.Drawing.Point(254, 46);
+            this.pd_inqty.Name = "pd_inqty";
+            this.pd_inqty.Size = new System.Drawing.Size(0, 12);
+            this.pd_inqty.TabIndex = 59;
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(192, 46);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(65, 12);
+            this.label13.TabIndex = 58;
+            this.label13.Text = "来料总量:";
+            // 
+            // pr_tracekind
+            // 
+            this.pr_tracekind.AutoSize = true;
+            this.pr_tracekind.Location = new System.Drawing.Point(402, 46);
+            this.pr_tracekind.Name = "pr_tracekind";
+            this.pr_tracekind.Size = new System.Drawing.Size(0, 12);
+            this.pr_tracekind.TabIndex = 57;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(340, 46);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(65, 12);
+            this.label11.TabIndex = 56;
+            this.label11.Text = "管控类型:";
+            // 
+            // GenerateCode
+            // 
+            this.GenerateCode.Image = global::优软MES.Properties.Resources._2_0btn_36;
+            this.GenerateCode.Location = new System.Drawing.Point(309, 146);
+            this.GenerateCode.Name = "GenerateCode";
+            this.GenerateCode.Size = new System.Drawing.Size(111, 26);
+            this.GenerateCode.TabIndex = 52;
+            this.GenerateCode.Text = "批量生成条码";
+            this.GenerateCode.UseVisualStyleBackColor = true;
+            this.GenerateCode.Click += new System.EventHandler(this.GenerateCode_Click);
+            // 
+            // GenerateCodeAndBoxNum
+            // 
+            this.GenerateCodeAndBoxNum.Image = global::优软MES.Properties.Resources._2_0btn_36;
+            this.GenerateCodeAndBoxNum.Location = new System.Drawing.Point(1144, 32);
+            this.GenerateCodeAndBoxNum.Name = "GenerateCodeAndBoxNum";
+            this.GenerateCodeAndBoxNum.Size = new System.Drawing.Size(134, 26);
+            this.GenerateCodeAndBoxNum.TabIndex = 51;
+            this.GenerateCodeAndBoxNum.Text = "批量生成条码和箱号";
+            this.GenerateCodeAndBoxNum.UseVisualStyleBackColor = true;
+            this.GenerateCodeAndBoxNum.Visible = false;
+            this.GenerateCodeAndBoxNum.Click += new System.EventHandler(this.GenerateCodeAndBoxNum_Click);
+            // 
+            // PrintAllBoxNum
+            // 
+            this.PrintAllBoxNum.Image = global::优软MES.Properties.Resources._2_0btn_36;
+            this.PrintAllBoxNum.Location = new System.Drawing.Point(1164, 7);
+            this.PrintAllBoxNum.Name = "PrintAllBoxNum";
+            this.PrintAllBoxNum.Size = new System.Drawing.Size(111, 26);
+            this.PrintAllBoxNum.TabIndex = 50;
+            this.PrintAllBoxNum.Text = "打印全部箱号";
+            this.PrintAllBoxNum.UseVisualStyleBackColor = true;
+            this.PrintAllBoxNum.Visible = false;
+            this.PrintAllBoxNum.Click += new System.EventHandler(this.PrintAllBoxNum_Click);
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.ForeColor = System.Drawing.Color.Red;
+            this.label10.Location = new System.Drawing.Point(926, 78);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(53, 12);
+            this.label10.TabIndex = 48;
+            this.label10.Text = "批总量:";
+            // 
+            // pd_qty
+            // 
+            this.pd_qty.Location = new System.Drawing.Point(1000, 75);
+            this.pd_qty.Name = "pd_qty";
+            this.pd_qty.Size = new System.Drawing.Size(117, 21);
+            this.pd_qty.TabIndex = 47;
+            // 
+            // PrintCode
+            // 
+            this.PrintCode.Image = global::优软MES.Properties.Resources._2_0btn_36;
+            this.PrintCode.Location = new System.Drawing.Point(478, 146);
+            this.PrintCode.Name = "PrintCode";
+            this.PrintCode.Size = new System.Drawing.Size(111, 26);
+            this.PrintCode.TabIndex = 46;
+            this.PrintCode.Text = "打印条码";
+            this.PrintCode.UseVisualStyleBackColor = true;
+            this.PrintCode.Click += new System.EventHandler(this.PrintCode_Click);
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.ForeColor = System.Drawing.Color.Red;
+            this.label9.Location = new System.Drawing.Point(225, 78);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(65, 12);
+            this.label9.TabIndex = 43;
+            this.label9.Text = "最小包数:";
+            // 
+            // bi_madedate
+            // 
+            this.bi_madedate.Location = new System.Drawing.Point(527, 74);
+            this.bi_madedate.Name = "bi_madedate";
+            this.bi_madedate.Size = new System.Drawing.Size(117, 21);
+            this.bi_madedate.TabIndex = 41;
+            this.bi_madedate.ValueChanged += new System.EventHandler(this.bi_prodate_ValueChanged);
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(456, 78);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(65, 12);
+            this.label7.TabIndex = 40;
+            this.label7.Text = "生产日期:";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(690, 80);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(77, 12);
+            this.label6.TabIndex = 39;
+            this.label6.Text = "供应商批号:";
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.AutoSize = true;
+            this.pr_unit.Location = new System.Drawing.Point(520, 20);
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Size = new System.Drawing.Size(0, 12);
+            this.pr_unit.TabIndex = 38;
+            // 
+            // pi_title
+            // 
+            this.pi_title.AutoSize = true;
+            this.pi_title.Location = new System.Drawing.Point(557, 46);
+            this.pi_title.Name = "pi_title";
+            this.pi_title.Size = new System.Drawing.Size(0, 12);
+            this.pi_title.TabIndex = 37;
+            // 
+            // pi_cardcode
+            // 
+            this.pi_cardcode.AutoSize = true;
+            this.pi_cardcode.Location = new System.Drawing.Point(89, 46);
+            this.pi_cardcode.Name = "pi_cardcode";
+            this.pi_cardcode.Size = new System.Drawing.Size(0, 12);
+            this.pi_cardcode.TabIndex = 36;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(480, 46);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(77, 12);
+            this.label5.TabIndex = 35;
+            this.label5.Text = "供应商名称:";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(480, 20);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(41, 12);
+            this.label4.TabIndex = 34;
+            this.label4.Text = "单位:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(19, 46);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(77, 12);
+            this.label3.TabIndex = 33;
+            this.label3.Text = "供应商编号:";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Location = new System.Drawing.Point(654, 20);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 12);
+            this.pr_detail.TabIndex = 32;
+            // 
+            // pd_prodcode
+            // 
+            this.pd_prodcode.AutoSize = true;
+            this.pd_prodcode.Location = new System.Drawing.Point(399, 20);
+            this.pd_prodcode.Name = "pd_prodcode";
+            this.pd_prodcode.Size = new System.Drawing.Size(0, 12);
+            this.pd_prodcode.TabIndex = 31;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(596, 20);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(65, 12);
+            this.label2.TabIndex = 30;
+            this.label2.Text = "物料名称:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(340, 20);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(65, 12);
+            this.label1.TabIndex = 29;
+            this.label1.Text = "物料编号:";
+            // 
+            // pd_inoutno
+            // 
+            this.pd_inoutno.AutoSize = true;
+            this.pd_inoutno.Location = new System.Drawing.Point(89, 21);
+            this.pd_inoutno.Name = "pd_inoutno";
+            this.pd_inoutno.Size = new System.Drawing.Size(0, 12);
+            this.pd_inoutno.TabIndex = 28;
+            // 
+            // bi_vendbarcode
+            // 
+            this.bi_vendbarcode.Location = new System.Drawing.Point(774, 75);
+            this.bi_vendbarcode.Name = "bi_vendbarcode";
+            this.bi_vendbarcode.Size = new System.Drawing.Size(117, 21);
+            this.bi_vendbarcode.TabIndex = 27;
+            // 
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.Location = new System.Drawing.Point(309, 74);
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Size = new System.Drawing.Size(117, 21);
+            this.pr_zxbzs.TabIndex = 26;
+            // 
+            // lable1
+            // 
+            this.lable1.AutoSize = true;
+            this.lable1.Location = new System.Drawing.Point(19, 21);
+            this.lable1.Name = "lable1";
+            this.lable1.Size = new System.Drawing.Size(77, 12);
+            this.lable1.TabIndex = 25;
+            this.lable1.Text = "出入库单号:";
+            // 
+            // bi_boxnum
+            // 
+            this.bi_boxnum.Location = new System.Drawing.Point(1037, 11);
+            this.bi_boxnum.Name = "bi_boxnum";
+            this.bi_boxnum.Size = new System.Drawing.Size(121, 21);
+            this.bi_boxnum.TabIndex = 24;
+            this.bi_boxnum.Visible = false;
+            // 
+            // bi_location
+            // 
+            this.bi_location.Caller = null;
+            this.bi_location.FormName = null;
+            this.bi_location.Location = new System.Drawing.Point(86, 74);
+            this.bi_location.Name = "bi_location";
+            this.bi_location.Size = new System.Drawing.Size(117, 21);
+            this.bi_location.TabIndex = 61;
+            this.bi_location.Visible = false;
+        
+            // 
+            // closeButton1
+            // 
+            this.closeButton1.Image = ((System.Drawing.Image)(resources.GetObject("closeButton1.Image")));
+            this.closeButton1.Location = new System.Drawing.Point(920, 146);
+            this.closeButton1.Name = "closeButton1";
+            this.closeButton1.Size = new System.Drawing.Size(80, 26);
+            this.closeButton1.TabIndex = 53;
+            this.closeButton1.Text = "关闭";
+            this.closeButton1.UseVisualStyleBackColor = true;
+            // 
+            // Batch_Generation_CodeDetail
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
+            this.ClientSize = new System.Drawing.Size(1278, 560);
+            this.Controls.Add(this.Panel0);
+            this.Controls.Add(this.dataGridView1);
+            this.Name = "Batch_Generation_CodeDetail";
+            this.Text = "条码信息维护";
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            this.Panel0.ResumeLayout(false);
+            this.Panel0.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.Panel Panel0;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.DateTimePicker bi_madedate;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label pr_unit;
+        private System.Windows.Forms.Label pi_title;
+        private System.Windows.Forms.Label pi_cardcode;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pd_prodcode;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label pd_inoutno;
+        private System.Windows.Forms.TextBox bi_vendbarcode;
+        private System.Windows.Forms.TextBox pr_zxbzs;
+        private System.Windows.Forms.Label lable1;
+        private System.Windows.Forms.TextBox bi_boxnum;
+        private System.Windows.Forms.Button PrintCode;
+        private System.Windows.Forms.TextBox pd_qty;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Button GenerateCode;
+        private System.Windows.Forms.Button GenerateCodeAndBoxNum;
+        private System.Windows.Forms.Button PrintAllBoxNum;
+        private CustomControl.ButtonUtil.CloseButton closeButton1;
+     
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label pr_tracekind;
+        private System.Windows.Forms.Label pd_inqty;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label bi_location_label;
+        private CustomControl.TextBoxWithIcon.SearchTextBox bi_location;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label pd_pdno;
+    }
+}

+ 482 - 0
UAS-MES/Batch_Generation_CodeDetail.cs

@@ -0,0 +1,482 @@
+using NPOI.SS.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using 优软MES.DataOperate;
+using 优软MES.PublicMethod;
+
+namespace 优软MES
+{
+    public partial class Batch_Generation_CodeDetail : Form
+    {
+        DataHelper dh = new DataHelper();
+        DataTable dt = new DataTable();
+        //string caller = "ProdInOut!BarcodeIn";
+        string PD_ID;
+        string PI_ID;
+        string[] field = { "pd_inoutno","pd_pdno","pd_prodcode","pr_detail","pr_unit","pd_inqty", "pr_tracekind" ,"pi_cardcode","pi_title", "pd_inqty-nvl(pd_barcodeinqty,0)" , "pr_zxbzs","pr_unit" };
+        string table = "prodiodetail left join product on pr_code=pd_prodcode  left join prodinout on pi_id=pd_piid";
+        //明细行需要隐藏的字段
+        string[] hiddenfield = {"bi_pdid","bi_pdaget"};
+        string[] EditAbleField = {"bi_location","bi_madedate", "bi_vendbarcode","bi_inqty" };
+        public Batch_Generation_CodeDetail()
+        {
+            InitializeComponent();
+        }
+
+        public Batch_Generation_CodeDetail(string pd_id) {
+            
+            if (pd_id != null && pd_id != "")
+            {
+                InitializeComponent();
+                //设置只能输入数字的TextBox的委托事件
+                NumOnly();
+                PD_ID = pd_id;
+                //初始的时候设置timepicker为空
+                bi_madedate.Format = DateTimePickerFormat.Custom;
+                bi_madedate.CustomFormat = " ";
+
+                string sql = BaseUtil.AddField(field);
+                sql = "select " + sql + " from "+table+" where pd_id=" + pd_id;
+
+                dt = (DataTable)dh.ExecuteSql(sql, "select");
+                //加载数据
+                LoadData();
+                //通过控件名称和列的描述相同时赋值,由于表格上部分的控件是装在一个panel里面的,所以需要通过controls[0]从panel中获取
+                BaseUtil.SetFormValue(Controls["Panel0"].Controls, dt);
+                //从configs表中取数据
+                string Data = dh.GetConfig("UseLocationOrNot", "BarCodeSetting").ToString();
+                //如果配置的数据为1或者Y,说明启用这个配置
+                if (Data == "1" || Data == "Y")
+                {
+                    bi_location.Visible = true;
+                    bi_location_label.Visible = true;
+                }
+                BaseUtil.HideField(dataGridView1, hiddenfield);
+                BaseUtil.SetDataGridViewReadOnly(dataGridView1,EditAbleField);
+                //手动转换批总量
+                ValueTransform();
+                
+              
+            }
+        }
+
+        private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
+        {
+            bi_madedate.Format = DateTimePickerFormat.Long;
+        }
+
+       
+
+        private void bi_prodate_ValueChanged(object sender, EventArgs e)
+        {
+            bi_madedate.Format = DateTimePickerFormat.Long;
+        }
+
+        private void GenerateCode_Click(object sender, EventArgs e)
+        {
+            //检查生成条码之前的逻辑
+            CheckBeforeGenCode();
+            //计算打包的数量num表示包数
+            //restqty表示不足整包之后的数量,单独作为一个包
+            int num = int.Parse(pd_qty.Text) / int.Parse(pr_zxbzs.Text);
+            int restqty = int.Parse(pd_qty.Text) - (num * int.Parse(pr_zxbzs.Text));
+            string ve_id = GetVendorID(PD_ID);
+            string pr_code = dh.getFieldDataByCondition("prodiodetail", "pd_prodcode","pd_id="+PD_ID).ToString();
+            //如果用为未选择日期则将日期置为空,否则选择日期的值
+            string madedate = bi_madedate.Text;
+            if (madedate.Trim() == "")
+            {
+                madedate = null;
+            }
+            else {
+                madedate = bi_madedate.Value.ToString();
+            }
+            //用于拼接SQl的StringBulider对象
+            StringBuilder sql = new StringBuilder();
+            //用于存放条码的数组
+            string[] barcode = new string[num];
+            for (int i = 0; i < num; i++)
+            {
+                barcode[i] = BarcodeMethod(pr_code, ve_id);
+            }
+            BaseUtil.CleanDataTable(dt);
+            //通过pd_id查询出需要插入的数据
+            dt = dh.getFieldsDataByCondition("prodiodetail left join prodinout on pd_piid=pi_id", new string[] { "pd_pdno", "pi_class", "pd_prodmadedate", "pi_date", "pd_whcode", "pi_whcode" }, "pd_id=" + PD_ID);
+            object pd_pdno = dt.Rows[0]["pd_pdno"];
+            object pi_class = dt.Rows[0]["pi_class"];
+            object pi_date = dt.Rows[0]["pi_date"];
+            object pd_prodmadedate = dt.Rows[0]["pd_prodmadedate"];
+            object pi_whcode = dt.Rows[0]["pi_whcode"];
+            object pd_whcode = dt.Rows[0]["pd_whcode"];
+            sql.Append("insert into barcodeio (");
+            sql.Append("bi_id,bi_piid,bi_pdid,bi_pdno,bi_inoutno,bi_piclass,bi_barcode,bi_prodcode,bi_whcode,bi_inqty,");
+            sql.Append("bi_madedate,bi_vendbarcode,bi_location,bi_status,bi_printstatus)");
+            sql.Append(" values (barcodeio_seq.nextval," + PI_ID + "," + PD_ID + ",'" + pd_pdno + "','" + pd_inoutno.Text + "','" + pi_class + "',:barcode,'" + pd_prodcode.Text + "',nvl('" + pd_whcode + "','" + pi_whcode + "'),'");
+            sql.Append(pr_zxbzs.Text + "',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')),'" + bi_vendbarcode.Text + "','仓位', 0, 0)");
+            if (num > 0) {    
+                dh.BatchInsert(sql.ToString(),new string[] {"barcode"},barcode);
+            }
+            //有余数的话单独生成一条
+            if (restqty != 0) {
+                dh.BatchInsert(sql.ToString(), new string[] { "barcode" },new string[] { BarcodeMethod(pr_code, ve_id) } ); 
+            }
+            MessageBox.Show("生成条码成功");
+            LoadData();
+        }
+
+        private  static string lpad(int length, string number)
+        {            
+            while (number.Length < length)
+            {
+                number = "0" + number;
+            }
+            number = number.Substring(number.Length - length,length);
+            return number;
+        }
+
+        //生成条码的方法
+        public static string BarcodeMethod(string pr_code, string ve_id) {
+            StringBuilder code = new StringBuilder();
+            DataTable dt1 = new DataTable();
+            DataHelper dh = new DataHelper();
+            string date = "0";
+            dt1 =(DataTable) dh.ExecuteSql("select pr_id,pr_tracekind,pr_exbarcode from product where pr_code='"+pr_code+"'","select");
+            if (dt1.Rows.Count > 0) {
+                if (dt1.Rows[0]["pr_tracekind"].ToString() != "") {
+                    if (int.Parse(dt1.Rows[0]["pr_tracekind"].ToString()) == 2)
+                    { //批量管控
+                        string pr_id = dt1.Rows[0]["pr_id"].ToString();
+                        //清掉dt1的数据和结构
+                        BaseUtil.CleanDataTable(dt1);
+                        string[] field = { "bs_lenprid", "bs_datestr", "bs_lennum", "bs_maxnum", "bs_maxdate", "bs_lenveid" };
+                        dt1 = dh.getFieldsDataByCondition("barcodeSet", field, "bs_type='BATCH'");
+                        code.Append(lpad(int.Parse(dt1.Rows[0][0].ToString()), pr_id));
+                        code.Append(lpad(int.Parse(dt1.Rows[0][5].ToString()), ve_id));
+                        if (dt1.Rows[0][1].Equals("YYMMDD"))
+                        {
+                            SimpleDateFormat YMD = new SimpleDateFormat("yyMMdd");
+                            date = YMD.Format(new DateTime());
+                        }
+                        else if (dt1.Rows[0][1].Equals("YYMM"))
+                        {
+                            SimpleDateFormat YM = new SimpleDateFormat("yyMM");
+                            date = YM.Format(new DateTime());
+                        }
+                        else if (dt1.Rows[0][1].Equals("MMDD"))
+                        {
+                            SimpleDateFormat MD = new SimpleDateFormat("MMdd");
+                            date = MD.Format(new DateTime());
+                        }
+                        code.Append(date);
+                        dh.UpdateByCondition("barcodeSet", "bs_maxdate='" + date + "'", "bs_type='BATCH'");
+                        if (!("").Equals(dt1.Rows[0][4]) && null != dt1.Rows[0][4] && (!date.Equals("0")) && (int.Parse(dt1.Rows[0][4].ToString()) > int.Parse(date)))
+                        {
+                            code.Append(lpad(int.Parse(dt1.Rows[0][2].ToString()), "1"));// 流水重新开始
+                            dh.UpdateByCondition("barcodeSet", "bs_maxnum=2", "bs_type='BATCH'");
+                        }
+                        else
+                        {
+                            code.Append(lpad(int.Parse(dt1.Rows[0][2].ToString()), dt1.Rows[0][3].ToString()));// 当前流水号
+                            dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='BATCH'");// 流水号增加1
+                        }
+                    }
+                    else
+                    {
+                        BaseUtil.ShowError("管控类型错误!");
+                    }
+                }
+            }
+            return code.ToString();
+        }
+
+
+        public static string outboxMethod(string pr_id, string kind) {
+
+            StringBuilder code = new StringBuilder();
+            DataHelper dh = new DataHelper();
+            object pr_kind= dh.getFieldDataByCondition("product", "pr_tracekind", "pr_id=" + pr_id );
+            if (pr_kind.ToString()!="") {
+                if ((kind.Equals("1") && pr_kind.ToString() == "1") || (kind.Equals("2") && pr_kind.ToString() == "2"))
+                {// 单间管控或者批管控
+                    DataTable dt= dh.getFieldsDataByCondition("barcodeSet",new string[] { "bs_id ,bs_lenprid,bs_lennum,bs_maxnum" } ,"bs_type='PACK'");
+                    if (dt.Rows.Count>0)
+                    {
+                        code.Append(lpad(int.Parse(dt.Rows[0]["bs_lenprid"].ToString()), pr_id));// PR_ID物料ID的长度
+                        code.Append(lpad(int.Parse(dt.Rows[0]["bs_lennum"].ToString()),dt.Rows[0]["bs_maxnum"].ToString()));// 当前流水号
+                        dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='PACK' and  bs_id=" + dt.Rows[0]["bs_id"]);// 流水号增加1
+                    }
+                    else
+                    {
+                        BaseUtil.ShowError("未定义包装箱号产生规则或规则为审核");
+                    }
+                }
+                else
+                {
+                   BaseUtil.ShowError("管控类型错误!");
+                }
+            }
+            return code.ToString();
+        }
+
+        private void PrintCode_Click(object sender, EventArgs e)
+        {
+            
+        }
+
+        private void PrintAllBoxNum_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void deleteDetailButton1_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void saveButton1_Click(object sender, EventArgs e)
+        {
+            DataTable dt = (DataTable)dataGridView1.DataSource;
+            dh.UpDateTableByCondition(dt.GetChanges(), "barcodeio", "bi_id");
+        }
+
+        private void deleteDetailButton1_Click_1(object sender, EventArgs e)
+        {
+            //新建一个和grid长度一样的数组
+            string pd_status = dh.getFieldDataByCondition("prodiodetail", "pd_status", "pd_id=" +PD_ID).ToString();
+            if (pd_status=="99") {
+                BaseUtil.ShowError("单据已过账,不允许删除明细");
+            }
+            string[] deleteID = new string[dataGridView1.Rows.Count];
+            foreach (DataGridViewRow dgvc in dataGridView1.Rows) {
+                deleteID[dataGridView1.Rows.IndexOf(dgvc)] = dgvc.Cells["ID"].Value.ToString();
+            }
+
+            string bi_pdid=dh.getFieldDataByCondition("barcodeio", "bi_pdid", "bi_id=" + deleteID[0]).ToString();
+            //删除PackageDetail表信息
+            dh.ExecuteSql("delete from packagedetail where pd_outboxcode in (select bi_outboxcode from barcodeio where bi_pdid=" + bi_pdid + ")", "delete");
+            //删除Package表的信息
+            dh.ExecuteSql("delete from package where pa_outboxcode in (select bi_outboxcode from barcodeio where bi_pdid=" + bi_pdid + ")", "delete");
+            //删除BarcodeIO表信息
+            dh.DeleteDataByID("barcodeio", "bi_id", deleteID);
+            MessageBox.Show("清除明细成功");
+            LoadData();
+        }
+
+        /// <summary>
+        /// 生成条码和箱号按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void GenerateCodeAndBoxNum_Click(object sender, EventArgs e)
+        {
+            //调用生成条码的方法
+            CheckBeforeGenCode();
+            if (bi_boxnum.Text == "")
+            {
+                BaseUtil.ShowError("箱内总数必须填写");
+            }
+            else
+            {
+                int rest = int.Parse(bi_boxnum.Text) % int.Parse(pr_zxbzs.Text);
+                if (rest != 0)
+                {
+                    BaseUtil.ShowError("箱内总是必须是最小包装量的整数倍");
+                }
+            }
+            string ve_id = GetVendorID(PD_ID);
+            DataTable dt = dh.getFieldsDataByCondition("prodiodetail", new string[] { "pd_prodcode,pd_prodid" }, "pd_id=" + PD_ID);
+            string pr_code = dt.Rows[0]["pd_prodcode"].ToString();
+            string pr_id = dt.Rows[0]["pd_prodid"].ToString();
+            //箱内件数
+            int numinpack = int.Parse(bi_boxnum.Text) / int.Parse(pr_zxbzs.Text);
+            //装箱的数量和条码的数量
+            int packnum = int.Parse(pd_qty.Text) / int.Parse(bi_boxnum.Text);
+            int codenum =   int.Parse(pd_qty.Text) / int.Parse(pr_zxbzs.Text);
+            //是否有剩余的最小包
+            int restcode = int.Parse(pd_qty.Text) -(codenum* int.Parse(pr_zxbzs.Text)) ;
+            //是否有剩余的尾箱
+            int restpack = int.Parse(pd_qty.Text) -(packnum * int.Parse(bi_boxnum.Text));
+            //记录箱号的数组
+            
+            //根据pd_id选出需要插入的数据
+            dt = dh.getFieldsDataByCondition("prodiodetail left join prodinout on pd_piid=pi_id", new string[] { "pd_pdno", "pi_class", "pd_prodmadedate", "pi_date", "pd_whcode", "pi_whcode" }, "pd_id=" + PD_ID);
+            object pd_pdno = dt.Rows[0]["pd_pdno"];
+            object pi_class = dt.Rows[0]["pi_class"];
+            object pi_date = dt.Rows[0]["pi_date"];
+            object pd_prodmadedate = dt.Rows[0]["pd_prodmadedate"];
+            object pi_whcode = dt.Rows[0]["pi_whcode"];
+            object pd_whcode = dt.Rows[0]["pd_whcode"];
+            string madedate = bi_madedate.Text;
+            if (madedate.Trim() == "")
+            {
+                madedate = null;
+            }
+            else
+            {
+                madedate = bi_madedate.Value.ToString();
+            }
+            StringBuilder sql = new StringBuilder();
+            //
+           
+            //如果剩余的箱数量大于0,则箱号+1
+            if (restpack != 0) {
+                packnum = packnum + 1;
+            }
+            string[] pa_id = new string[packnum];
+            string[] packNum = new string[packnum];
+            if (packnum > 0)
+            {
+                for (int i = 0; i < packnum; i++)
+                {      
+                    packNum[i] = outboxMethod(pr_id, "2");
+                    //通过序列获取到ID    
+                    pa_id[i] = dh.GetSEQ("PACKAGE_SEQ");
+                }
+                sql.Append("insert into package (");
+                sql.Append("pa_id,pa_outboxcode,pa_prodcode, pa_packdate,pa_packageqty, pa_totalqty, pa_status, pa_indate)");
+                sql.Append("values (:pa_id,:packnum,'" + pr_code + "', sysdate," + numinpack + "," + bi_boxnum.Text + ",'0',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')))");
+                dh.BatchInsert(sql.ToString(), new string[] { "pa_id", "packnum" }, pa_id, packNum);
+            }
+            sql.Clear();
+            //记录条码号的数组
+           
+            //如果有余数则条码数量+1
+            if (restcode != 0){
+                codenum=codenum+1;
+            }
+            string[] codeNum = new string[codenum];
+            string[] bi_outboxid = new string[codenum];
+            string[] bi_outboxcode = new string[codenum];
+            if (codenum > 0){
+                for (int i = 0; i < codenum; i++)
+                {
+                    codeNum[i] = BarcodeMethod(pr_code, ve_id);
+                }
+                //包装数-1*箱内数量,先处理整箱的
+                int k = 0;
+                for (int i = 0; i < packnum-1; i++) {
+                    for (int j = 0; j < numinpack; j++) {
+                        bi_outboxid[k] = pa_id[i];
+                        bi_outboxcode[k] = packNum[i];
+                        k=k+1;
+                    }
+                }
+            
+                //最后单独处理剩余的一箱的条码,不论整箱还是有零件都可以
+                //最后一箱的条码数量
+                int remain = codenum - k;
+                for (int i = 0; i <remain; i++) {
+                    bi_outboxid[k] = pa_id[pa_id.Length - 1];
+                    bi_outboxcode[k] = packNum[packNum.Length - 1];
+                    k=k+1;
+                }
+          
+                //每个条码需要存对应的箱号的ID
+                sql.Append("insert into barcodeio (");
+                sql.Append("bi_id,bi_piid,bi_pdid,bi_pdno,bi_inoutno,bi_piclass,bi_barcode,bi_prodcode,bi_whcode,bi_inqty,");
+                sql.Append("bi_madedate,bi_vendbarcode,bi_location,bi_status,bi_printstatus,bi_outboxcode,bi_outboxid)");
+                sql.Append(" values (barcodeio_seq.nextval," + PI_ID + "," + PD_ID + ",'" + pd_pdno + "','" + pd_inoutno.Text + "','" + pi_class + "',:barcode,'" + pd_prodcode.Text + "',nvl('" + pd_whcode + "','" + pi_whcode + "'),'");
+                sql.Append(pr_zxbzs.Text + "',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')),'" + bi_vendbarcode.Text + "','仓位',0,0,:packcode,:pa_id)");
+                dh.BatchInsert(sql.ToString(), new string[] { "barcode","packcode","pa_id" },codeNum, bi_outboxcode,bi_outboxid);
+
+                  
+            }
+
+
+            sql.Clear();
+            //insert into packageDetail(pd_id, pd_paid, pd_outboxcode, pd_barcode, pd_innerqty)values(PACKAGEDETAIL_SEQ, pd_id, 箱号, 条码号, 条码数量);
+            sql.Append("insert into packageDetail(pd_id, pd_paid, pd_outboxcode, pd_barcode, pd_innerqty) values (");
+            sql.Append("PACKAGEDETAIL_SEQ.nextval,:pd_paid,:packcode,:barcode,"+pd_qty.Text+")");
+            dh.BatchInsert(sql.ToString(), new string[] { "pd_paid","packcode", "barcode" },bi_outboxid,bi_outboxcode, codeNum);
+            MessageBox.Show("成功生成条码和箱号");
+            LoadData();
+        }
+
+        /// <summary>
+        /// 通过pd_id获取供应商的ID
+        /// </summary>
+        /// <param name="pd_id"></param>
+        /// <returns></returns>
+        public string GetVendorID(string pd_id) {
+            DataHelper dh = new DataHelper();
+            string pi_id=dh.getFieldDataByCondition("prodiodetail", "pd_piid", "pd_id=" + pd_id).ToString() ;
+            PI_ID = pi_id;
+            object ve_id=dh.getFieldDataByCondition("Vendor left join ProdInOut on pi_cardcode=ve_code", "ve_id", "pi_id=" + pi_id);
+            if (ve_id != null)
+            {
+                return ve_id.ToString();
+            }
+            else {
+                return "0";
+            }
+        }
+
+        private void ValueTransform() {
+           
+            switch (pr_tracekind.Text) {
+                case "":
+                    pr_tracekind.Text = "不管控";
+                    break;
+                case "0":
+                    pr_tracekind.Text = "不管控";
+                    break;
+                case "1":
+                    pr_tracekind.Text = "单间管控";
+                    break;
+                case "2":
+                    pr_tracekind.Text = "批量管控";
+                    break;
+            }
+        }
+
+        private void CheckBeforeGenCode() {
+            if (pr_tracekind.Text == "单件管控")
+            {
+                BaseUtil.ShowError("管控类型为单件管控时不允许生成条码");
+            }
+            if (pd_qty.Text != "")
+            {
+                if (!(int.Parse(pd_qty.Text) > 0) || !(int.Parse(pr_zxbzs.Text) > 0))
+                {
+                    BaseUtil.ShowError("批总量,最小包装数必须大于0");
+                }
+                if (int.Parse(pd_qty.Text) > int.Parse(pd_inqty.Text))
+                {
+                    BaseUtil.ShowError("批总量不允许大于来料总量!");
+                }
+            }
+            else
+            {
+                BaseUtil.ShowError("请填写批总量!");
+            }
+
+            //判断是否已经入库,状态为99表示已经入库
+            if (dh.getFieldDataByCondition("prodiodetail", "pd_status", "pd_id=" + PD_ID).ToString().Equals("99"))
+            {
+                BaseUtil.ShowError("该批次已入库,不允许生成条码");
+            }
+            object checknum = dh.getFieldDataByCondition("barcodeio", "sum(bi_inqty)", "bi_pdid=" + PD_ID);
+            if (checknum != null && checknum.ToString() != "")
+            {
+                if (int.Parse(pd_qty.Text) > int.Parse(pd_inqty.Text) - int.Parse(checknum.ToString()))
+                {
+                    BaseUtil.ShowError("批总量不能大于未生成条码数");
+                }
+            }
+        }
+
+        private void LoadData() {
+            dataGridView1.DataSource = dh.GetConfigureData("ProdInOut!BarcodeIn", "detailgrid", "bi_pdid=" + PD_ID);
+        }
+
+        private void NumOnly()
+        {
+            bi_boxnum.KeyPress += BaseUtil.NumOnly;
+            pr_zxbzs.KeyPress += BaseUtil.NumOnly;
+            pd_qty.KeyPress += BaseUtil.NumOnly;
+        }
+    }
+}

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov