using System;
using System.Net;
using System.Collections;
using Core.Mes.IBaseInterface;

namespace Core.Mes.ClientFrameWork
{
	/// <summary>
	/// ClientCommon 的摘要说明。
	/// </summary>
	public class ClientCommon
	{
		static ClientCommon()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public static UserInfo  _UserInfo;
		
		private static RemotingHelp _remotingHelp = new RemotingHelp();
		public static RemotingHelp _RemotingHelp
		{
			get 
			{
				return _remotingHelp;
			}
		}

		/// <summary>
		/// 用户操作记录
		/// </summary>
		/// <param name="OperateType"></param>
		/// <param name="OperateObject"></param>
		/// <param name="Remark"></param>
		public static void RecodeOperateInfo(string OperateType, string OperateObject, string Remark)
		{
			string ipaddress = "";
			
			System.Net.IPAddress[] ips = Dns.GetHostByName( Dns.GetHostName() ).AddressList;
			if ( ips.Length > 0 ) ipaddress = ips[0].ToString();
			string strOut = "";
			ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon","Core.Mes.ServerCommon.UserInfoManager","RecodeOperateInfo",
				new object[]{ClientCommon._UserInfo.LoginID, ClientCommon._UserInfo.UserName, 
								Dns.GetHostName(), ipaddress, OperateType, OperateObject, Remark}, out strOut);
		}
	}
}
