Exemplo n.º 1
0
 public static void WriteOperationLog(string optID, string result, string msg)
 {
     try
     {
         //Result
         //R0        操作失败
         //R1        操作成功
         //R2        失败(异常)
         //R3        关闭(取消)
         //R4        其他
         List <string> listLogInfos = new List <string>();
         listLogInfos.Add("0");
         listLogInfos.Add("11000");
         listLogInfos.Add(optID);
         listLogInfos.Add(Session.RentInfo.Token);
         listLogInfos.Add(Session.UserID.ToString());
         listLogInfos.Add(Session.RoleID.ToString());
         listLogInfos.Add(Session.LocalMachineInfo.StrHostName);
         listLogInfos.Add("0.0.0.0");
         listLogInfos.Add(DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"));
         listLogInfos.Add(result);
         listLogInfos.Add("3104Log0000");
         listLogInfos.Add(msg);
         listLogInfos.Add(string.Empty);
         Service11901Client client = new Service11901Client(WebHelper.CreateBasicHttpBinding(Session),
                                                            WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service11901"));
         VoiceCyber.UMP.Controls.Wcf11901.OperationDataArgs args = client.OperationMethodA(1, listLogInfos);
         client.Close();
     }
     catch (Exception ex)
     {
         WriteLog("OperationLog", string.Format("Write operation log fail.\t{0}", ex.Message));
     }
 }
Exemplo n.º 2
0
 public static void WriteOperationLog(string optID, string result, string contentID, List <string> listParams)
 {
     try
     {
         //Result
         //R0        操作失败
         //R1        操作成功
         //R2        失败(异常)
         //R3        关闭(取消)
         //R4        其他
         string strParams = string.Empty;
         for (int i = 0; i < listParams.Count; i++)
         {
             strParams += string.Format("{0}{1}{1}{1}", listParams[i], ConstValue.SPLITER_CHAR_2);
         }
         strParams = strParams.Substring(0, strParams.Length - 3);
         List <string> listLogInfos = new List <string>();
         listLogInfos.Add("0");
         listLogInfos.Add("11000");
         listLogInfos.Add(optID);
         listLogInfos.Add(Session.RentInfo.Token);
         listLogInfos.Add(Session.UserID.ToString());
         listLogInfos.Add(Session.RoleID.ToString());
         listLogInfos.Add(Session.LocalMachineInfo.StrHostName);
         listLogInfos.Add("0.0.0.0");
         listLogInfos.Add(DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"));
         listLogInfos.Add(result);
         listLogInfos.Add(contentID);
         listLogInfos.Add(strParams);
         listLogInfos.Add(string.Empty);
         Service11901Client client = new Service11901Client(WebHelper.CreateBasicHttpBinding(Session),
                                                            WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service11901"));
         VoiceCyber.UMP.Controls.Wcf11901.OperationDataArgs args = client.OperationMethodA(1, listLogInfos);
         client.Close();
     }
     catch (Exception ex)
     {
         WriteLog("OperationLog", string.Format("Write operation log fail.\t{0}", ex.Message));
     }
 }