using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Core.Mes.ClientFrameWork;
using System.Configuration;

namespace ConnectionServer
{
    public partial class FrmConnection : Form
    {
        public FrmConnection()
        {
            InitializeComponent();

            string url = ConfigurationManager.AppSettings["RemoteServerUrl"];
            ClientCommon._RemotingHelp.InitServerUrlList("ServerCommon", url);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.listBox1.Items.Clear();
            for (int i = 0; i < 10; i++)
            {
                string strOut = "";
                object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon", "Core.Mes.ServerCommon.UserInfoManager", "GetTestData",
                          null, out strOut);
                if (strOut != "")
                {
                    ShowLog("失败:" + strOut);
                }

                if (obj != null)
                {
                    ShowLog("成功:" + strOut);
                    //DateTime dtime = Convert.ToDateTime(obj);
                    //ShowLog("成功:" + dtime.ToString("yyyy-MM-dd"));
                }

            }

        }
        private void ShowLog(string log)
        {
            this.listBox1.Items.Add(log);
            this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            

            
                string strOut = "";
                object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon", "Core.Mes.ServerCommon.UserInfoManager", "GetTestData",
                          null, out strOut);
                if (strOut != "")
                {
                    ShowLog("失败:" + strOut);
                }

                
        }
    }
}