Esempio n. 1
0
        public static Guid ErrorLog(
            string controller,
            string action,
            Exception ex
            )
        {
            string message = ex.Message;

            if (ex.InnerException != null)
            {
                message += "\r\n inner " + ex.InnerException;

                if (ex.InnerException.InnerException != null)
                {
                    message += "\r\n inners inner" + ex.InnerException.InnerException;
                }
            }

            Guid defaultErrorId =
                Logging.ErrorLog(
                    controller,
                    action,
                    message,
                    ex.StackTrace
                    );

            return(defaultErrorId);
        }
Esempio n. 2
0
        public ActionResult AddTest()
        {
            Logging.ActionLog(Request, "~/Views/Templates/DefaultTest/DefaultTest/AddTest ( ASP MVC WCF )");

            string urlReferrer = string.Empty;

            if (Request.UrlReferrer != null)
            {
                urlReferrer = Request.UrlReferrer.AbsoluteUri;
            }

            // save result of call
            try {
                new DefaultTestServiceClient().
                AddTestRun(
                    "NorPort", "MVC", "ASPMenu",
                    urlReferrer,
                    DateTime.UtcNow, DateTime.UtcNow,
                    1,
                    DefaultTestRunResultRef.OK,
                    "new",
                    Logging.UserId(User.Identity, ViewBag)
                    );
            } catch (Exception ex) {
                Logging.ErrorLog("DefaultTestController", "AddTest", ex);
            }

            ViewBag.UrlReferrer = urlReferrer;

            return(View(
                       "~/Views/TemplatesLive/DefaultTest/DefaultTest/AddTest.cshtml"
                       ));
        }