Ejemplo n.º 1
0
        private void wsTrnTkm_OnMessage(object sender, MessageEventArgs e)
        {
            TrnTkm d = JsonConvert.DeserializeObject <TrnTkm>(e.Data);

            queriesTableAdapter.MDF_TRNTKM(d.PutGet, d.NewID, d.ID, d.Stu, d.TrnID, d.TkmID, d.MsbO, d.MsbA, d.MsbV, d.MsbB, d.MsbPA, d.MsbPV);
            textBox1.Invoke(new Action(() => textBox1.AppendText($"TrnTkm: {d.PutGet} -> {d.NOR} {d.ID}\r\n")));

            TrnTkmSay--;
        }
Ejemplo n.º 2
0
        private void PutTRNTKM(long TrnID)
        {
            textBox1.Invoke(new Action(() => textBox1.AppendText("\r\nTurnuva Takımları\r\n")));

            if (wsTrnTkm.ReadyState != WebSocketState.Open)
            {
                wsTrnTkm.Connect();
            }

            if (wsTrnTkm.ReadyState == WebSocketState.Open)
            {
                int nor = 0;
                if (TrnID == 0)
                {
                    nor = trntkmTableAdapter.FillByStu(this.ds.TRNTKM);
                }
                else
                {
                    nor = trntkmTableAdapter.FillByTrnStu(this.ds.TRNTKM, TrnID);
                }

                TrnTkmSay = nor;

                foreach (DataSet1.TRNTKMRow row in ds.TRNTKM.Rows)
                {
                    var obj = new TrnTkm();
                    obj.NOR = nor--;

                    obj.ID    = row.ID;
                    obj.Stu   = row.STU;
                    obj.TrnID = row.TRNID;
                    obj.TkmID = row.TKMID;

                    obj.MsbO  = row.IsMSBONull() ? (short)0 : row.MSBO;
                    obj.MsbA  = row.IsMSBANull() ? (short)0 : row.MSBA;
                    obj.MsbV  = row.IsMSBVNull() ? (short)0 : row.MSBV;
                    obj.MsbB  = row.IsMSBBNull() ? (short)0 : row.MSBB;
                    obj.MsbPA = row.IsMSBPANull() ? (short)0 : row.MSBPA;
                    obj.MsbPV = row.IsMSBPVNull() ? (short)0 : row.MSBPV;

                    string output = JsonConvert.SerializeObject(obj);
                    wsTrnTkm.Send(output);
                }
            }
            else
            {
                textBox1.AppendText("--X\r\n");
            }
        }
Ejemplo n.º 3
0
        private void GetTRNTKMOYN()
        {
            textBox1.Invoke(new Action(() => textBox1.AppendText("\r\nTurnuva Takım Oyuncuları\r\n")));

            if (wsTrnTkmOyn.ReadyState != WebSocketState.Open)
            {
                wsTrnTkmOyn.Connect();
            }

            if (wsTrnTkmOyn.ReadyState == WebSocketState.Open)
            {
                var obj = new TrnTkm();
                obj.PutGet = "G";
                string output = JsonConvert.SerializeObject(obj);
                if (GetTrnTkmOynSay() > 0)
                {
                    wsTrnTkm.Send(output);
                }
            }
            else
            {
                textBox1.Invoke(new Action(() => textBox1.AppendText("\r\nNo Connection\r\n")));
            }
        }