Ejemplo n.º 1
0
        public ActionResult BugDetail(string id)
        {
            string user_id = HttpContext.User.Identity.Name;
            BugManager bugManager = new BugManager(int.Parse(user_id));

            int bug_id = 0;
            int.TryParse(id,out bug_id);
            if (bug_id == 0)
            {
                Redirect("/Home/Error?message=问题编号不能为空");
            }

            BBug bug=bugManager.GetBugInfo(bug_id);
            return View(bug);
        }
Ejemplo n.º 2
0
        public ApiMessage GetBugFullInfo()
        {
            BBug data = new BBug();
            ApiMessage message = new ApiMessage();
            HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];
            HttpRequestBase request = context.Request;
            string user_id = User.Identity.Name;
            BugManager bugManager = new BugManager(int.Parse(user_id));
            try
            {
                int bugId = 0;
                int.TryParse(request["bug_id"], out bugId);
                data = bugManager.GetBugInfo(bugId);
                message.Item = data;
            }
            catch (KMJXCException kex)
            {
                message.Status = "failed";
                message.Message = kex.Message;
            }
            catch (Exception ex)
            {
                message.Status = "failed";
                message.Message = "未知错误";
            }

            return message;
        }