Beispiel #1
0
        private void cmdDel_ÜbernWG_Daten_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show(
                "Wirlich löschen ?",
                "Service Mode", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2);

            if (dialogResult == DialogResult.Yes)
            {
                cDB_SQL_CE qry = null;
                try
                {
                    string sSQL = "DELETE FROM [SMT_WAAGE] ";
                    qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);
                    qry.Exec(sSQL);
                }
                catch (Exception ex)
                {
                    SiAuto.LogException(ex);
                    throw;
                }
                finally
                {
                    if (qry != null)
                    {
                        qry.FREE();
                    }
                }
            }
        }
Beispiel #2
0
        private void cmdKill_SMT_Waage_Click(object sender, EventArgs e)
        {
            cDB_SQL_CE qry = null;

            try
            {
                string sSQL = "Delete from [SMT_WAAGE]";

                try
                {
                    qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);
                    qry.Exec(sSQL);
                }
                catch (Exception ex)
                {
                    SiAuto.LogException(ex);
                }
                finally
                {
                    if (qry != null)
                    {
                        qry.FREE();
                    }
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("SummenGruppeLöschen", ex);
                throw;
            }
        }
Beispiel #3
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();
                }
            }
        }
Beispiel #4
0
        public static void Nummernkreis1_Set(int FortNr)
        {
            cDB_SQL_CE qry  = null;
            string     sSQL = "";

            try
            {
                sSQL = "UPDATE [SMT_SETTINGS] SET Field_Value = '" + FortNr.ToString() + "' Where FieldName = 'Nummernkreis1'";
                qry  = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);

                qry.Exec(sSQL);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }
        }
Beispiel #5
0
        public static bool Save_Settings(cData_Settings Data_Settings)
        {
            bool       bRet = false;
            cDB_SQL_CE qry  = null;

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

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + ENUM_HELPER.Arbeitsplatztyp_EnumToInt(Data_Settings.Arbeitsplatztyp).ToString() + "' " +
                         "Where FieldName = 'Arbeitsplatztyp'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.bDioausgänge.ToString() + "' " +
                         "Where FieldName = 'Dioausgänge'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.bDioeingänge.ToString() + "' " +
                         "Where FieldName = 'Dioeingänge'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.dEinzelWiegungMinGewicht.ToString() + "' " +
                         "Where FieldName = 'PaletteMinGew'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.dEinzelWiegungMaxGewicht.ToString() + "' " +
                         "Where FieldName = 'PaletteMaxGew'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.dPalettenTara.ToString() + "' " +
                         "Where FieldName = 'PaletteTara'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.dPalettenMax.ToString() + "' " +
                         "Where FieldName = 'PalettenMax'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.sArbeitsplatzname.ToString() + "' " +
                         "Where FieldName = 'Arbeitsplatzname'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.CSVPath.ToString() + "' " +
                         "Where FieldName = 'CSVPath'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.sServicePasswort.ToString() + "' " +
                         "Where FieldName = 'ServicePasswort'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.iZeilenProSeite.ToString() + "' " +
                         "Where FieldName = 'ZeilenProA4Seite'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[0].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr1'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[1].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr2'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[2].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr3'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[3].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr4'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[4].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr5'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.ArtikelNrListe[5].ToString() + "' " +
                         "Where FieldName = 'ArtikelNr6'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[0].ToString() + "' " +
                         "Where FieldName = 'PalettenName1'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[1].ToString() + "' " +
                         "Where FieldName = 'PalettenName2'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[2].ToString() + "' " +
                         "Where FieldName = 'PalettenName3'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[3].ToString() + "' " +
                         "Where FieldName = 'PalettenName4'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[4].ToString() + "' " +
                         "Where FieldName = 'PalettenName5'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.KlassenBezeichnungsListe[5].ToString() + "' " +
                         "Where FieldName = 'PalettenName6'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.sGruppenName1.ToString() + "' " +
                         "Where FieldName = 'GruppenName1'");

                qry.Exec("UPDATE [SMT_SETTINGS] SET Field_Value = '" + Data_Settings.sGruppenName2.ToString() + "' " +
                         "Where FieldName = 'GruppenName2'");
            }
            catch (Exception ex)
            {
                SiAuto.LogException("cData_Settings_Handling.Save_Settings", ex);
                throw;
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }

            return(bRet);
        }