コード例 #1
0
 /// <summary>
 /// Closes the client.
 /// </summary>
 /// <param name="instance">The instance.</param>
 private void CloseClient(SwenetDataProviderPortTypeClient instance)
 {
     if (instance == null)
     {
         return;
     }
     DisposeClient(instance);
 }
コード例 #2
0
 /// <summary>
 /// Logouts the specified session identifier.
 /// </summary>
 /// <param name="sessionId">The session identifier.</param>
 public void logout(string sessionId)
 {
     var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");
     try
     {
         clt.logout(sessionId);
     }
     finally
     {
         CloseClient(clt);
     }
 }
コード例 #3
0
        /// <summary>
        /// Gets the column names.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <returns>ArrayOfString.</returns>
        public ArrayOfString getColumnNames(string sessionId, string tableName)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");

            try
            {
                return(clt.getColumnNames(sessionId, tableName));
            }
            finally
            {
                CloseClient(clt);
            }
        }
コード例 #4
0
        // Expects:  String sessionId, String table, String[] columns, Date startDate, Date endDate
        // Returns:  Object[][] data
        // The getData method takes a session Id, table and column names, and a start and end date (the timespan).
        // It returns a two-dimensional object array with the values; this array can be addressed with data[row][column]. 2
        /// <summary>
        /// Gets the data.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns>ISwenetDataSet.</returns>
        public ISwenetDataSet getData(string sessionId, string tableName, ArrayOfString columns, DateTime startDate, DateTime endDate)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");

            try
            {
                return(clt.getData(sessionId, tableName, columns, startDate, endDate));
            }
            finally
            {
                CloseClient(clt);
            }
        }
コード例 #5
0
        /// <summary>
        /// Logouts the specified session identifier.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        public void logout(string sessionId)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");

            try
            {
                clt.logout(sessionId);
            }
            finally
            {
                CloseClient(clt);
            }
        }
コード例 #6
0
        /// <summary>
        /// Logins the specified user name.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <param name="passWord">The pass word.</param>
        /// <returns>System.String.</returns>
        public string login(string userName, string passWord)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");

            try
            {
                return(clt.login(userName, passWord));
            }
            finally
            {
                CloseClient(clt);
            }
        }
コード例 #7
0
 /// <summary>
 /// Disposes the client.
 /// </summary>
 /// <param name="client">The client.</param>
 private static void DisposeClient(SwenetDataProviderPortTypeClient client)
 {
     if (client == null)
     {
         return;
     }
     if (client.InnerChannel != null)
     {
         client.InnerChannel.Close();
         client.InnerChannel.Dispose();
     }
     client.Abort();
 }
コード例 #8
0
        /// <summary>
        /// Gets the latest date.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <returns>DateTime.</returns>
        public DateTime getLatestDate(string sessionId, string tableName)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");

            try
            {
                return(clt.getLatestDate(sessionId, tableName));
            }
            finally
            {
                CloseClient(clt);
            }
        }
コード例 #9
0
        // Expects:  String sessionId, String table, String[] columns, Date startDate, Date endDate 
        // Returns:  Object[][] data 
        // The getData method takes a session Id, table and column names, and a start and end date (the timespan). 
        // It returns a two-dimensional object array with the values; this array can be addressed with data[row][column]. 2
        /// <summary>
        /// Gets the data.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns>ISwenetDataSet.</returns>
        public ISwenetDataSet getData(string sessionId, string tableName, ArrayOfString columns, DateTime startDate, DateTime endDate)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");
            try
            {
                return clt.getData(sessionId, tableName, columns, startDate, endDate);
            }
            finally
            {
                CloseClient(clt);
            }

        }
コード例 #10
0
        /// <summary>
        /// Logins the specified user name.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <param name="passWord">The pass word.</param>
        /// <returns>System.String.</returns>
        public string login(string userName, string passWord)
        {
            var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");
            try
            {
                return clt.login(userName, passWord);
            }
            finally
            {
                CloseClient(clt);
            }

        }
コード例 #11
0
 /// <summary>
 /// Disposes the client.
 /// </summary>
 /// <param name="client">The client.</param>
 private static void DisposeClient(SwenetDataProviderPortTypeClient client)
 {
     if (client == null) return;
     if (client.InnerChannel != null)
     {
         client.InnerChannel.Close();
         client.InnerChannel.Dispose();
     }
     client.Abort();
 }
コード例 #12
0
 /// <summary>
 /// Closes the client.
 /// </summary>
 /// <param name="instance">The instance.</param>
 private void CloseClient(SwenetDataProviderPortTypeClient instance)
 {
     if (instance == null) return;
     DisposeClient(instance);
 }
コード例 #13
0
 /// <summary>
 /// Gets the column types.
 /// </summary>
 /// <param name="sessionId">The session identifier.</param>
 /// <param name="tableName">Name of the table.</param>
 /// <returns>ArrayOfString.</returns>
 public ArrayOfString getColumnTypes(string sessionId, string tableName)
 {
     var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");
     try
     {
         return clt.getColumnTypes(sessionId, tableName);
     }
     finally
     {
         CloseClient(clt);
     }
 }
コード例 #14
0
 /// <summary>
 /// Gets the latest date.
 /// </summary>
 /// <param name="sessionId">The session identifier.</param>
 /// <param name="tableName">Name of the table.</param>
 /// <returns>DateTime.</returns>
 public DateTime getLatestDate(string sessionId, string tableName)
 {
     var clt = new SwenetDataProviderPortTypeClient("ISwenetDataProviderHttpPort");
     try
     {
         return clt.getLatestDate(sessionId, tableName);
     }
     finally
     {
         CloseClient(clt);
     }
 }