private List <ENC> CabeceraENC(RFNCCAB model)
        {
            ENC        mENC      = new ENC();
            List <ENC> lmENC     = new List <ENC>();
            string     NombreXml = "";

            mENC.ENC_1 = "NC";
            mENC.ENC_4 = lmRFPARAM.Where(m => m.CCCODE == "ENC_4").SingleOrDefault().CCDESC;
            mENC.ENC_5 = lmRFPARAM.Where(m => m.CCCODE == "ENC_5").SingleOrDefault().CCDESC;

            NombreXml = model.FPREFIJ + model.FNOTA;
            mRFPARAM  = lmRFPARAM.Where(m => m.CCCODE == "PREFIJO" && m.CCCODE2 == model.FPREFIJ).SingleOrDefault();
            if (mRFPARAM != null)
            {
                if (mRFPARAM.CCCODEN != "0")
                {
                    NombreXml = mRFPARAM.CCALTC + (double.Parse(mRFPARAM.CCCODEN) + double.Parse(model.FNOTA));
                }
            }
            mENC.ENC_6  = NombreXml;
            mENC.ENC_7  = model.FFECNC;
            mENC.ENC_8  = model.FACRTDAT.ToString("HH:mm:ss");
            mENC.ENC_9  = "9";
            mENC.ENC_10 = model.FMONEDA;
            mENC.ENC_13 = model.FCLIENT;
            mENC.ENC_15 = model.TotLineas;
            mENC.ENC_16 = model.FFECVEN;

            lmENC.Add(mENC);

            return(lmENC);
        }
Exemplo n.º 2
0
 public bool OnRead(BaseSocket sock, byte[] buf, int offset, int length)
 {
     Last = ENC.GetString(buf, offset, length);
     Console.WriteLine("RR: " + Last);
     Event.Set();
     return(true);
 }
Exemplo n.º 3
0
 public static Encounter GetBossAI(ENC _encID)
 {
     switch (_encID)
     {
         case ENC.SHADOWBEAST: return new ShadowbeastEncounter();
         default: return null;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Writes the given string to the socket after UTF-8 encoding.
        /// </summary>
        /// <param name="str">String to write out.</param>
        public override void Write(string str)
        {
            int keep = (int)m_listener[Options.CURRENT_KEEP_ALIVE];

            if (keep > 0)
            {
                m_timer.Change(keep, keep);
            }
            m_sock.Write(ENC.GetBytes(str));
        }
Exemplo n.º 5
0
    public static Sprite GetPortrait(ENC encID)
    {
        switch (encID)
        {
        case ENC.SHADOWBEAST: return(Resources.Load <Sprite>("Portraits/ShadowforgeUmbarr/Shadowbeast"));

        case ENC.SOOL: return(Resources.Load <Sprite>("Portraits/ShadowforgeUmbarr/SoolTheWarlock"));

        case ENC.UMBARR: return(Resources.Load <Sprite>("Portraits/ShadowforgeUmbarr/VoidmistressUmbarr"));

        default: return(Resources.Load <Sprite>("Portraits/Blackboard"));
        }
    }
Exemplo n.º 6
0
            public bool OnRead(BaseSocket sock, byte[] buf, int offset, int length)
            {
                string str = ENC.GetString(buf, offset, length);

                Console.WriteLine("SR: " + str);
                if (str.Contains("11111"))
                {
                    sock.Write(ENC.GetBytes(@"HTTP/1.1 200 OK
Content-Length: 10
Content-Type: text/plain

1234567890"));
                }
                else if (str.Contains("22222"))
                {
                    sock.Write(ENC.GetBytes(@"HTTP/1.1 200 OK
Content-Length: 10
Content-Type: text/plain

12345"));
                    sock.Write(ENC.GetBytes("67890"));
                }
                else if (str.Contains("33333"))
                {
                    sock.Write(ENC.GetBytes(@"HTTP/1.1 200 OK
Content-Length: 20
Content-Type: text/plain

12345"));
                    // Turning off Nagle didn't fix this.  Mrmph.
                    Thread.Sleep(300);
                    sock.Write(ENC.GetBytes("67890"));
                    Thread.Sleep(300);
                    sock.Write(ENC.GetBytes("12345"));
                    Thread.Sleep(300);
                    sock.Write(ENC.GetBytes("67890"));
                }
                return(true);
            }
Exemplo n.º 7
0
        public Encryption(XmlNode aiNode, SlaveTypes sType, int sNo, bool imported)
        {
            string strRoutineName = "Encryption";

            try
            {
                slaveType = sType;
                slaveNo   = sNo;
                if (aiNode.Attributes != null)
                {
                    try
                    {
                        ainType = (ENC)Enum.Parse(typeof(ENC), aiNode.Name);
                    }
                    catch (System.ArgumentException)
                    {
                    }
                    foreach (XmlAttribute item in aiNode.Attributes)
                    {
                        try
                        {
                            if (this.GetType().GetProperty(item.Name) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(item.Name).SetValue(this, item.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + Ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 8
0
        public Encryption(string aiName, List <KeyValuePair <string, string> > aiData, TreeNode tn, SlaveTypes sType, int sNo)
        {
            string strRoutineName = "Encryption";

            try
            {
                slaveType = sType;
                slaveNo   = sNo;
                try
                {
                    ainType = (ENC)Enum.Parse(typeof(ENC), aiName);
                }
                catch (System.ArgumentException)
                {
                }
                if (aiData != null && aiData.Count > 0) //Parse n store values...
                {
                    foreach (KeyValuePair <string, string> aikp in aiData)
                    {
                        try
                        {
                            if (this.GetType().GetProperty(aikp.Key) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(aikp.Key).SetValue(this, aikp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// Writes a string to the stream.
 /// </summary>
 /// <param name="str">
 /// The string to write; this will be transcoded to UTF-8.
 /// </param>
 public override void Write(string str)
 {
     //int keep = (int)m_listener[Options.KEEP_ALIVE];
     m_sock.Write(ENC.GetBytes(str));
 }
Exemplo n.º 10
0
 public void OnWrite(BaseSocket sock, byte[] buf, int offset, int length)
 {
     Console.WriteLine("SW: " + ENC.GetString(buf, offset, length));
 }