Example #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();
                    }
                }
            }
        }
        /// <summary>
        /// Liefere den Substring wie angefordert zurück, auch ein PadR erfolgt
        /// Wir die Angeforderte Länge überschritten, so wird der Original String für das Padding herangezogen
        /// </summary>
        /// <param name="sIn">Arbeitsstring</param>
        /// <param name="iStart">Startposition für das Substring</param>
        /// <param name="iLen">Länge für das Substring</param>
        /// <param name="iPadRLen">Nach dem Schneiden auf diese Anzahl Padden</param>
        /// <param name="sFunktionsName">Name der Funktion für die Errormessage</param>
        /// <returns></returns>
        #region Get_Safe_SubString_and_PadRight
        public static string Get_Safe_SubString_and_PadRight(string sIn, int iStart, int iLen, int iPadRLen, string sFunktionsName)
        {
            try
            {
                string sDummy = "";

                //Fehler 1 Abfangen, Startpos höher als Stringlänge
                //Fehler 2 Abfangen, Länge geht sich nicht aus
                if ((iStart > sIn.Length) ||
                    (iStart + iLen) > sIn.Length)
                {
                    if ((iStart + iLen) > sIn.Length)
                    {
                        sDummy = sIn.Substring(iStart);
                    }
                    else
                    {
                        sDummy = sIn;
                    }
                }
                else
                {
                    sDummy = sIn.Substring(iStart, iLen);
                }

                sDummy = sDummy.PadRight(iPadRLen);

                return(sDummy);
            }
            catch (Exception ex)
            {
                SiAuto.LogException("Get_Safe_SubString_and_PadRight", ex);
                return("SUBSTRERROR");
            }
        }
Example #3
0
        private void ctrlButtonBar1_EventButtonClick(object sender, string fTaste, int iTastenCode, string fTag)
        {
            try
            {
                switch (fTag.ToUpper())
                {
                case "§CLOSE":
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                    break;

                case "§SAVE":
                    this.Save_Settings();
                    break;

                case "§DIOTEST":
                    this.Starte_DIO_Test();
                    break;

                case "§DRUCKERTESTKURZ":
                    this.Starte_Testdruck_Kurz();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("ctrlButtonBar1_EventButtonClick4", ex);
            }
        }
Example #4
0
        private bool SendTORS232(string SendTxt)
        {
            bool bSeitewechsel = false;

            try
            {
                if (SendTxt.IndexOf('\n') > 0)
                {
                    iCountLines++;
                }

                if (iCountLines >= iMaxLinesPerPage)
                {
                    bSeitewechsel = true;
                    iCountLines   = 0;
                }

                byte[] encodingBytes = Encoding.GetEncoding(850).GetBytes(SendTxt);
                cGlobalScale.objRS232_X5.SendBytes(encodingBytes, encodingBytes.Length);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }

            return(bSeitewechsel);
        }
Example #5
0
        private void ctrlButtonBar1_EventButtonClick(object sender, string fTaste, int iTastenCode, string fTag)
        {
            try
            {
                switch (fTag.ToUpper())
                {
                case "§CLOSE":
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();

                    break;

                case "§START":
                    if (this.ValidateInput())
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    break;

                case "§SERVICE":
                    this.RunServiceMode();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("ctrlButtonBar1_EventButtonClick1", ex);
            }
        }
Example #6
0
        private void cmdStartoption_Click(object sender, EventArgs e)
        {
            try
            {
                if (cGlobalHandling.Frage_Passwort(
                        this.objWiegung.objSettings.get_ArbeitsplatzName,
                        /*HideScaleWindow*/ false,
                        this.objWiegung.objSettings.sServicePasswort,
                        /*Terminal ID*/ "",
                        /*ShowServiceMode*/ false) == DialogResult.OK)
                {
                    frmStartOptionen frmSO  = new frmStartOptionen();
                    DialogResult     dlgRes = frmSO.ShowDialog();
                    frmSO.Dispose();
                    frmSO = null;

                    if (dlgRes == DialogResult.OK)
                    {
                        cData_Settings_Handling.Load_Settings(this.objWiegung.objSettings);
                        this.dispTopLabelLeft.Text = this.objWiegung.objSettings.get_ArbeitsplatzName;
                    }
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
            finally
            {
            }
        }
        public static bool Load_Settings(ref cBeladungsDaten BeladungsDaten)
        {
            cDB_SQL_CE qry  = null;
            bool       bRet = false;

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

                if (qry.OPEN("SELECT * from [SMT_WIEGUNG] Where Wiegung_PalNr = '" + BeladungsDaten.iPalettenNr.ToString() + "'"))
                {
                    BeladungsDaten.dWiegung_Gesamtgewicht = qry.getF("Wiegung_Sum_Kg");
                    BeladungsDaten.iWiegung_Gesamtanzahl  = qry.getI("Wiegung_Sum_Stk");
                    bRet = true;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("cWiegung_Handling.Load_Settings", ex);
                throw;
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }

            return(bRet);
        }
        public static bool Save_Palette(ctrlPalette PalettenUserControl)
        {
            bool       bRet = false;
            cDB_SQL_CE qry  = null;

            try
            {
                qry = new cDB_SQL_CE(cDB_Settings.CE_ConnectionString);
                qry.ADD("Wiegung_Sum_Kg", PalettenUserControl.objBeladungsDaten.dWiegung_Gesamtgewicht);
                qry.ADD("Wiegung_Sum_Stk", PalettenUserControl.objBeladungsDaten.iWiegung_Gesamtanzahl);
                qry.UPDATE_THROW("SMT_WIEGUNG", "Wiegung_PalNr", PalettenUserControl.objBeladungsDaten.iPalettenNr, "Save_Palette", 99);
            }
            catch (Exception ex)
            {
                SiAuto.LogException("cWiegung_Handling.Save_Palette", ex);
                throw;
            }
            finally
            {
                if (qry != null)
                {
                    qry.FREE();
                }
            }

            return(bRet);
        }
Example #9
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;
            }
        }
Example #10
0
        private bool drucke_Kopf_Go()
        {
            bool bRet = false;

            try
            {
                // Überschrift
                this.PrintLine("Wollsdorf Leder Schmidt - Summenprotokoll" + "\x0d\x0a");
                this.PrintLine("-----------------------------------------" + "\x0d\x0a");
                this.PrintLine("\x0d\x0a");
                this.PrintLine("Datum:      " + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\x0d\x0a");
                this.PrintLine("\x0d\x0a");

                int    iNummer = 0;
                string sDummy  = "";

                // Klassenüberschrift
                string sTemp = "";

                this.PrintLine(this.drucke_WiegeHeader(this.iCountPage));
                this.PrintLine(("".PadLeft(80, '-') + "\x0d\x0a"));

                #region Drucke
                iNummer = 0;
                foreach (string sSendTxt in this.lstDruckerBuffer)
                {
                    iNummer++;

                    if (iNummer >= 3)
                    {
                        System.Threading.Thread.Sleep(300);
                        iNummer = 0;
                    }

                    if (this.SendTORS232(sSendTxt))
                    {
                        // Seitenwechsel
                        this.iCountPage++;

                        cGlobalScale.objRS232_X5.SendString(new string(this.cEpson_FormFeed));
                        System.Threading.Thread.Sleep(300);
                        this.SendTORS232(this.drucke_WiegeHeader(this.iCountPage));
                        System.Threading.Thread.Sleep(300);
                        this.SendTORS232(("".PadLeft(80, '-') + "\x0d\x0a"));
                    }
                }
                #endregion

                this.lstDruckerBuffer.Clear();
                bRet = true;
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #11
0
        private bool StarteDrucken(ref ctrlPalette PalettenUserControl)
        {
            bool bRet = false;

            do
            {
                this.ShowStatus("Starte Druckvorgang!");

                try
                {
                    // Enthält R:Wollsdor.ZPL aus dem Z-Designer
                    // Ein geändertes Layout muss mit EXPORT TO PRINTER in eine Datei exportiert werden.
                    // Danach den gesamten Layout Text in den Resourcefile einfügen.
                    string sZPL_Label = Wollsdorf_Spaltwaage.Properties.Resources.sZPL_Label;
                    cGlobalHandling.Drucke_Daten(sZPL_Label);
                }
                catch (Exception ex)
                {
                    SiAuto.LogException("StarteDrucken ZPL_Label", ex);
                }

                try
                {
                    string sZPL = Wollsdorf_Spaltwaage.Properties.Resources.sZPL_Data;



                    sZPL = sZPL.Replace("@ARTNR@", PalettenUserControl.objBeladungsDaten.sSettings_ArtikelNr);
                    sZPL = sZPL.Replace("@ARTBEZ@", PalettenUserControl.objBeladungsDaten.sSettings_Bezeichnung);
                    sZPL = sZPL.Replace("@PALNR@", cGlobalNummerkreis.Nummernkreis1_GetCurrent().ToString()); //SOLL Fortlaufend sein
                    sZPL = sZPL.Replace("@GRUPPENN1@", this.objWiegung.objSettings.sGruppenName1);
                    sZPL = sZPL.Replace("@GRUPPENN2@", this.objWiegung.objSettings.sGruppenName2);
                    sZPL = sZPL.Replace("@STK@", PalettenUserControl.objBeladungsDaten.iWiegung_Gesamtanzahl.ToString());
                    sZPL = sZPL.Replace("@GEW@", PalettenUserControl.objBeladungsDaten.dWiegung_Gesamtgewicht.ToString("####0.0") + " kg"); //LÄNGE Stimmt im Zebra?
                    sZPL = sZPL.Replace("@DATE@", DateTime.Now.ToString("dd.MM.yyyy HH:mm"));

                    cGlobalHandling.Drucke_Daten(sZPL);
                }
                catch (Exception ex)
                {
                    SiAuto.LogException("StarteDrucken ZPL_Data", ex);
                }

                DialogResult mB = cGlobalHandling.MessageBoxYesNoSicher("Ist der Ausdruck in Ordnung ?", "Ausdruck okay");

                if (mB == DialogResult.Yes)
                {
                    cGlobalNummerkreis.Nummernkreis1_SetNext();
                    bRet = true;
                    break;
                }
            } while (true);


            return(bRet);
        }
 /// <summary>
 /// Entferne alle Vornullen, mit Hilfe des TrimStart Befehls
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 #region RemoveLeadingZeroesV2
 public static string RemoveLeadingZeroesV2(string input)
 {
     try
     {
         input = "00000000010213";
         return(input.TrimStart('0'));
     }
     catch (Exception ex)
     {
         SiAuto.LogException("RemoveLeadingZeroesV2", ex);
         return("ERROR");
     }
 }
Example #13
0
        public static void Nummernkreis1_SetNext()
        {
            try
            {
                // Aktuellen Zähler lesen
                int iNext = Nummernkreis1_GetNext();

                Nummernkreis1_Set(iNext);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
        }
        private static void SendTORS232(string SendTxt)
        {
            try
            {
                Trace.Write(SendTxt);

                byte[] encodingBytes = System.Text.Encoding.Default.GetBytes(SendTxt);
                cGlobalScale.objRS232_X5.SendBytes(encodingBytes, encodingBytes.Length);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
        }
        public static CScaleWeight GetStabile()
        {
            CWeight      w = null;
            CScaleWeight s = new CScaleWeight();

            try
            {
                long lClock = Environment.TickCount;

                do
                {
                    cGlobalScale.objCIND890APIClient.CurrentScale.GetGNTInPrimaryUnit(ref s);

                    if (s.WeightStable == true && s.Status == CScaleWeight.enumScaleStatus.STATUS_WEIGHTOK)
                    {
                        //w = s.NetWeight;
                        //Trace.WriteLine(w.Weight.ToString() + " " + w.Unit + " ==>" + w.Status.ToString() + " =>STABIL");
                        break;
                    }
                    else if (s.WeightStable == false && s.Status == CScaleWeight.enumScaleStatus.STATUS_WEIGHTOK)
                    {
                        //w = s.NetWeight;
                        //Trace.WriteLine(w.Weight.ToString() + " " + w.Unit + " ==>" + w.Status.ToString() + " =>DYNAMISCH");
                    }
                    else
                    {
                        //Trace.WriteLine("ERROR");
                    }

                    if (Environment.TickCount - lClock > 4000)
                    {
                        break;
                    }
                }while (true);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }

            if (s.WeightStable == true && s.Status == CScaleWeight.enumScaleStatus.STATUS_WEIGHTOK)
            {
                return(s);
            }
            else
            {
                return(null);
            }
        }
Example #16
0
        public bool drucke_Position()
        {
            bool bRet = false;

            try
            {
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #17
0
        private bool Starte_SeitenLängenTest_Go()
        {
            bool bRet = false;

            try
            {
                // Überschrift
                for (int i = 1; i <= 180; i++)
                {
                    this.PrintLine("Zeile " + i.ToString("000") + " Sonderzeichen: äöü ÄÖÜ ß \x0d\x0a");
                }

                int iNummer = 0;

                this.PrintLine("\x0d\x0a");

                iNummer = 0;
                foreach (string sSendTxt in this.lstDruckerBuffer)
                {
                    iNummer++;

                    if (iNummer >= 3)
                    {
                        System.Threading.Thread.Sleep(300);
                        iNummer = 0;
                    }

                    if (this.SendTORS232(sSendTxt))
                    {
                        //Seitenwechsel
                        cGlobalScale.objRS232_X5.SendString(new string(this.cEpson_FormFeed));

                        this.SendTORS232("************************* Neue Seite *************************\x0d\x0a");
                        this.SendTORS232("Dies sollte der Begin einer neuen Seite sein. Ist das nicht der Fall, dann wurde\x0d\x0a");
                        this.SendTORS232("die Anzahl Zeilen/Seite falsch eingestellt\x0d\x0a");
                        this.SendTORS232("Ändern Sie den Wert, Entladen das Papier und drucken nochmals\x0d\x0a");
                    }
                }

                cGlobalScale.objRS232_X5.SendString(new string(this.cEpson_FormFeed));
                bRet = true;
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #18
0
        public static int Arbeitsplatztyp_EnumToInt(cData_Settings.eArbeitsplatztyp eWert)
        {
            int iReturn = 0;

            try
            {
                iReturn = (int)eWert;
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }

            return(iReturn);
        }
Example #19
0
        public bool Starte_SeitenLängenTest()
        {
            bool bRet = false;

            try
            {
                bRet = this.Starte_SeitenLängenTest_Go();
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #20
0
        public bool drucke_Kopf()
        {
            bool bRet = false;

            try
            {
                bRet = this.drucke_Kopf_Go();
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #21
0
        public static cData_Settings.eArbeitsplatztyp Arbeitsplatztyp_StringToEnum(string sWert)
        {
            cData_Settings.eArbeitsplatztyp eResult = cData_Settings.eArbeitsplatztyp.none;

            try
            {
                // YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
                eResult = (cData_Settings.eArbeitsplatztyp)Enum.Parse(typeof(cData_Settings.eArbeitsplatztyp), sWert, true);
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }

            return(eResult);
        }
Example #22
0
        private bool Lese_Gewicht(ref CScaleWeight sLinks, ref CScaleWeight sRechts)
        {
            bool bRet = false;

            sRechts = null;
            sLinks  = null;

            try
            {
                sLinks = cGlobalScale.GetStabile(/*Linke oder Rechte Waage*/ 0);

                if (sLinks == null)
                {
                    // Hide Message Panel
                    this.ZeigeMeldung("");

                    this.dispWaitText.Visible = false;
                    this.ZeigeFehlerMeldung("Fehler\nKein gültiges Gewicht");
                    bRet = false;
                }
                else
                {
                    sRechts = cGlobalScale.GetStabile(/*Linke oder Rechte Waage*/ 1);

                    if (sRechts == null)
                    {
                        // Hide Message Panel
                        this.ZeigeMeldung("");

                        this.dispWaitText.Visible = false;
                        this.ZeigeFehlerMeldung("Fehler\nKein gültiges Gewicht");
                        bRet = false;
                    }
                    else
                    {
                        bRet = true;
                    }
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("Wiegen", ex);
            }


            return(bRet);
        }
Example #23
0
        private bool drucke_Fußzeile_Go()
        {
            bool bRet = false;

            try
            {
                int iNummer = 0;

                this.PrintLine(("".PadLeft(80, '-') + "\x0d\x0a"));
                this.PrintLine("*Listenende" + "\x0d\x0a");

                #region Drucke
                iNummer = 0;
                foreach (string sSendTxt in this.lstDruckerBuffer)
                {
                    iNummer++;

                    if (iNummer >= 3)
                    {
                        System.Threading.Thread.Sleep(300);
                        iNummer = 0;
                    }

                    if (this.SendTORS232(sSendTxt))
                    {
                        // Seitenwechsel
                        this.iCountPage++;

                        cGlobalScale.objRS232_X5.SendString(new string(this.cEpson_FormFeed));
                        System.Threading.Thread.Sleep(300);
                        this.SendTORS232(this.drucke_WiegeHeader(this.iCountPage));
                        System.Threading.Thread.Sleep(300);
                        this.SendTORS232(("".PadLeft(80, '-') + "\x0d\x0a"));
                    }
                }
                #endregion

                this.lstDruckerBuffer.Clear();
                bRet = true;
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
        /// <summary>
        /// Wenn SimuWert >=0 dann wird Simuwert verwendet
        /// </summary>
        /// <param name="dSimuWert"></param>
        /// <returns></returns>
        private void Starte_Gewichtsübernahme(double dSimuWert)
        {
            try
            {
                this.ZeigeMeldung("Bitte warten, Lese Gewicht");

                CScaleWeight scaleWeight = null;

                // Lese Gewicht von Waage mit Fehlerhandling
                if (!this.Lese_Gewicht(ref scaleWeight, dSimuWert))
                {
                    this.cmdCancel.Visible = true;
                    this.cmdRetry.Visible  = true;
                }
                else
                {
                    // Positives Gewicht. Summe zu der Palette hinzufügen
                    objSelAktivUserControl.objBeladungsDaten.dWiegung_Gesamtgewicht += scaleWeight.NetWeight.Weight;
                    objSelAktivUserControl.objBeladungsDaten.iWiegung_Gesamtanzahl++;

                    // Die letzte Wiegung für das Storno puffern um gegebenenfalls minus rechnen zu können
                    objSelAktivUserControl.objBeladungsDaten.dWiegung_LastNetto = scaleWeight.NetWeight.Weight;

                    //iCurr.dtWiegezeitpunkt = DateTime.Now;
                    //iCurr.dBrutto = scaleWeight.GrossWeight.Weight;
                    //iCurr.dTara = scaleWeight.TareWeight.Weight;
                    //iCurr.dNetto = scaleWeight.NetWeight.Weight;

                    DialogResult = DialogResult.OK;
                    cWiegung_Handling.Save_Palette(objSelAktivUserControl);
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
            finally
            {
                // Hide Message Panel
                this.ZeigeMeldung("");

                this.dispWaitText.Visible = false;
                Application.DoEvents();
            }
        }
Example #25
0
        private void cmdSetup_Click(object sender, EventArgs e)
        {
            DialogResult dlgRes;

            try
            {
                dlgRes = cGlobalHandling.Frage_Passwort(
                    this.objWiegung.objSettings.get_ArbeitsplatzName,
                    /*ShoHideScale*/ false,
                    this.objWiegung.objSettings.sServicePasswort,
                    /*TerminalID*/ "",
                    /*ShowServiceMode*/ true);

                if (dlgRes == DialogResult.Ignore)
                {
                    // Invertiere den Status Service Mode
                    cData_Settings_Handling.SetSMTServiceMode(this.objWiegung.objSettings);

                    // Visuelle Anzeige das der Servicemode ein ist
                    this.RefreshServiceModeGui();

                    this.Init_ButtonBar();
                }
                else if (dlgRes == DialogResult.OK)
                {
                    frmSetup f = new frmSetup(ref this.objWiegung);
                    dlgRes = f.ShowDialog();
                    f.Dispose();
                    f = null;

                    if (dlgRes == DialogResult.OK)
                    {
                        cData_Settings_Handling.Load_Settings(this.objWiegung.objSettings);
                        this.dispTopLabelLeft.Text = this.objWiegung.objSettings.get_ArbeitsplatzName;

                        this.RefreshServiceModeGui();

                        this.Init_ButtonBar();
                    }
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
            }
        }
Example #26
0
        private void ctrlButtonBar1_EventButtonClick(object sender, string fTaste, int iTastenCode, string fTag)
        {
            try
            {
                switch (fTag.ToUpper())
                {
                case "§CLOSE":

                case "§NULLSTELLEN":
                    cGlobalScale.ZeroScale();
                    break;

                case "§TARIEREN":
                    cGlobalScale.TareScale();
                    break;
                //case "§STARTÜW":
                //    this.Starte_Ablauf();
                //    cGlobalScale.Show_Scale();
                //    break;
                //case "§STARTSW":

                //    cGlobalScale.Show_Scale();
                //    break;
                case "§START":
                    frmSAPEingabe frmSAPEingabe = new frmSAPEingabe(ref objWiegung);
                    frmSAPEingabe.ShowDialog();
                    break;

                //case "§PALETTENAUSWAHLREADONLY":
                //    frmPalettenauswahl frmPalette1 = new frmPalettenauswahl(objWiegung, true);
                //    frmPalette1.ShowDialog();
                //    break;
                //case "§PALETTENAUSWAHL":
                //    frmPalettenauswahl frmPalette2 = new frmPalettenauswahl(objWiegung, false);
                //    frmPalette2.ShowDialog();
                //    break;
                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("ctrlButtonBar1_EventButtonClick2", ex);
            }
        }
Example #27
0
        private bool Starte_DruckerTest_Go()
        {
            bool bRet = false;

            try
            {
                this.PrintLine("*************************************************************\x0d\x0a");
                this.PrintLine("Druckertest\x0d\x0a");
                this.PrintLine(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\x0d\x0a");
                this.PrintLine("WOLLSDORF EPSON DRUCKER TEST\x0d\x0a");
                this.PrintLine("Test der Umlaute: Ö Ä Ü ö ä ü ß\x0d\x0a");
                this.PrintLine("*************************************************************\x0d\x0a");
                this.PrintLine("Test der Zeilenlänge:\x0d\x0a");
                this.PrintLine("123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x\x0d\x0a");
                this.PrintLine("        10        20        30        40        50        60        70        80\x0d\x0a");
                this.PrintLine("*************************************************************\x0d\x0a");

                int iNummer = 0;
                this.PrintLine("\x0d\x0a");

                iNummer = 0;
                foreach (string sSendTxt in this.lstDruckerBuffer)
                {
                    iNummer++;

                    if (iNummer >= 3)
                    {
                        System.Threading.Thread.Sleep(300);
                        iNummer = 0;
                    }

                    this.SendTORS232(sSendTxt);
                }

                cGlobalScale.objRS232_X5.SendString(new string(this.cEpson_FormFeed));
                bRet = true;
            }
            catch (Exception ex)
            {
                SiAuto.LogException(ex);
                throw;
            }
            return(bRet);
        }
Example #28
0
        private void ctrlButtonBar1_EventButtonClick(object sender, string fTaste, int iTastenCode, string fTag)
        {
            try
            {
                switch (fTag.ToUpper())
                {
                case "§CLOSE":
                    this.Close();
                    break;

                case "§NULLSTELLEN":
                    this.ShowStatus("Waage wird Nullgestellt!");
                    cGlobalScale.ZeroScale();
                    this.ShowStatus("Bereit...");
                    break;

                case "§TARIEREN":
                    this.ShowStatus("Waage wird Tariert!");
                    cGlobalScale.TareScale();
                    this.ShowStatus("Bereit...");
                    break;

                case "§STORNO":
                    this.ShowStatus("Bitte Palette für Storno auswählen!");
                    this.timer1.Enabled = true;
                    this.bStorno        = true;
                    break;

                case "§ABSCHLUSS":
                    this.ShowStatus("Bitte Palette für Abschluss auswählen!");
                    this.timer1.Enabled = true;
                    this.bAbschluss     = true;
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("ctrlButtonBar1_EventButtonClick11", ex);
            }
        }
Example #29
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);
        }
        private void Reset_TextBox()
        {
            try
            {
                Control c = FindFocusedControl(this.Parent);

                if (c != null)
                {
                    if (c.GetType() == typeof(TextBox))
                    {
                        ((TextBox)c).Text = "";
                    }
                }
            }
            catch (Exception ex)
            {
                SiAuto.LogException("Reset_TextBox", ex);
                throw;
            }
        }