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();
            }
Esempio n. 2
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 SetStatue(bool Save)
            {
                if (!oldSave && Save)
                {
                    try
                    {
                        string   fileList = All.Class.DownLoadFile.FtpFileList("ftp://192.168.1.109//Photo//", "admin", "");
                        string[] buff     = fileList.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

                        if (buff.Length > 0)
                        {
                            string testFile = CheckTestResultFile.CheckTestFile(frmMain.mMain.AllCars.AllStatueLineStation[41].BarCode);
                            for (int i = 0; i < buff.Length; i++)
                            {
                                if (buff[i] == "." || buff[i] == "..")
                                {
                                    continue;
                                }
                                All.Class.DownLoadFile.FtpDownLoad(string.Format("ftp://192.168.1.109//Photo//{0}", buff[i]),
                                                                   "admin",
                                                                   "",
                                                                   string.Format("{0}\\{1}", testFile, buff[i]));
                            }
                        }
                    }
                    catch
                    { }
                }
                oldSave = Save;
            }
            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();
            }
            /// <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();
            }
            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();
            }
            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();
            }
Esempio n. 8
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();
            }
Esempio n. 11
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();
     }
 }