Ejemplo n.º 1
0
        public string fetchName(long ID)
        {
            string song;

            strURL = strSongAPI + ID.ToString() + "&" + "ids=%5B" + ID.ToString() + "%5D";
            //MessageBox.Show(strURL);
            HttpWebRequest request;

            request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);
            HttpWebResponse response;

            response = (System.Net.HttpWebResponse)request.GetResponse();
            System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream(), Encoding.UTF8);
            song = responseStream.ReadToEnd();
            responseStream.Close();
            objectName songa = JsonConvert.DeserializeObject <objectName>(song);
            song1      a     = JsonConvert.DeserializeObject <song1>(song);

            if (a.songs[0].name != "" && a.songs[0].name != null)
            {
                return(a.songs[0].name.ToString());
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 2
0
 public objectList GetAllMessage()
 {
     db = new SMSDataClassesDataContext();
     objectList l = new objectList();
     var que = (from i in db.SMS_QueuedBoxes.Where(i => i.Status == false) select i).ToList();
     if (que != null)
     {
         foreach (var q in que)
         {
             objectName c = new objectName();
             c.Id = q.ID;
             c.Number = q.Number;
             c.Message = config.decrypt(q.Message);
             l.Add(c);
         }
         return l;
     }
     return null;
 }
Ejemplo n.º 3
0
        public string fetchArtist(long ID)
        {
            string song;

            strURL = strSongAPI + ID.ToString() + "&" + "ids=%5B" + ID.ToString() + "%5D";
            HttpWebRequest request;

            request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);
            HttpWebResponse response;

            response = (System.Net.HttpWebResponse)request.GetResponse();
            System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream(), Encoding.UTF8);
            song = responseStream.ReadToEnd();
            responseStream.Close();
            objectName songa = JsonConvert.DeserializeObject <objectName>(song);
            song1      a     = JsonConvert.DeserializeObject <song1>(song);

            int    Num      = 0;
            string ToReturn = "";

            try
            {
                while (a.songs[0].artists[Num].name.ToString() != "" || a.songs[0].artists[Num].name.ToString() != null)
                {
                    ToReturn = ToReturn + "," + a.songs[0].artists[Num].name.ToString();
                    Num++;
                }
            }
            catch
            {
            }
            //}
            if (ToReturn.StartsWith(","))
            {
                return(ToReturn.TrimStart(",".ToCharArray()));
            }
            else
            {
                return(ToReturn);
            }
        }
    internal static string bayanihan_reg(string input)
    {
        objList = new objectList();
        string[] msg = input.Split('/');

        string code = string.Empty;
        for (int i = 0; i < msg.Length; i++)
        {
            objectName objName = new objectName();
            objName.Group = "BAYANIHAN";
            objName.Province = "N/A";
            objName.Section_a = 0;
            objName.Section_b = 0;
            switch (i)
            {
                case 0:
                    objName.Lastname = msg[i];
                    break;
                case 1:
                    objName.Firstname = msg[i];
                    break;
                case 2:
                    objName.Town = msg[i];
                    break;
                case 3:
                    objName.Sponsor = msg[i];
                    break;
                case 4:
                    objName.Pin = msg[i];
                    code = msg[i];
                    break;
            }
            objList.Add(objName);
        }
        return code;
    }
 internal static string bmc_reg(string input)
 {
     objList = new objectList();
     string[] msg = input.Split('/');
     string code = string.Empty;
     for (int i = 0; i < msg.Length; i++)
     {
         objectName objName = new objectName();
         switch (i)
         {
             case 0:
                 objName.Group = msg[i];
                 break;
             case 1:
                 objName.Lastname = msg[i];
                 break;
             case 2:
                 objName.Firstname = msg[i];
                 break;
             case 3:
                 objName.Town = msg[i];
                 break;
             case 4:
                 objName.Province = msg[i];
                 break;
             case 5:
                 objName.Sponsor = msg[i];
                 break;
             case 6:
                 objName.Section_a = Convert.ToInt32(msg[i]);
                 break;
             case 7:
                 objName.Section_b = Convert.ToInt32(msg[i]);
                 break;
             case 8:
                 objName.Pin = msg[i];
                 code = msg[i];
                 break;
         }
         objList.Add(objName);
     }
     return code;
 }