Пример #1
0
        public static int Nummernkreis1_GetNext()
        {
            string sSQL = "SELECT Field_Value FROM [SMT_SETTINGS] WHERE " +
                          "FieldName = 'Nummernkreis1'";

            cDB_SQL_CE qry = null;

            int iRet = 0;

            try
            {
                qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);

                if (qry.OPEN(sSQL))
                {
                    iRet = Convert.ToInt32(qry.getS("Field_Value"));
                    iRet++;
                }
                else
                {
                    iRet = 1;
                }

                if (iRet > 32000)
                {
                    iRet = 1;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }

            return(iRet);
        }
Пример #2
0
        public static void SetSMTServiceMode(cData_Settings Data_Settings)
        {
            cDB_SQL_CE qry          = null;
            bool       bServiceMode = false;

            try
            {
                qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);

                if (!qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ServiceMode'"))
                {
                    CreateKey("ServiceMode");
                }
                else
                {
                    bServiceMode = SetUpToBool(qry.getS("Field_Value"));
                }

                bServiceMode = !bServiceMode;
                Data_Settings.bServiceMode = bServiceMode;

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + (bServiceMode ? "1" : "0") + "' " +
                         "Where FieldName = 'ServiceMode'");

                cGlobalHandling.MessageBox("Servicemode = " + (bServiceMode ? "EIN" : "AUS"), "Servicemode");
            }
            catch (Exception ex)
            {
                SiAuto.LogException("SetSMTServiceMode", ex);
                throw;
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }
        }
Пример #3
0
        public static bool Load_Settings(cData_Settings Data_Settings)
        {
            bool       bRet = false;
            cDB_SQL_CE qry  = null;

            try
            {
                qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'Arbeitsplatztyp'"))
                {
                    Data_Settings.Set_ArbeitsplatzTyp = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'Dioausgänge'"))
                {
                    Data_Settings.bDioausgänge = SetUpToBool(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'Dioeingänge'"))
                {
                    Data_Settings.bDioeingänge = SetUpToBool(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenMinGew'"))
                {
                    Data_Settings.dEinzelWiegungMinGewicht = SetUpToDouble(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenMaxGew'"))
                {
                    Data_Settings.dEinzelWiegungMaxGewicht = SetUpToDouble(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenTara'"))
                {
                    Data_Settings.dPalettenTara = SetUpToDouble(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenMax'"))
                {
                    Data_Settings.dPalettenMax = SetUpToDouble(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'Arbeitsplatzname'"))
                {
                    Data_Settings.sArbeitsplatzname = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'CSVPath'"))
                {
                    Data_Settings.CSVPath = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value FROM [SMT_SETTINGS] WHERE FieldName = 'ServicePasswort'"))
                {
                    Data_Settings.sServicePasswort = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value FROM [SMT_SETTINGS] WHERE FieldName = 'ZeilenProA4Seite'"))
                {
                    Data_Settings.iZeilenProSeite = SetUpToInt(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value FROM [SMT_SETTINGS] WHERE FieldName = 'ServiceMode'"))
                {
                    Data_Settings.bServiceMode = SetUpToBool(qry.getS("Field_Value"));
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr1'"))
                {
                    Data_Settings.ArtikelNrListe[0] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr2'"))
                {
                    Data_Settings.ArtikelNrListe[1] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr3'"))
                {
                    Data_Settings.ArtikelNrListe[2] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr4'"))
                {
                    Data_Settings.ArtikelNrListe[3] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr5'"))
                {
                    Data_Settings.ArtikelNrListe[4] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'ArtikelNr6'"))
                {
                    Data_Settings.ArtikelNrListe[5] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName1'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[0] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName2'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[1] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName3'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[2] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName4'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[3] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName5'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[4] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'PalettenName6'"))
                {
                    Data_Settings.KlassenBezeichnungsListe[5] = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'GruppenName1'"))
                {
                    Data_Settings.sGruppenName1 = qry.getS("Field_Value");
                }

                if (qry.OPEN("SELECT Field_Value from [SMT_SETTINGS] Where FieldName = 'GruppenName2'"))
                {
                    Data_Settings.sGruppenName2 = qry.getS("Field_Value");
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("cData_Settings_Handling", ex);
                throw;
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }

            return(bRet);
        }