Пример #1
0
        private static void ProcessDataTable(DataTable dt)
        {
            int              rId = 0;
            NoParseJournal   nop = new NoParseJournal();
            MessageProcessor mp  = new MessageProcessor();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                rId                 = Convert.ToInt32(dt.Rows[i][0]);
                nop.Mtype           = dt.Rows[i]["Transid"].ToString();
                nop.Jpart           = dt.Rows[i]["JournalPart"].ToString();
                nop.NoteBills       = dt.Rows[i]["NoteBills"].ToString();
                nop.IsCashPresented = dt.Rows[i]["IsCashPresented"].ToString();
                nop.IsCashtaken     = dt.Rows[i]["IsCashtaken"].ToString();
                nop.IsCardEjected   = dt.Rows[i]["IsCardEjected"].ToString();
                nop.IsCardTaken     = dt.Rows[i]["IsCardTaken"].ToString();

                //serialize object
                string objStr = mp.SerializeObject(nop);


                //send message to socket
                //AsynchronousClient.StartClient(objStr);
                bool isSent = SetupClientSocket.SendMessage(2, objStr);
                if (isSent)
                {
                    //Delete record from table
                    mp.DeleteRowFromTable(rId);
                }
                //ClientSocket.Connect("127.0.0.1", 20215);
                //ClientSocket.Send(Encoding.UTF8.GetBytes(objStr));
            }
        }