public static List <Object> getRelaysForMap()
        {
            List <Object> relays = new List <Object>();

            var cn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            using (cn)
            {
                DataTable         questionTable = new DataTable();
                DataRowCollection rows;
                string            _sql = @"SELECT station_id, station_isActive, isGateway, region, queueLimit FROM RelayStation";
                var cmd = new SqlCommand(_sql, cn);

                cn.Open();

                questionTable.Load(cmd.ExecuteReader());
                rows = questionTable.Rows;

                foreach (DataRow row in rows)
                {
                    Relay tempRelay = new Relay();
                    tempRelay.ipAddress  = Convert.ToString(row["station_id"]);
                    tempRelay.id         = Convert.ToString(row["station_id"]);
                    tempRelay.region     = Convert.ToString(row["region"]);
                    tempRelay.isActive   = Convert.ToBoolean(row["station_isActive"]);
                    tempRelay.isGateway  = Convert.ToBoolean(row["isGateway"]);
                    tempRelay.queueLimit = Convert.ToInt32(row["queueLimit"]);
                    if (tempRelay.id.Equals(PROCESSINGCENTERIP, StringComparison.Ordinal))
                    {
                        tempRelay.group = PROCESSINGCENTERGROUP;
                    }
                    else
                    {
                        tempRelay.group = RELAYGROUP;
                    }
                    relays.Add(tempRelay);
                }
            }

            return(relays);
        }
        public static void addStore(int weight, string ipAddress, string relayIP, string storeName)
        {
            string region = Relay.getRegion(relayIP);

            var cn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            using (cn)
            {
                string _sql = @"INSERT INTO Store (store_id, store_name, region) VALUES(@IPAddress, @StoreName, @Region)";
                var    cmd  = new SqlCommand(_sql, cn);
                cmd.Parameters.Add("@IPAddress", SqlDbType.VarChar).Value = ipAddress;
                cmd.Parameters.Add("@StoreName", SqlDbType.VarChar).Value = storeName;
                cmd.Parameters.Add("@Region", SqlDbType.VarChar).Value    = region;

                cn.Open();
                cmd.ExecuteNonQuery();
                cn.Close();
            }

            Connection.addConnection(weight, ipAddress, relayIP);
        }