/// <summary>
        /// 扫描的方法
        /// </summary>
        /// <param name="lpMsg">扫描的内容</param>
        public static string ScanMethod(string lpMsg)
        {
            //lpRichTextBox.AppendText(lpMsg);
            // MessageBox.Show(lpMsg, "结果");
            if (lpMsg != null && lpMsg != "")
            {
                try
                {
                    string type = "";
                    if (lpMsg.StartsWith("TS") || lpMsg.StartsWith("ts"))
                    {
                        type = "刀柄";
                    }
                    else
                    {
                        type = "刀具";
                    }
                    using (JDJS_Modules_Tool_Demands_DBEntities model = new JDJS_Modules_Tool_Demands_DBEntities())
                    {
                        var table = model.ScanResultTable;
                        if (table.Count() < 1)
                        {
                            ScanResultTable sc = new ScanResultTable()
                            {
                                ScanResult = lpMsg,
                                Type       = type
                            };
                            using (System.Data.Entity.DbContextTransaction mytran = model.Database.BeginTransaction())
                            {
                                try
                                {
                                    model.ScanResultTable.Add(sc);
                                    model.SaveChanges();
                                    mytran.Commit();
                                }
                                catch (Exception ex)
                                {
                                    mytran.Rollback();
                                }
                            }
                        }
                        else
                        {
                            using (System.Data.Entity.DbContextTransaction mytran = model.Database.BeginTransaction())
                            {
                                try
                                {
                                    foreach (var item in table)
                                    {
                                        item.ScanResult = lpMsg;
                                        item.Type       = type;
                                    }
                                    model.SaveChanges();
                                    mytran.Commit();
                                }
                                catch (Exception ex)
                                {
                                    mytran.Rollback();
                                }
                            }
                        }
                    }

                    lpMsg = "";
                    return("ok");
                }
                catch (Exception ex)
                {
                    lpMsg = "";
                    return(ex.Message);
                }
            }
            else
            {
                return("二维码内容错误:" + lpMsg);
            }
        }