Example #1
0
            private void Save(string tableName)
            {
                if (BarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                string sqlstr = "Insert into {0} values('{1:yyyy-MM-dd HH:mm:ss}','{2}','{3}','{4}',{5},{6},'{7}',{8},'{9}'{10}{11})";
                string d      = "";
                string b      = "";

                for (int i = 0; i < D.Length; i++)
                {
                    d = string.Format("{0},{1:F3}", d, this.D[i]);
                }
                for (int i = 0; i < B.Length; i++)
                {
                    b = string.Format("{0},'{1}'", b, B[i]);
                }
                sql.Write(string.Format(sqlstr, tableName,
                                        TestTime, BarCode, ID, Mode, TestNo, JiQi, IsPass, StepID, Step, d, b));
                sql.Close();
            }
            public void Save()
            {
                if (BarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                string str = "insert into TestOil Values('{0:yyyy-MM-dd HH:mm:ss}','{1}','{2}','{3}','{4}','{5}',{6},{7:f3},{8:f3},'{9}',{10},'{11}',{12:f3},'{13}'{14}{15})";
                string s   = "";
                string d   = "";

                for (int i = 0; i < DingLiang.Length; i++)
                {
                    d = string.Format("{0},{1:F3}", d, DingLiang[i]);
                }
                for (int i = 0; i < ShiFa.Length; i++)
                {
                    s = string.Format("{0},{1:F3}", s, ShiFa[i]);
                }
                str = string.Format(str, FaLiaoShiJian, FaPiaoHaoMa, BarCode, ShiBieMa, GuiJiHao, YouPin, ChengXuShu, DingLiangHeJi, ShiFaHeJi, GuoChengJieGuo, YiBiaoDiZhi, ZiDong, LiuLiangXiShu, LeiXingMiaoShu, d, s);
                sql.Write(str);
                sql.Close();
            }
            public void Save()
            {
                frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Write <ushort>(0, 3);

                string tmpBarCode   = "";
                string sheDingLiang = "";
                string shiJiLiang   = "";
                string jieGuo       = "";
                string leiXing      = "";

                if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out tmpBarCode, 104))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out tmpBarCode, 104))
                    {
                        return;
                    }
                }
                if (tmpBarCode == "")
                {
                    return;
                }
                if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out sheDingLiang, 168))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out sheDingLiang, 168))
                    {
                        return;
                    }
                }
                if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out shiJiLiang, 232))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out shiJiLiang, 232))
                    {
                        return;
                    }
                }
                if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out jieGuo, 296))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out jieGuo, 296))
                    {
                        return;
                    }
                }
                if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out leiXing, 360))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[32].Sons[0].Read <string>(out leiXing, 360))
                    {
                        return;
                    }
                }

                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(tmpBarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                sql.Write(string.Format("insert into TestChongZhu Values('{0}','{1}','{2}','{3}')",
                                        sheDingLiang, shiJiLiang, jieGuo, leiXing));
                sql.Close();
            }
            private void Save()
            {
                //记录状态为1时,记录数据,读到此状态后,将此状态复位
                frmMain.mMain.AllMeterData.AllCommunite[31].Sons[0].Write <ushort>(0, 3);

                string tmpBarCode = "";

                if (!frmMain.mMain.AllMeterData.AllCommunite[31].Sons[0].Read <string>(out tmpBarCode, 40))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[31].Sons[0].Read <string>(out tmpBarCode, 40))
                    {
                        return;
                    }
                }
                if (tmpBarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(tmpBarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }

                sql.Write(string.Format("insert into TestChongHaiHuiShou Values ('{0}','{1}',{2},{3:F10},{4:F10},{5:F10})",
                                        (GongWeiHao == 1 ? "A" : "B"), (JieGuo == 1), ChouKongShiJian, ChongDanYaLi, ChouKongYaLi, ChongHaiYaLi));
                sql.Close();
            }
            /// <summary>
            /// 保存B路实时数据
            /// </summary>
            private void SaveTmpB()
            {
                if (bBarCode == "")
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[31].Sons[0].Read <string>(out bBarCode, 40))
                    {
                        if (!frmMain.mMain.AllMeterData.AllCommunite[31].Sons[0].Read <string>(out bBarCode, 40))
                        {
                            return;
                        }
                    }
                    if (bBarCode == "")
                    {
                        return;
                    }
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(bBarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                sql.Write(string.Format("insert into TestChongHaiB (Press) values ({0:F10})", BLuShiShiYaLi));
                sql.Close();
            }
            public void Save()
            {
                if (BarCode == "")
                {
                    return;
                }
                if (frmMain.mMain.FlushUserLogin.InfoLineStation.Count >= this.WorkStation)
                {
                    this.UserName = frmMain.mMain.FlushUserLogin.InfoLineStation[this.WorkStation - 1].UserName;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();
                switch (WorkStation)
                {
                case 11:
                    if (!sql.Login(CheckTestResultFile.CheckLenNingFile(BarCode), "AllLenNingValue.sdf", "", ""))
                    {
                        return;
                    }
                    break;

                default:
                    if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                    {
                        return;
                    }
                    break;
                }
                sql.Write(string.Format("insert into TestAnZhuang Values({0},'{1}','{2}','{3:yyyy-MM-dd HH:mm:ss}')",
                                        WorkStation, StationName, UserName, TestTime));
                sql.Close();
            }
Example #7
0
            /// <summary>
            /// 保存实时漏率
            /// </summary>
            private void SaveTmp()
            {
                if (barCode == "")
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[30].Sons[0].Read <string>(out barCode, 40))
                    {
                        if (!frmMain.mMain.AllMeterData.AllCommunite[30].Sons[0].Read <string>(out barCode, 40))
                        {
                            return;
                        }
                    }
                    if (barCode == "")
                    {
                        return;
                    }
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckLenNingFile(barCode), "AllLenNingValue.sdf", "", ""))
                {
                    return;
                }

                sql.Write(string.Format("insert into TestLouLv (LouLv) Values ({0:F10})",
                                        ShiShiLouLv));
                sql.Close();
            }
Example #8
0
            /// <summary>
            /// 保存检测结果
            /// </summary>
            private void Save()
            {
                //记录状态为1时,记录数据,读到此状态后,将此状态复位
                frmMain.mMain.AllMeterData.AllCommunite[30].Sons[0].Write <ushort>(0, 2);

                string tmpBarCode = "";

                if (!frmMain.mMain.AllMeterData.AllCommunite[30].Sons[0].Read <string>(out tmpBarCode, 40))
                {
                    if (!frmMain.mMain.AllMeterData.AllCommunite[30].Sons[0].Read <string>(out tmpBarCode, 40))
                    {
                        return;
                    }
                }
                if (tmpBarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckLenNingFile(tmpBarCode), "AllLenNingValue.sdf", "", ""))
                {
                    return;
                }

                sql.Write(string.Format("insert into TestJianLou Values ('{0}',{1},{2},{3},{4},{5})",
                                        JieGuo, HaiJianShiJian, ZongJiePai, XuLieHao, ZhenKongDu, LouLv));
                sql.Close();
            }
Example #9
0
 public void Save()
 {
     if (BarCode == "")
     {
         return;
     }
     All.Class.Sqlce sql = new All.Class.Sqlce();
     if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
     {
         return;
     }
     if (Repair)
     {
         sql.Write(string.Format("update StatueError Set Repair='true',RepairTime='{0:yyyy-MM-dd HH:mm:ss}' where Error='{1}'", DateTime.Now, Text));
     }
     else
     {
         sql.Write(string.Format("delete from StatueError where  Error='{0}'", Text));
         sql.Write(string.Format("insert into StatueError Values({0},'{1}',{2},'{3:yyyy-MM-dd HH:mm:ss}','{4}','{5:yyyy-MM-dd HH:mm:ss}')",
                                 WorkStation, Text, ErrorNum, ErrorTime, Repair, RepairTime));
         sql.Close();
     }
 }
Example #10
0
            public void Save()
            {
                if (BarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                sql.Write(string.Format("insert into TestAnGui Values('{0}',{1:F3},{2:F3},{3:F3},{4:F3},'{5}','{6}','{7}','{8}')",
                                        BarCode, d[0], d[1], d[2], d[3], b[0], b[1], b[2], b[3]));
                sql.Close();
            }
                /// <summary>
                /// 保存曲线
                /// </summary>
                private void Save()
                {
                    if (BarCode == "")
                    {
                        return;
                    }

                    All.Class.Sqlce sql = new All.Class.Sqlce();

                    if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                    {
                        return;
                    }
                    sql.Write(string.Format("insert into TestChouKong (Data1,Data2,Data3,Data4,Data5) values ({0},{1},{2},{3},{4})", Value[0], Value[1], Value[2], Value[3], Value[4]));
                    sql.Close();
                }
            public void Save()
            {
                if (BarCode == "")
                {
                    return;
                }
                All.Class.Sqlce sql = new All.Class.Sqlce();

                if (!sql.Login(CheckTestResultFile.CheckTestFile(BarCode), "AllTestValue.sdf", "", ""))
                {
                    return;
                }
                sql.Write(string.Format("insert into TestYaSuoJi values({0},'{1}','{2}','{3}')",
                                        this.Index, this.TestBar, this.Result, this.TestName));
                sql.Close();
            }