Example #1
0
        public static string UpdateDivContentTab(string ID, string Wert)
        {
            ClsCommand cmd = new ClsCommand();

            cmd.Domain   = "AN";
            cmd.Command  = "tabvar";
            cmd.Property = ID;
            cmd.Value1   = Wert;

            return(new JavaScriptSerializer().Serialize(cmd));
        }
Example #2
0
        public static void SwitchPage(ClsCommand rb)
        {
            int pageID = Convert.ToInt32(rb.Page);

            ClsDisplay.SetPage(ClsPageSets.ActivePageSet(), pageID);

            // answer
            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "ActivePage"))));

            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "DivsActivePage", pageSet: rb.PageSet, page: rb.Page))));
        }
Example #3
0
        public static void ResetAFootball(ClsCommand rb)
        {
            ClsDBVariablen.Instance.SetTextVariableWert("S39", ClsDBVariablen.Instance.GetTextVariable("S39").Default);

            ClsDBVariablen.Instance.SetTextVariableWert("S40", ClsDBVariablen.Instance.GetTextVariable("S40").Default);

            ClsDBVariablen.Instance.SetTextVariableWert("S42", ClsDBVariablen.Instance.GetTextVariable("S42").Default);

            ClsDBVariablen.Instance.SetTextVariableWert("S43", ClsDBVariablen.Instance.GetTextVariable("S43").Default);

            ClsDBVariablen.Instance.SetTextVariableWert("S41", ClsDBVariablen.Instance.GetTextVariable("S41").Default);
        }
Example #4
0
        public static void DelEvent(ClsCommand rb)
        {
            int id = Convert.ToInt32(rb.Value1);

            ClsEreignisControler.DelEreignis(id);

            // update der Ereignistabelle
            ClsDBVariablen.Instance.SetTabellenVariableWert("T03", ClsTabellenfunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));

            // update der Torschützentabelle
            ClsTabellenfunktionen.TorschuetzeToVariable(ClsGlobal.Instance.TurnierID);
        }
Example #5
0
        public static void AddEvent(ClsCommand rb)
        {
            Core.DB.TEreignisse e = new JavaScriptSerializer().Deserialize <Core.DB.TEreignisse>(rb.Value1);
            e.CPUZeit   = DateTime.Now;
            e.Spielzeit = ClsFunktionen.Sek2uhr(Convert.ToInt32(e.Spielzeit));
            ClsEreignisControler.AddEreignis(e);

            // update der Ereignistabelle
            ClsDBVariablen.Instance.SetTabellenVariableWert("T03", ClsTabellenfunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));

            // update der Torschützentabelle
            ClsTabellenfunktionen.TorschuetzeToVariable(ClsGlobal.Instance.TurnierID);
        }
        public static void SetOptValue(ClsCommand rb)
        {
            Core.DB.Options3 o3 = Core.DBControler.ClsOptionsControler.Options3(rb.Value1);
            o3.Value = rb.Value2;
            Core.DBControler.ClsOptionsControler.SaveOptions3(o3);
            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(DataRequest(new ClsCommand(command: "Options"))));

            if (rb.Value1.Length > 12)
            {
                if (rb.Value1.Substring(0, 13) == "DisplayScreen")
                {
                    ClsGlobalEvents.Fire_DisplayPropChanged(null, null);
                }
            }
        }
Example #7
0
        public static void SetPossession(ClsCommand rb)
        {
            string str = ClsOptionsControler.Options3("PossessionBild").Value;

            if (rb.Value1 == "1")
            {
                ClsDBVariablen.Instance.SetBildVariableWert("B15", str);
                ClsDBVariablen.Instance.SetBildVariableWert("B16", "");
            }

            if (rb.Value1 == "2")
            {
                ClsDBVariablen.Instance.SetBildVariableWert("B15", "");
                ClsDBVariablen.Instance.SetBildVariableWert("B16", str);
            }
        }
Example #8
0
        public static void AddTimerEvent(ClsCommand rb)
        {
            int tnr = Convert.ToInt32(rb.Value1);

            Core.DB.Timerevent m = new Core.DB.Timerevent();
            m.TimerNr   = tnr;
            m.Active    = true;
            m.Sekunden  = 0;
            m.Eventtype = 0;
            //m.Name = "";
            m.Soundfile     = "";
            m.Layer         = "";
            m.AndereTimerNr = -1;

            Core.DBControler.ClsTimerControler.AddTimerEvent(m);
            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "Timerevents", value1: rb.Value1))));
        }
        public static void SetTablefilter(ClsCommand rb)
        {
            if (rb.Value1 == "T03")
            {
                if (rb.Value2 == "Spiel")
                {
                    ClsGlobal.Instance.FilterE.SpielNr = rb.Value3;
                }

                if (rb.Value2 == "Ereignisart")
                {
                    ClsGlobal.Instance.FilterE.Ereignisart = rb.Value3;
                }

                ClsDBVariablen.Instance.SetTabellenVariableWert("T03", ClsFunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));
            }
        }
Example #10
0
        public static void RefreshDivSiz(ClsCommand rb)
        {
            //this.Sessions.BroadcastAsync("DD|SB|refreshDivSiz|" + rb.PageSet + "|" + rb.Page + "|" + rb.Value1 + "|" + rb.Value2, null);
            //string sendstr = "DD|SB|refreshDivSiz|" + rb.PageSet + "|" + rb.Page + "|" + rb.Value1 + "|" + rb.Value2;
            //GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(sendstr));

            ClsCommand cmd = new ClsCommand();

            cmd.Domain  = "DD";
            cmd.Type    = "SB";
            cmd.Command = "refreshDivSiz";
            cmd.PageSet = rb.PageSet;
            cmd.Page    = rb.Page;
            cmd.Value1  = rb.Value1;
            cmd.Value2  = rb.Value2;

            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(new JavaScriptSerializer().Serialize(cmd)));
        }
Example #11
0
        public static void LowerTabSortPrio(ClsCommand rb)
        {
            int id = Convert.ToInt32(rb.Value1);
            List <Core.DB.TabellenSort> tl = Core.DBControler.ClsOptionsControler.Tabellensortierung();

            Core.DB.TabellenSort t1 = (from x in tl where x.ID == id select x).FirstOrDefault();
            int mem = t1.Prio;

            Core.DB.TabellenSort t2 = (from x in tl where x.Prio == mem + 1 select x).FirstOrDefault();
            if (t2 != null)
            {
                t1.Prio += 1;
                t2.Prio -= 1;
                Core.DBControler.ClsOptionsControler.SaveTabellensortierung(t1);
                Core.DBControler.ClsOptionsControler.SaveTabellensortierung(t2);
            }

            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "TabellenSort"))));
        }
        public static void VarReset(ClsCommand rb)
        {
            // Spielabschnitt
            if (rb.Value1 == "S09")
            {
                ClsDBVariablen.Instance.SetTextVariableWert(rb.Value1, "1");
            }

            // Paintballzähler M1
            if (rb.Value1 == "S46")
            {
                ClsDBVariablen.Instance.SetTextVariableWert(rb.Value1, "5");
            }

            // Paintballzähler M2
            if (rb.Value1 == "S47")
            {
                ClsDBVariablen.Instance.SetTextVariableWert(rb.Value1, "5");
            }
        }
Example #13
0
        public static void RecPerPageChange(ClsCommand rb)
        {
            ClsDBVariablen.Instance.SetTabellenVariableRecPerPage(rb.Value1, Convert.ToInt32(rb.Value2));
            if (rb.Value1 == "T01")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.TabelleToVariable_Json(ClsGlobal.Instance.TurnierID));
            }

            if (rb.Value1 == "T02")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.SpielplanToVariable_Json(ClsGlobal.Instance.TurnierID));
            }

            if (rb.Value1 == "T03")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));
            }

            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "TVariablen"))));
        }
Example #14
0
        public static void NextToActual(ClsCommand rb)
        {
            string mod = rb.Value1;

            bool beenden = true;

            if (mod == "2")
            {
                // Spiel offen lassen
                beenden = false;
            }

            bool beideNichtDa = false;

            if (mod == "3")
            {
                beenden = true;
            }

            ClsSpielfunktionen.NextGame(beenden, beideNichtDa);
        }
        public static string Command(ClsCommand rb)
        {
            string ret = "";

            try
            {
                object[] o = new object[1];
                o[0] = rb;
                //Type.GetType("void").GetMethod(cmd).Invoke(null, o);
                Type       thisType  = typeof(ClsVerteiler);          // Type.GetType("void");
                MethodInfo theMethod = thisType.GetMethod(rb.Command, new Type[] { typeof(ClsCommand) });
                theMethod.Invoke(null, new Object[] { rb });
                return(ret);
            }
            catch (Exception ex)
            {
                ret = "Fehler Command: " + rb.Command + " " + ex.InnerException;
                Console.Write(ret);
                return(ret);
            }
        }
Example #16
0
        public static void delFont(ClsCommand rb)
        {
            string file = Path.Combine(ClsMain.AppFolder, "web", "css", "fonts.css");

            // delete files
            string searchfolder = Path.Combine(ClsMain.AppFolder, "web", "fonts");

            string[] files = Directory.GetFiles(searchfolder, rb.Value1 + ".*");
            for (int i = 0; i < files.Count(); i++)
            {
                if (File.Exists(files[i]))
                {
                    File.Delete(files[i]);
                }
            }

            // delet font-face entries
            // ??



            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "FontList"))));
        }
Example #17
0
        public static void TablePageSelection(ClsCommand rb)
        {
            ClsTableFilter tf = (from x
                                 in ClsGlobal.Instance.TableFilterList
                                 where x.Table == rb.Value1 && x.Field == "SelPage"
                                 select x).FirstOrDefault();

            tf.IntValue = Convert.ToInt32(rb.Value2);

            if (rb.Value1 == "T01")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.TabelleToVariable_Json(ClsGlobal.Instance.TurnierID));
            }

            if (rb.Value1 == "T02")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.SpielplanToVariable_Json(ClsGlobal.Instance.TurnierID));
            }

            if (rb.Value1 == "T03")
            {
                ClsDBVariablen.Instance.SetTabellenVariableWert(rb.Value1, ClsTabellenfunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));
            }
        }
Example #18
0
        public static void SetPlayer(ClsCommand rb)
        {
            string playerID = rb.Value1;

            ClsGlobal.Instance.SpielerID = playerID;

            Core.DB.Spieler p = null;

            if (playerID != "0")
            {
                int pID = Convert.ToInt32(playerID);
                p = Core.DBControler.ClsMannschaftenControler.Spieler(pID);

                ClsDBVariablen.Instance.SetTextVariableWert("S36", p.Vorname + ", " + p.Nachname);
                ClsDBVariablen.Instance.SetTextVariableWert("S37", p.NickName);
                ClsDBVariablen.Instance.SetBildVariableWert("B14", p.Bild);
            }
            else
            {
                ClsDBVariablen.Instance.SetTextVariableWert("S36", "");
                ClsDBVariablen.Instance.SetTextVariableWert("S37", "");
                ClsDBVariablen.Instance.SetBildVariableWert("B14", "");
            }
        }
Example #19
0
        public static void SetTablefilter(ClsCommand rb)
        {
            // Filter setzen
            (from x in ClsGlobal.Instance.TableFilterList where x.Table == rb.Value1 && x.Field == rb.Value2 select x).FirstOrDefault().Value = rb.Value3;

            // Filter zurück an clients senden
            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "TableFilter"))));

            // Tabelleninhalt setzetn
            switch (rb.Value1)
            {
            case "T01":
                ClsDBVariablen.Instance.SetTabellenVariableWert("T01", ClsTabellenfunktionen.TabelleToVariable_Json(ClsGlobal.Instance.TurnierID));
                break;

            case "T02":
                ClsDBVariablen.Instance.SetTabellenVariableWert("T02", ClsTabellenfunktionen.SpielplanToVariable_Json(ClsGlobal.Instance.TurnierID));
                break;

            case "T03":
                ClsDBVariablen.Instance.SetTabellenVariableWert("T03", ClsTabellenfunktionen.EreignisseToVariable_Json(ClsGlobal.Instance.TurnierID));
                break;
            }
        }
Example #20
0
 public static void SaveWebKontrol(ClsCommand rb)
 {
     Core.DB.WebKontrols wk = new JavaScriptSerializer().Deserialize <Core.DB.WebKontrols>(rb.Value1);
     Core.DBControler.ClsKontrolControler.SaveWebKontrol(wk);
     GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "WebKontrols"))));
 }
Example #21
0
        public static void delFreeEreig(ClsCommand rb)
        {
            Core.DBControler.ClsEreignisControler.DelFreeEvents();

            GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "TVariablen"))));
        }
Example #22
0
 public static void SetTicker(ClsCommand rb)
 {
     ClsDBVariablen.Instance.SetTextVariableWert("S34", rb.Value1);
 }
Example #23
0
 public static void SetHeartBeatStatus(ClsCommand rb)
 {
     ClsZeitkontroler.Instance.HeartBeatStatus = Convert.ToBoolean(rb.Value1);
     GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "HeartBeatStatus"))));
 }
Example #24
0
 public static void DelPenaltie(ClsCommand rb)
 {
     Core.DBControler.ClsOptionsControler.DelStrafe(rb.Value1);
     GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "Penalties", value1: rb.Value1))));
 }
Example #25
0
 public static void SetPenaltie(ClsCommand rb)
 {
     Core.DB.Strafen s = new JavaScriptSerializer().Deserialize <Core.DB.Strafen>(rb.Value1);
     Core.DBControler.ClsOptionsControler.SaveStrafe(s);
     GlobalServerEvents.SendMessage(null, new ClsStringEventArgs(ClsRequests.DataRequest(new ClsCommand(command: "Penalties", value1: rb.Value1))));
 }
Example #26
0
 public static void Strafen_Reset(ClsCommand rb)
 {
     ClsStrafen.DeleteStrafen();
 }
Example #27
0
 public static void delPenalty(ClsCommand rb)
 {
     ClsStrafen.Delete(rb.Team, rb.Value1);
 }
Example #28
0
 public static void ManipulatePenalty(ClsCommand rb)
 {
     ClsStrafen.Manipulate(rb.Team, rb.Value1, rb.Value2);
 }
        //  Requests werden je Client session hier behandelt und die Daten dierekt nur an den anfragenden Client gesendet

        public static string DataRequest(ClsCommand Request)
        {
            if (Request.Command == "Version")
            {
                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "";
                cmd.Type    = "Txt";
                cmd.Command = "Version";
                cmd.Value1  = System.Windows.Forms.Application.ProductVersion;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TeamList")
            {
                List <Core.DB.Mannschaften> man = Core.Mannschaften.ClsCommon.Mannschaften();
                var json = new JavaScriptSerializer().Serialize(man);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "MM";
                cmd.Type    = "JN";
                cmd.Command = "TeamList";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TeamID")
            {
                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "MM";
                cmd.Type    = "JN";
                cmd.Command = "TeamID";

                if (Request.Team == "A")
                {
                    cmd.Team   = "A";
                    cmd.Value1 = ClsGlobal.Instance.MansschaftAID;
                }

                if (Request.Team == "B")
                {
                    cmd.Team   = "B";
                    cmd.Value1 = ClsGlobal.Instance.MansschaftBID;
                }

                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "PlayerList")
            {
                string json = "";
                if (string.IsNullOrEmpty(Request.Team))
                {
                    if (Request.Value1 == "A")
                    {
                        Request.Team = ClsGlobal.Instance.MansschaftAID;
                    }

                    if (Request.Value1 == "B")
                    {
                        Request.Team = ClsGlobal.Instance.MansschaftBID;
                    }

                    List <Core.DB.Spieler> man = Core.Mannschaften.ClsCommon.SpielerListe(Request.Team);
                    json = new JavaScriptSerializer().Serialize(man);
                }
                else if (Request.Team == "ALL")
                {
                    Request.Value1 = "ALL";
                    List <Core.DB.Spieler> sp = Core.Mannschaften.ClsCommon.SpielerListe();
                    json = new JavaScriptSerializer().Serialize(sp);
                }


                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "MM";
                cmd.Type    = "JN";
                cmd.Command = "PlayerList";
                cmd.Team    = Request.Team;
                cmd.Value1  = Request.Value1;
                cmd.Value2  = json;

                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "SVariablen")
            {
                // Variablenliste senden
                List <ClsTextVariabeln> svl = ClsDBVariablen.Instance.GetAllTextVariablen();
                var json = new JavaScriptSerializer().Serialize(svl);

                ClsCommand cmd = new ClsCommand();
                cmd.Type    = "JN";
                cmd.Command = "ListeTextVariablen";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "BVariablen")
            {
                // Variablenliste senden
                List <ClsBildVariabeln> bvl = ClsDBVariablen.Instance.GetAllBildVariablen();
                var json = new JavaScriptSerializer().Serialize(bvl);

                ClsCommand cmd = new ClsCommand();
                cmd.Type    = "JN";
                cmd.Command = "ListeBildVariablen";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TVariablen")
            {
                // Variablenliste senden
                List <ClsTabellenVariabeln> bvl = ClsDBVariablen.Instance.GetAllTabellenVariablen();
                var json = new JavaScriptSerializer().Serialize(bvl);

                ClsCommand cmd = new ClsCommand();
                cmd.Type    = "JN";
                cmd.Command = "ListeTabellenVariablen";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "PictureList")
            {
                // send PictureList
                var json = new JavaScriptSerializer().Serialize(ClsCommon.FileNames("pictures"));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "PictureList";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "AudioFileList")
            {
                // send PictureList
                var json = new JavaScriptSerializer().Serialize(ClsCommon.FileNames("sounds"));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "AudioFileList";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "FontList")
            {
                // send FontList
                var json = new JavaScriptSerializer().Serialize(ClsCommon.FileNames("fonts", true));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "FontList";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "PageSets")
            {
                var json = new JavaScriptSerializer().Serialize(ClsPageSets.PageSets());

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "PageSets";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Pages")
            {
                int psid = Convert.ToInt32(Request.PageSet);
                var json = new JavaScriptSerializer().Serialize(ClsPages.PageList(psid));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "Pages";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "PageList")
            {
                var json = new JavaScriptSerializer().Serialize(ClsPages.PageList(ClsPageSets.ActivePageSet()));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "KO";
                cmd.Type    = "JN";
                cmd.Command = "PageList";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "PageColor")
            {
                var json = new JavaScriptSerializer().Serialize(ClsPages.GetStyleValue(Request.PageSet, Request.Page, "background-color"));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "PageColor";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Divs")
            {
                int psid   = Convert.ToInt32(Request.PageSet);
                int PageID = Convert.ToInt32(Request.Page);
                var json   = new JavaScriptSerializer().Serialize(ClsDivs.DivList(psid, PageID));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "Divs";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "DivsActivePage")
            {
                int ActivePageSet = ClsPageSets.ActivePageSet();
                int ActivePage    = ClsGlobal.Instance.ActivePage;
                // int PageID = Convert.ToInt32(Request.Page);
                var json = new JavaScriptSerializer().Serialize(ClsDivs.DivList(ActivePageSet, ActivePage));

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "DivsActivePage";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Page")
            {
                int         psid  = Convert.ToInt32(Request.PageSet);
                int         pid   = Convert.ToInt32(Request.Page);
                DisplayPage aPage = ClsPages.Page(psid, pid);

                var json = new JavaScriptSerializer().Serialize(aPage);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "Page";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "ActivePage")
            {
                int         ActivePageSet = ClsPageSets.ActivePageSet();
                int         ActivePage    = ClsGlobal.Instance.ActivePage;
                DisplayPage aPage         = ClsPages.Page(ActivePageSet, ActivePage);

                var json = new JavaScriptSerializer().Serialize(aPage);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "DD";
                cmd.Type    = "JN";
                cmd.Command = "ActivePage";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Options")
            {
                List <Core.DB.Options3> ol = Core.DBControler.ClsOptionsControler.Options3();

                var json = new JavaScriptSerializer().Serialize(ol);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "Opt";
                cmd.Type    = "JN";
                cmd.Command = "Options";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TabellenSort")
            {
                List <Core.DB.TabellenSort> ol = Core.DBControler.ClsOptionsControler.Tabellensortierung();

                var json = new JavaScriptSerializer().Serialize(ol);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "Opt";
                cmd.Type    = "JN";
                cmd.Command = "TabellenSort";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "HeartBeatStatus")
            {
                bool hs = ClsZeitkontroler.Instance.HeartBeatStatus;

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "Status";
                cmd.Type    = "JN";
                cmd.Command = "HeartBeatStatus";
                cmd.Value1  = hs.ToString();
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Timers")
            {
                List <Core.DB.Timer> ol = Core.DBControler.ClsTimerControler.Timers();

                var json = new JavaScriptSerializer().Serialize(ol);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "Opt";
                cmd.Type    = "JN";
                cmd.Command = "Timers";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TimerObjects")
            {
                List <ClsClock> cl   = ClsZeitkontroler.Instance.PubClockList();
                var             json = new JavaScriptSerializer().Serialize(cl);

                ClsCommand cmd = new ClsCommand();
                cmd.Domain  = "Opt";
                cmd.Type    = "JN";
                cmd.Command = "TimerObjects";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Timerevents")
            {
                try
                {
                    int TimerNr = Convert.ToInt32(Request.Value1);
                    List <Core.DB.Timerevent> ol = Core.DBControler.ClsTimerControler.TimerEvents(TimerNr);

                    var json = new JavaScriptSerializer().Serialize(ol);

                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Timerevents";
                    cmd.Value1  = json;
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
                catch
                {
                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Timerevents";
                    cmd.Value1  = "";
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
            }

            if (Request.Command == "Events")
            {
                try
                {
                    List <Core.DB.EreignissTyp> el = Core.DBControler.ClsEreignisControler.EreignissTypen();
                    foreach (Core.DB.EreignissTyp k in el)
                    {
                        //k.Nummer = ClsLocalisationFunctions.Keytext("Ereignis", k.Nummer).Substring(5);
                        k.Nummer = Core.DBControler.ClsTextControler.TextByNameAndNumber("Ereignis", k.Nummer);
                    }

                    var json = new JavaScriptSerializer().Serialize(el);

                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Events";
                    cmd.Value1  = json;
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
                catch
                {
                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Events";
                    cmd.Value1  = "";
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
            }

            if (Request.Command == "Penalties")
            {
                try
                {
                    List <Core.DB.Strafen> pl = Core.DBControler.ClsOptionsControler.Strafen();
                    var json = new JavaScriptSerializer().Serialize(pl);

                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Penalties";
                    cmd.Value1  = json;
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
                catch
                {
                    ClsCommand cmd = new ClsCommand();
                    cmd.Domain  = "Opt";
                    cmd.Type    = "JN";
                    cmd.Command = "Penalties";
                    cmd.Value1  = "";
                    return(new JavaScriptSerializer().Serialize(cmd));
                }
            }

            if (Request.Command == "WhereToGo")
            {
                string psn = ClsPageSets.GetPageSetNameFromID(ClsPageSets.ActivePageSet());
                string pn  = ClsPages.GetPageNameFromID(ClsGlobal.Instance.ActivePage);

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "GotoPage";
                cmd.PageSet = psn;
                cmd.Page    = pn;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "WebKontrols")
            {
                List <Core.DB.WebKontrols> wc = Core.DBControler.ClsKontrolControler.WebKontrols();
                var json = new JavaScriptSerializer().Serialize(wc);

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "WebKontrols";
                cmd.Type    = "JN";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TableFilter")
            {
                var json = new JavaScriptSerializer().Serialize(ClsGlobal.Instance.TableFilterList);

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "TableFilter";
                cmd.Type    = "JN";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "Anzeigetabellen")
            {
                var json = new JavaScriptSerializer().Serialize(Core.DBControler.ClsOptionsControler.AnzeigetabelleAll());

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "Anzeigetabellen";
                cmd.Type    = "JN";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TurniereKomplett")
            {
                var json = new JavaScriptSerializer().Serialize(Core.DBControler.ClsTurnierControler.TurniereKomplett(Request.Value1));

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "TurniereKomplett";
                cmd.Type    = "JN";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "TurnierSystemeKomplett")
            {
                var json = new JavaScriptSerializer().Serialize(Core.DBControler.ClsTurnierControler.TurniereKomplett("System"));

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "TurnierSystemeKomplett";
                cmd.Type    = "JN";
                cmd.Value1  = json;
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            if (Request.Command == "turnierID")
            {
                int tid = ClsGlobal.Instance.TurnierID;

                ClsCommand cmd = new ClsCommand();
                cmd.Command = "turnierID";
                cmd.Type    = "JN";
                cmd.Value1  = tid.ToString();
                return(new JavaScriptSerializer().Serialize(cmd));
            }

            return("");
        }
Example #30
0
 public static void newPenalty(ClsCommand rb)
 {
     ClsStrafen.StrafeNeu(rb.Team, rb.Player, rb.Value1);
 }