Ejemplo n.º 1
0
        public int ArticleInfoPost(ArticleInfoEntity ArticleInfo)//发布文章方法
        {
            string sSQLText       = "insert into ArticleInfo values('" + ArticleInfo.sarticleTitle + "','" + ArticleInfo.larticleAutherID + "','" + ArticleInfo.sarticleContent + "','" + ArticleInfo.iarticleReadCount + "','" + ArticleInfo.iarticleLikedCount + "','" + ArticleInfo.iarticleDislikedCount + "')";
            int    iReturnedValue = DAL.DataBaseAccess.ExecuteSql(sSQLText);

            return(iReturnedValue);
        }
Ejemplo n.º 2
0
    private long GetArticleAutherID()
    {
        long ArticleAutherID;
        long lArticleID = long.Parse(Request.QueryString["ArticleID"].ToString());

        ArticleInfoBusiness GetArticleInfoByArticleID = new ArticleInfoBusiness();
        ArticleInfoEntity   ArticleInfo = new ArticleInfoEntity();

        ArticleInfo     = GetArticleInfoByArticleID.GetArticleInfoByID(lArticleID);
        ArticleAutherID = ArticleInfo.larticleAutherID;
        return(ArticleAutherID);
    }
 public ArticleManagementSettingForm()
 {
     InitializeComponent();
     MainForm = (Form)this.Parent;
     pageControl1.MainForm = MainForm;
     pageControl1.PageSize = Convert.ToInt32(AppContext.AppConfig.pagesize);
     cmd = new Xr.Common.Controls.OpaqueCommand(AppContext.Session.waitControl);
     cmd.ShowOpaqueLayer(225, false);
     First();
     ArticleCategoryCollection();
     cmd.HideOpaqueLayer();
     CickInfo    = new ArticleInfoEntity();
     CickInfo.id = "";
 }
Ejemplo n.º 4
0
        public ArticleInfoEntity GetArticleInfoByID(long lArtcleID)//展示全部信息方法
        {
            string            sSQLText    = "select * from ArticleInfo where ArticleID='" + lArtcleID + "'";
            DataTable         dataTable   = DAL.DataBaseAccess.GetDataSet(sSQLText); //得到多值
            ArticleInfoEntity ArticleInfo = new ArticleInfoEntity();                 //

            if (dataTable.Rows.Count > 0)
            {
                ArticleInfo.larticleID            = long.Parse("" + dataTable.Rows[0][0]);
                ArticleInfo.sarticleTitle         = "" + dataTable.Rows[0][1];
                ArticleInfo.larticleAutherID      = long.Parse("" + dataTable.Rows[0][2]);
                ArticleInfo.sarticleContent       = "" + dataTable.Rows[0][3];
                ArticleInfo.iarticleReadCount     = int.Parse("" + dataTable.Rows[0][4]);
                ArticleInfo.iarticleLikedCount    = int.Parse("" + dataTable.Rows[0][5]);
                ArticleInfo.iarticleDislikedCount = int.Parse("" + dataTable.Rows[0][6]);
            }
            return(ArticleInfo);
        }
Ejemplo n.º 5
0
    protected void BTNPostArticle_Click(object sender, EventArgs e)
    {
        ArticleInfoBusiness ArticlePost = new ArticleInfoBusiness();
        ArticleInfoEntity   ArticleInfo = new ArticleInfoEntity();

        ArticleInfo.sarticleTitle         = TBArticleTitle.Text;
        ArticleInfo.larticleAutherID      = 0;
        ArticleInfo.sarticleContent       = TBArticleContent.Text;
        ArticleInfo.iarticleReadCount     = 0;
        ArticleInfo.iarticleLikedCount    = 0;
        ArticleInfo.iarticleDislikedCount = 0;

        int iReturnValue = ArticlePost.ArticleInfoPost(ArticleInfo);

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('文章发布成功!')</script>");
        }
    }
Ejemplo n.º 6
0
    private void ArticleInfoDisplay(long lArticleID)
    {
        //获得文章信息
        ArticleInfoBusiness GetArticleInfoByArticleID = new ArticleInfoBusiness();
        ArticleInfoEntity   ArticleInfo = new ArticleInfoEntity();

        ArticleInfo                    = GetArticleInfoByArticleID.GetArticleInfoByID(lArticleID);
        LBLArticleTitle.Text           = ArticleInfo.sarticleTitle;
        LBLArticleReadCountNumber.Text = ArticleInfo.iarticleReadCount.ToString();
        LBLArticleLikedCount.Text      = ArticleInfo.iarticleLikedCount.ToString();
        LBLArticleDislikedCount.Text   = ArticleInfo.iarticleDislikedCount.ToString();
        LBLArticleContent.Text         = ArticleInfo.sarticleContent;

        //获得作者信息
        CounsellorInfoBusiness GetArticleAutherInfo = new CounsellorInfoBusiness();
        CounsellorInfoEntity   ArticleAutherInfo    = new CounsellorInfoEntity();

        long lAuthorID = ArticleInfo.larticleAutherID;

        if (lAuthorID == 0L)
        {
            BTNArticleDisliked.Visible      = false;
            LBLArticleDisliked.Visible      = false;
            LBLArticleDislikedCount.Visible = false;
            IMGArticleAuthorImage.Visible   = false;
            LBLAuthorName.Text          = "管理员";
            LBAutherInfoDetails.Visible = false;
            LBLAuthorTips.Text          = "此文章由管理员发布";
        }
        else
        {
            ArticleAutherInfo              = GetArticleAutherInfo.GetCounsellorInfoByID(lAuthorID);
            LBLAuthorName.Text             = ArticleAutherInfo.scounsellorName;
            IMGArticleAuthorImage.ImageUrl = ArticleAutherInfo.scounsellorImage;
            LBLAuthorTips.Text             = ArticleAutherInfo.scounsellorSelfIntroduction;
        }
    }
    private void PostArticle()
    {
        long lCounsellorID = long.Parse(Session["UsersID"].ToString());
        ArticleInfoBusiness PostArticle = new ArticleInfoBusiness();
        ArticleInfoEntity   ArticleInfo = new ArticleInfoEntity();

        ArticleInfo.sarticleTitle         = TBArticleTitle.Text;
        ArticleInfo.sarticleContent       = TBArticleContent.Text;
        ArticleInfo.larticleAutherID      = lCounsellorID;
        ArticleInfo.iarticleReadCount     = 0;
        ArticleInfo.iarticleLikedCount    = 0;
        ArticleInfo.iarticleDislikedCount = 0;

        int iResultJudgement = PostArticle.ArticleInfoPost(ArticleInfo);

        if (iResultJudgement > 0)
        {
            Response.Write("<script>alert('成功发布文章!')</script>");
        }
        else
        {
            Response.Write("<script>alert('抱歉,发布失败!')</script>");
        }
    }
 private void gv_Article_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     cmd.ShowOpaqueLayer(225, true);
     CickInfo = gv_Article.GetFocusedRow() as ArticleInfoEntity;
     SelectInfoPage(1, pageControl1.PageSize, CickInfo.id);
 }
        /// <summary>
        /// 文章类别集合
        /// </summary>
        public void ArticleCategoryCollection()
        {
            try
            {
                list = new List <ArticleInfoEntity>();
                String  url  = AppContext.AppConfig.serverUrl + "cms/articleCategory/findAll?hospitalId=" + AppContext.Session.hospitalId;
                String  data = HttpClass.httpPost(url);
                JObject objT = JObject.Parse(data);
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    if (objT["result"].ToString() == "" || objT["result"].ToString() == "{}")
                    {
                        this.gc_Article.DataSource = null;
                        return;
                    }
                    Woqu = objT;
                    list = objT["result"].ToObject <List <ArticleInfoEntity> >();
                    for (int i = 0; i < list.Count; i++)
                    {
                        switch (list[i].isUse)
                        {
                        case "0":
                            list[i].isUse = "启用";
                            break;

                        case "1":
                            list[i].isUse = "禁用";
                            break;
                        }
                    }
                    this.gc_Article.DataSource = list;
                    gc_Article.RefreshDataSource();
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            }
            catch (Exception)
            {
                ArticleInfoEntity two = Newtonsoft.Json.JsonConvert.DeserializeObject <ArticleInfoEntity>(Woqu["result"].ToString());
                list.Add(two);
                for (int i = 0; i < list.Count; i++)
                {
                    switch (list[i].isUse)
                    {
                    case "0":
                        list[i].isUse = "启用";
                        break;

                    case "1":
                        list[i].isUse = "禁用";
                        break;
                    }
                }
                this.gc_Article.DataSource = list;
                gc_Article.RefreshDataSource();
            }
            finally
            {
                //list
                lookUpEdit2.Properties.DataSource    = list;
                lookUpEdit2.Properties.DisplayMember = "name";
                lookUpEdit2.Properties.ValueMember   = "id";
            }
        }
Ejemplo n.º 10
0
 private void gc_Article_Click(object sender, EventArgs e)
 {
     cmd.ShowOpaqueLayer(225, true);
     CickInfo = gv_Article.GetFocusedRow() as ArticleInfoEntity;
     SelectInfoPage(1, pageControl1.PageSize, CickInfo.id);
 }