示例#1
0
        public static results resultsNull()
        {
            results Results = new results();

            Results.Ok = false;
            return(Results);
        }
示例#2
0
        public static results exceptionError(Exception ex)
        {
            results result = new results();

            result.Message = ex.ToString();
            result.Ok      = false;
            using (BusinessBase <LTLogApp> objLTLogApp = new BusinessBase <LTLogApp>())
            {
                LTLogApp newLog = new LTLogApp();

                newLog.Type            = "Log";
                newLog.GUID            = Guid.NewGuid().ToString();
                newLog.AppName         = ex.Source;
                newLog.WebServiceName  = ((System.Reflection.MemberInfo)(((System.Reflection.MemberInfo)(ex.TargetSite)).DeclaringType)).Name;
                newLog.MethodName      = "First";
                newLog.MethodNameUI    = ((System.Reflection.MemberInfo)(ex.TargetSite)).Name;
                newLog.UserName        = null;
                newLog.UserMachineInfo = Utility.GetUserMachineInfo(MachineInfo);
                newLog.ServerIP        = Utility.GetServerIP();
                newLog.Data            = ex.ToString();
                newLog.ErrorMessage    = ex.Message;
                newLog.Source          = ex.Source;
                newLog.Method          = ((System.Reflection.MemberInfo)(ex.TargetSite)).Name;
                newLog.ErrorType       = null;
                newLog.Trace           = null;
                newLog.CreationDate    = DateTime.Now;
                objLTLogApp.Add(newLog);
            }
            return(result);
        }