Beispiel #1
0
    public void BindData()
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);

        UploadFile1.BindGrid();

        lt_article_comment.Text = bll.Model.Content.Replace("\r", "<br/>");


        lb_Title.Text      = bll.Model.Title;
        lb_Author.Text     = bll.Model.Author;
        lb_Keyword.Text    = bll.Model.KeyWord;
        lb_ReadCounts.Text = bll.Model.ReadCount.ToString();

        panel1.BindData(bll.Model);

        bt_Edit.Visible = (bll.Model.UploadStaff == (int)Session["UserID"]);

        if (new KB_CatalogBLL(bll.Model.Catalog).Model.CommentFlag == "N")
        {
            tb_Comment.Visible = false;
        }
        else
        {
            ud_grid_comment.ConditionString = " KB_Comment.IsDelete = 'N' and KB_Comment.Article=" + ViewState["ID"].ToString();
            ud_grid_comment.BindGrid();
        }
    }
    public void BindData()
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);

        UploadFile1.BindGrid();

        lt_article_comment.Text = bll.Model.Content.Replace("\r", "<br/>");

        lb_Title.Text = bll.Model.Title;
        lb_Author.Text = bll.Model.Author;
        lb_Keyword.Text = bll.Model.KeyWord;
        lb_ReadCounts.Text = bll.Model.ReadCount.ToString();

        panel1.BindData(bll.Model);

        bt_Edit.Visible = (bll.Model.UploadStaff == (int)Session["UserID"]);

        if (new KB_CatalogBLL(bll.Model.Catalog).Model.CommentFlag == "N")
        {
            tb_Comment.Visible = false;
        }
        else
        {
            ud_grid_comment.ConditionString = " KB_Comment.IsDelete = 'N' and KB_Comment.Article=" + ViewState["ID"].ToString();
            ud_grid_comment.BindGrid();
        }
    }
    protected void bt_Delete_Click(object sender, EventArgs e)
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);

        bll.DeleteByID((int)ViewState["ID"]);

        Response.Redirect("index.aspx");
    }
 protected void btn_OK_Click(object sender, EventArgs e)
 {
     KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);
     if (this.rbl_VisitFlag.Text == "Y")
     {
         bll.Model.UsefullCount += 1;
         bll.Update();
     }
     BindData();
 }
 protected void btn_check_Click(object sender, EventArgs e)
 {
     int id = (int)ViewState["ID"];
     int userid = (int)Session["UserID"];
     string ideas = this.txt_approve_idea.Text;
     KB_ArticleBLL bll = new KB_ArticleBLL();
     bll.UpdateApprov(id, userid, ideas);
     BindData();
     Response.Redirect("ArticleManager.aspx");
 }
    protected void btn_check_Click(object sender, EventArgs e)
    {
        int           id     = (int)ViewState["ID"];
        int           userid = (int)Session["UserID"];
        string        ideas  = this.txt_approve_idea.Text;
        KB_ArticleBLL bll    = new KB_ArticleBLL();

        bll.UpdateApprov(id, userid, ideas);
        BindData();
        Response.Redirect("ArticleManager.aspx");
    }
Beispiel #7
0
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);

        if (this.rbl_VisitFlag.Text == "Y")
        {
            bll.Model.UsefullCount += 1;
            bll.Update();
        }
        BindData();
    }
Beispiel #8
0
    private void BindKBGridView(UC_GridView gv_KB, int Catalog)
    {
        DataTable dt       = TreeTableBLL.GetAllChildByNodes("MCS_OA.dbo.KB_Catalog", "ID", "SuperID", Catalog.ToString());
        string    catalogs = Catalog.ToString();

        foreach (DataRow dr in dt.Rows)
        {
            catalogs += "," + dr["ID"].ToString();
        }
        string condition = "ID IN(Select TOP 3 ID FROM MCS_OA.dbo.KB_Article WHERE Catalog IN (" + catalogs + ") AND IsDelete = 'N' AND HasApproved = 'Y' ORDER BY ApproveTime DESC)";

        gv_KB.BindGrid(KB_ArticleBLL.GetModelList(condition));
        gv_KB.Attributes["CatalogID"] = Catalog.ToString();
    }
    public void BindData()
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);
        panel1.BindData(bll.Model);
        this.txt_approve_idea.Text = bll.Model.ApproveStaffIdeas;
        btn_ok.Text = "修改";
        ckedit_content.Text = bll.Model.Content.Replace("\r", "<br/>");

        if (bll.Model.HasApproved == "Y")
        {
            //btn_ok.Visible = false;
            tr_Approve.Visible = false;
        }

        UploadFile1.BindGrid();
    }
    public void BindData()
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);

        panel1.BindData(bll.Model);
        this.txt_approve_idea.Text = bll.Model.ApproveStaffIdeas;
        btn_ok.Text         = "修改";
        ckedit_content.Text = bll.Model.Content.Replace("\r", "<br/>");

        if (bll.Model.HasApproved == "Y")
        {
            //btn_ok.Visible = false;
            tr_Approve.Visible = false;
        }

        UploadFile1.BindGrid();
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            if ((int)ViewState["ID"] > 0)
            {
                KB_ArticleBLL _bll = new KB_ArticleBLL();
                _bll.UpdateReadCount((int)ViewState["ID"]);
                UploadFile1.RelateID = (int)ViewState["ID"];

                BindData();
            }

            ViewState["Catalog"] = 0;
        }
    }
    protected void btn_ok_Click(object sender, EventArgs e)
    {
        KB_ArticleBLL bll = null;

        if ((int)ViewState["ID"] == 0)
        {
            bll = new KB_ArticleBLL();
            bll.Model.UploadStaff  = (int)Session["UserID"];
            bll.Model.HasApproved  = "N";
            bll.Model.IsDelete     = "N";
            bll.Model.ReadCount    = 1;
            bll.Model.UsefullCount = 0;
        }
        else
        {
            bll = new KB_ArticleBLL((int)ViewState["ID"]);
            bll.Model.IsDelete = "N";
        }

        panel1.GetData(bll.Model);
        bll.Model.Content = ckedit_content.Text.ToString();

        if ((int)ViewState["ID"] == 0)
        {
            ViewState["ID"] = bll.Add();
        }
        else
        {
            if (bll.Model.HasApproved == "Y")
            {
                bll.Model.HasApproved  = "N";       //文章经过修改后,再次回来未审核状态
                bll.Model.ApproveStaff = 0;
                bll.Model.ApproveTime  = new DateTime(1900, 1, 1);
            }
            bll.Update();
        }
        BindData();
        MessageBox.ShowAndRedirect(this, "该文章当前为未审核状态,请尽快审核发布!", "NewArticle.aspx?KB_Article_ID=" + ViewState["ID"].ToString());
    }
    protected void btn_ok_Click(object sender, EventArgs e)
    {
        KB_ArticleBLL bll = null;
        if ((int)ViewState["ID"] == 0)
        {
            bll = new KB_ArticleBLL();
            bll.Model.UploadStaff = (int)Session["UserID"];
            bll.Model.HasApproved = "N";
            bll.Model.IsDelete = "N";
            bll.Model.ReadCount = 1;
            bll.Model.UsefullCount = 0;
        }
        else
        {
            bll = new KB_ArticleBLL((int)ViewState["ID"]);
            bll.Model.IsDelete = "N";
        }

        panel1.GetData(bll.Model);
        bll.Model.Content = ckedit_content.Text.ToString();

        if ((int)ViewState["ID"] == 0)
        {
            ViewState["ID"] = bll.Add();
        }
        else
        {
            if (bll.Model.HasApproved == "Y")
            {
                bll.Model.HasApproved = "N";        //文章经过修改后,再次回来未审核状态
                bll.Model.ApproveStaff = 0;
                bll.Model.ApproveTime = new DateTime(1900, 1, 1);
            }
            bll.Update();
        }
        BindData();
        MessageBox.ShowAndRedirect(this, "该文章当前为未审核状态,请尽快审核发布!", "NewArticle.aspx?KB_Article_ID=" + ViewState["ID"].ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            if ((int)ViewState["ID"] > 0)
            {
                KB_ArticleBLL _bll = new KB_ArticleBLL();
                _bll.UpdateReadCount((int)ViewState["ID"]);
                UploadFile1.RelateID = (int)ViewState["ID"];

                BindData();
            }

            ViewState["Catalog"] = 0;
        }
    }
    protected void bt_Delete_Click(object sender, EventArgs e)
    {
        KB_ArticleBLL bll = new KB_ArticleBLL((int)ViewState["ID"]);
        bll.DeleteByID((int)ViewState["ID"]);

        Response.Redirect("index.aspx");
    }