protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin b_Admin = new B_Admin();

            if (string.IsNullOrEmpty(Request.QueryString["QuestionId"]))
            {
                function.WriteErrMsg("不存在");
            }
            int QuestionId = int.Parse(Request.QueryString["QuestionId"]);

            if (!string.IsNullOrEmpty(Request.QueryString["menu"]) && Request.QueryString["menu"] == "filedown")
            {
                string path = Request.QueryString["filepath"];
                SafeSC.DownFile(path);
                //if (path != "")
                //{
                //    string filepath = Server.MapPath(path);
                //    System.IO.FileInfo file = new System.IO.FileInfo(filepath);
                //    if (file.Exists)
                //    {
                //        Response.Clear();
                //        Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name));
                //        Response.AddHeader("Content-Length", file.Length.ToString());
                //        Response.ContentType = "application/octet-stream";
                //        Response.Filter.Close();
                //        Response.WriteFile(file.FullName);
                //        Response.End();
                //    }
                //    else
                //    {
                //        Response.Write("<script>alert('该文件不存在!')</script>");
                //    }
                //}
            }
            if (!IsPostBack)
            {
                MyBind(QuestionId);
                M_IServer iserver = serverBll.SeachById(QuestionId);
                iserver.ReadCount = iserver.ReadCount + 1;
                serverBll.Update(iserver);
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='BiServer.aspx'>有问必答</a></li><li class='active'>问题详情</li>");
        }
Exemple #2
0
        protected void resultsRepeater_w_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Del":
                M_IServer model = Serverbll.SeachById(DataConverter.CLng(e.CommandArgument));
                Serverbll.DeleteById(model.QuestionId);
                MyBind();
                break;

            default:
                break;
            }
        }