コード例 #1
0
        public ActionResult IssueInfo(string comments)
        {
            if (HttpContext.Session == null)
            {
                return(View());
            }

            var eid = (HttpContext.Session != null && HttpContext.Session["ErrorID"] != null)
                ? HttpContext.Session["ErrorID"].ToString()
                : Request.Form["et"];

            //var emgr = new ErrorMgr(HttpContext.GetOwinContext().Get<WutNuContext>("WutNuContext"), HttpContext);

            var emgr = new ErrorMgr(Wutcontext, HttpContext);

            try
            {
                var eo = emgr.ReadError(eid);
                if (eo != null)
                {
                    eo.UserComment = comments;
                    emgr.SaveError(eo);
                }
                else
                {
                    //Writing to node WEL
                    emgr.WriteToAppLog("Unable to save user comments to. Comment: " + comments, System.Diagnostics.EventLogEntryType.Error);
                }
            }
            catch (Exception ex)
            {
                //Writing to node WEL
                emgr.WriteToAppLog("Unable to save user comments. \r\nError: " + ex.Message + ". \r\nComment: " + comments, System.Diagnostics.EventLogEntryType.Error);
            }

            return(View());
        }
コード例 #2
0
        public async Task <ActionResult> IssueInfo(string comments)
        {
            if (HttpContext.Session == null)
            {
                return(View());
            }

            var eid = (HttpContext.Session != null && HttpContext.Session["ErrorID"] != null)
                ? HttpContext.Session["ErrorID"].ToString()
                : Request.Form["et"];

            var emgr = new ErrorMgr(new RequestDTO(HttpContext));

            try
            {
                var eo = await emgr.ReadError(eid, false);

                if (eo != null)
                {
                    eo.UserComment = comments;
                    await emgr.SaveError(eo);
                }
                else
                {
                    //Writing to node WEL
                    emgr.WriteToAppLog("Unable to save user comments to. Comment: " + comments, System.Diagnostics.EventLogEntryType.Error);
                }
            }
            catch (Exception ex)
            {
                //Writing to node WEL
                emgr.WriteToAppLog("Unable to save user comments. \r\nError: " + ex.Message + ". \r\nComment: " + comments, System.Diagnostics.EventLogEntryType.Error);
            }

            return(View());
        }