Exemplo n.º 1
0
        public static void Write(Params param, ChangeStatusResult result, string start, string stop)
        {
            StringBuilder str = new StringBuilder();

            if (param != null)
            {
                str
                .AppendFormat("{0}", param.RequestTransType)
                .AppendLine()
                .AppendFormat("Start Execute on {0}", start)
                .AppendLine()
                .AppendFormat("Finish Execute on {0}", stop)
                .AppendLine()
                .AppendFormat("Parameter(s):");
                for (int i = 0; i < param.Parameter.Count(); i++)
                {
                    str.AppendFormat("  - {0}: {1}", param.Parameter.ElementAt(i).Key, param.Parameter.ElementAt(i).Value);
                }
            }
            str
            .AppendLine()
            .AppendFormat("Output:")
            .AppendLine()
            .AppendFormat("\tUpdate Time:\t{0}", result.UpdateTime)
            .AppendLine()
            .AppendFormat("\tUpdated By:\t{0}", result.UpdatedBy.Name)
            .AppendLine()
            .AppendFormat("\tResult:\t{0}", result.Result)
            .AppendLine()
            .AppendFormat("\tStatus:\t{0}", result.Status)
            .AppendLine()
            .AppendLine()
            .AppendLine("------------------------------------------------------" + "\r\n");
            changestatuslog.Debug(str);
        }
Exemplo n.º 2
0
 public static ChangeStatusResult WriteToLog(Params request)
 {
     ChangeStatusResult result = new ChangeStatusResult();
     request.WSDL = "ESBDBDelimiter";
     ESBData data = EAI.RetrieveESBData(request);
     if (data != null && data.Result.Count != 0)
     {
         result.Status = (string.Compare(data.Result[0]["result"], "1", false, CultureInfo.InvariantCulture) == 0 || string.Compare(data.Result[0]["result"], "success", true, CultureInfo.InvariantCulture) == 0) ? ChangeStatusResultType.Success : ChangeStatusResultType.Failure;
     }
     return result;
 }
Exemplo n.º 3
0
 public static ChangeStatusResult Token(Params request)
 {
     ChangeStatusResult result = new ChangeStatusResult();
     ESBData data = EAI.RetrieveESBData(request);
     if (data != null && data.Result.Count != 0)
     {
         result.Status = data.Result[0]["status"] == "Success" ? ChangeStatusResultType.Success : ChangeStatusResultType.Failure;
         result.UpdateTime = data.Result[0].ContainsKey("updateTime") ? data.Result[0]["updateTime"] : string.Empty;
     }
     return result;
 }
Exemplo n.º 4
0
 public ChangeStatusResult TokenValidate(Params request)
 {
     ChangeStatusResult result = new ChangeStatusResult();
     request.WSDL = "TokenAuthentication";
     ESBData data = EAI.RetrieveESBData(request);
     if (data != null && data.Result.Count != 0)
     {
         result.Status = data.Result[0].ContainsKey("result") ? ChangeStatusResultType.Success : ChangeStatusResultType.Failure;
         result.Result = data.Result[0].ContainsKey("result") ? data.Result[0]["result"] : data.Result[0]["reason"];
     }
     return result;
 }
Exemplo n.º 5
0
        public static ChangeStatusResult CorporateCard(Params request)
        {
            ChangeStatusResult result = new ChangeStatusResult();

            request.WSDL = "CorporateCardBlock";
            ESBData data = EAI.RetrieveESBData(request);

            if (data != null && data.Result.Count != 0)
            {
                result.Status = data.Result[0]["BlockType"] == "B" ? ChangeStatusResultType.Success : ChangeStatusResultType.Failure;
                result.Result = "Card Number : " + data.Result[0]["CardNumber"] + " - Block Type : " + data.Result[0]["BlockType"] + " - Reason Code : " + data.Result[0]["ReasonCode"];
            }
            return(result);
        }
Exemplo n.º 6
0
        public static ChangeStatusResult ReleaseMalwareIB(Params request)
        {
            ChangeStatusResult result = new ChangeStatusResult();

            request.WSDL = "CallStoreProcedure";
            ESBData data = EAI.RetrieveESBData(request);

            if (data != null && data.Result.Count != 0)
            {
                result.Result = data.Result[0]["status"];
                result.Status = data.Result[0]["status"] == "SUCCESS" ? ChangeStatusResultType.Success : ChangeStatusResultType.Failure;
            }
            return(result);
        }
Exemplo n.º 7
0
        public static void Finish(string requesttranstype, ChangeStatusResult result)
        {
            StringBuilder str = new StringBuilder();

            str
            .AppendFormat("Finish Execute:\t{0} on {1}", requesttranstype, DateTime.Now.ToString())
            .AppendLine()
            .AppendFormat("Output(s):")
            .AppendLine()
            .AppendFormat("Update Time:\t{0}", result.UpdateTime)
            .AppendLine()
            .AppendFormat("Updated By:\t{0}", result.UpdatedBy.Name)
            .AppendLine()
            .AppendFormat("Result:\t{0}", result.Result)
            .AppendLine()
            .AppendLine()
            .AppendLine("------------------------------------------------------" + "\r\n");
            changestatuslog.Debug(str);
        }