Example #1
0
        /// <summary>
        /// 分页获取嘉宾访谈列表
        /// </summary>
        /// <param name="pageSize">每页显示的条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="KeyWord">需要匹配的关键字</param>
        /// <returns>嘉宾访谈列表集合</returns>
        public virtual IList <EyouSoft.Model.CommunityStructure.HonoredGuest> GetPageList(int pageSize, int pageIndex, ref int recordCount, string KeyWord)
        {
            IList <EyouSoft.Model.CommunityStructure.HonoredGuest> list = new List <EyouSoft.Model.CommunityStructure.HonoredGuest>();
            string tableName     = "tbl_CommunityHonoredGuest";
            string fields        = "ID,Title,Content,IssueTime,Summary";
            string primaryKey    = "ID";
            string orderByString = "IssueTime desc";
            string strWhere      = string.Empty;

            if (!string.IsNullOrEmpty(KeyWord))
            {
                strWhere = string.Format(" Title like'%{0}%' ", KeyWord);
            }
            using (IDataReader dr = DbHelper.ExecuteReader(this._database, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields, strWhere, orderByString))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.CommunityStructure.HonoredGuest model = new EyouSoft.Model.CommunityStructure.HonoredGuest();
                    model.ID        = dr.GetString(0);
                    model.Title     = dr.IsDBNull(1) ? string.Empty : dr.GetString(1);
                    model.Content   = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
                    model.IssueTime = dr.IsDBNull(3) ? DateTime.Now : dr.GetDateTime(3);
                    model.Summary   = dr.IsDBNull(4) ? string.Empty : dr.GetString(4);
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }
Example #2
0
        /// <summary>
        /// 获取嘉宾访谈实体
        /// </summary>
        /// <param name="Id">主键编号</param>
        /// <returns></returns>
        public virtual EyouSoft.Model.CommunityStructure.HonoredGuest GetModel(string Id)
        {
            EyouSoft.Model.CommunityStructure.HonoredGuest model = null;
            DbCommand dc = this._database.GetSqlStringCommand(SQL_CommunityHonoredGuest_GetModel);

            this._database.AddInParameter(dc, "ID", DbType.AnsiStringFixedLength, Id);
            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._database))
            {
                if (dr.Read())
                {
                    model            = new EyouSoft.Model.CommunityStructure.HonoredGuest();
                    model.ID         = dr.GetString(0);
                    model.Title      = dr.IsDBNull(1) ? string.Empty : dr.GetString(1);
                    model.ImgPath    = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
                    model.ImgThumb   = dr.IsDBNull(3) ? string.Empty : dr.GetString(3);
                    model.Content    = dr.IsDBNull(4) ? string.Empty : dr.GetString(4);
                    model.Opinion1   = dr.IsDBNull(5) ? string.Empty : dr.GetString(5);
                    model.Opinion2   = dr.IsDBNull(6) ? string.Empty : dr.GetString(6);
                    model.Opinion3   = dr.IsDBNull(7) ? string.Empty : dr.GetString(7);
                    model.Summary    = dr.IsDBNull(8) ? string.Empty : dr.GetString(8);
                    model.IssueTime  = dr.IsDBNull(9) ? DateTime.Now : dr.GetDateTime(9);
                    model.OperatorId = dr.IsDBNull(10) ? 0 : dr.GetInt32(10);
                }
            }
            return(model);
        }
Example #3
0
        /// <summary>
        /// 初始化页面
        /// </summary>
        private void InitPageData()
        {
            if (string.IsNullOrEmpty(HonoredGuestId))
            {
                return;
            }

            EyouSoft.Model.CommunityStructure.HonoredGuest model = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance().GetModel(HonoredGuestId);
            if (model == null)
            {
                MessageBox.ShowAndRedirect(this, "没有找到要修改的信息!", "/SupplierManage/HonoredGuest.aspx");
                return;
            }

            txtTitle.Value        = model.Title;
            ltrOldBanner.Text     = string.Format("<a href=\"{0}\"target='_blank'  title=\"点击查看\">{1}</a>", Domain.FileSystem + model.ImgPath, model.ImgPath.Substring(model.ImgPath.LastIndexOf('/') + 1));
            ltrOldSmallImg.Text   = string.Format("<a href=\"{0}\"target='_blank'  title=\"点击查看\">{1}</a>", Domain.FileSystem + model.ImgThumb, model.ImgThumb.Substring(model.ImgThumb.LastIndexOf('/') + 1));
            hdfOldOldBanner.Value = model.ImgPath;
            hdfOldSmallImg.Value  = model.ImgThumb;
            txtHonoredGuest.Value = model.Content;
            txtView1.Value        = model.Opinion1;
            txtView2.Value        = model.Opinion2;
            txtView3.Value        = model.Opinion3;
            txtSummary.Value      = model.Summary;
        }
Example #4
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="model">嘉宾访谈实体</param>
 /// <returns>true:成功 false:失败</returns>
 public bool Update(EyouSoft.Model.CommunityStructure.HonoredGuest model)
 {
     if (model == null)
     {
         return(false);
     }
     return(dal.Update(model));
 }
Example #5
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="model">嘉宾访谈实体</param>
 /// <returns>true:成功 false:失败</returns>
 public bool Add(EyouSoft.Model.CommunityStructure.HonoredGuest model)
 {
     if (model == null)
     {
         return(false);
     }
     model.ID = Guid.NewGuid().ToString();
     return(dal.Add(model));
 }
Example #6
0
        protected int pic_height            = 170; //图片高度
        protected void Page_Load(object sender, EventArgs e)
        {
            strJavaScript.Append("<script type=\"text/javascript\">");
            strJavaScript.AppendFormat("var show_text={0};", IsShowTitle ? 1 : 0);
            strJavaScript.Append("var imag = new Array();");
            strJavaScript.Append("var link = new Array();");
            strJavaScript.Append("var text = new Array();");
            switch (SwfType)
            {
            case 1:     //行业资讯
            case 3:     //同业学堂
                IList <EyouSoft.Model.CommunityStructure.InfoArticle> list = EyouSoft.BLL.CommunityStructure.InfoArticle.CreateInstance().GetTopNumPicList(TopNumber,
                                                                                                                                                           EyouSoft.Model.CommunityStructure.TopicClass.行业资讯, null, null, true);
                if (list != null && list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        EyouSoft.Model.CommunityStructure.InfoArticle model = new EyouSoft.Model.CommunityStructure.InfoArticle();
                        model = list[i];
                        strJavaScript.AppendFormat("imag[{0}]=\"{1}{2}\";", i + 1, ImageServerPath, model.ImgPath);
                        strJavaScript.AppendFormat("link[{0}]=\"/SupplierInfo/{1}?Id={2}\";", i + 1, model.TopicClassId == EyouSoft.Model.CommunityStructure.TopicClass.行业资讯?
                                                   "ArticleInfo.aspx" : "SchoolIntroductionInfo.aspx", model.ID);
                        strJavaScript.AppendFormat("text[{0}]=\"{1}\";", i + 1, model.ArticleTitle);
                        model = null;
                    }
                }
                list = null;
                break;

            case 2:     // 嘉宾访谈
                IList <EyouSoft.Model.CommunityStructure.HonoredGuest> GuestList = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance().GetTopNumList(TopNumber);
                if (GuestList != null && GuestList.Count > 0)
                {
                    for (int i = 0; i < GuestList.Count; i++)
                    {
                        EyouSoft.Model.CommunityStructure.HonoredGuest guestmodel = new EyouSoft.Model.CommunityStructure.HonoredGuest();
                        guestmodel = GuestList[i];
                        strJavaScript.AppendFormat("imag[{0}]=\"{1}{2}\";", i + 1, ImageServerPath, guestmodel.ImgPath);
                        strJavaScript.AppendFormat("link[{0}]=\"/SupplierInfo/HonoredGuestInfo.aspx?Id={1}\";", i + 1, guestmodel.ID);
                        strJavaScript.AppendFormat("text[{0}]=\"{1}\";", i + 1, guestmodel.Title);
                        guestmodel = null;
                    }
                }
                break;
            }
            strJavaScript.Append("</script>");
            Page.Header.Controls.Add(new LiteralControl(strJavaScript.ToString()));
        }
Example #7
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model">嘉宾访谈实体</param>
        /// <returns>true:成功 false:失败</returns>
        public virtual bool Update(EyouSoft.Model.CommunityStructure.HonoredGuest model)
        {
            DbCommand dc = this._database.GetSqlStringCommand(SQL_DELETEDFILE_UPDATEMOVE + SQL_CommunityHonoredGuest_UPDATE);

            this._database.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._database.AddInParameter(dc, "ImgPath", DbType.String, model.ImgPath);
            this._database.AddInParameter(dc, "ImgThumb", DbType.String, model.ImgThumb);
            this._database.AddInParameter(dc, "Content", DbType.String, model.Content);
            this._database.AddInParameter(dc, "Opinion1", DbType.String, model.Opinion1);
            this._database.AddInParameter(dc, "Opinion2", DbType.String, model.Opinion2);
            this._database.AddInParameter(dc, "Opinion3", DbType.String, model.Opinion3);
            this._database.AddInParameter(dc, "Summary", DbType.String, model.Summary);
            this._database.AddInParameter(dc, "ID", DbType.AnsiStringFixedLength, model.ID);
            this._database.AddInParameter(dc, "OperatorId", DbType.Int32, model.OperatorId);
            return(DbHelper.ExecuteSql(dc, this._database) > 0 ? true : false);
        }
Example #8
0
        /// <summary>
        /// 初始化页面
        /// </summary>
        private void InitPageData()
        {
            EyouSoft.Model.CommunityStructure.HonoredGuest model = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance().GetModel(HonoredGuestId);
            if (model == null)
            {
                MessageBox.ShowAndRedirect(this, "未找到您要查看的信息!", HonoredGuestUrl);
                return;
            }

            ltrImg.Text     = string.Format("<img src=\"{0}{1}\" width=\"455\" height=\"181\" />", Domain.FileSystem, model.ImgPath);
            ltrTitle.Text   = model.Title;
            ltrInfo.Text    = model.Content;
            ltrView1.Text   = model.Opinion1;
            ltrView2.Text   = model.Opinion2;
            ltrView3.Text   = model.Opinion3;
            ltrSummary.Text = model.Summary;
        }
Example #9
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model">嘉宾访谈实体</param>
        /// <returns>true:成功 false:失败</returns>
        public virtual bool Add(EyouSoft.Model.CommunityStructure.HonoredGuest model)
        {
            model.ID = Guid.NewGuid().ToString();
            DbCommand dc = this._database.GetSqlStringCommand(SQL_CommunityHonoredGuest_ADD);

            this._database.AddInParameter(dc, "ID", DbType.AnsiStringFixedLength, model.ID);
            this._database.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._database.AddInParameter(dc, "ImgPath", DbType.String, model.ImgPath);
            this._database.AddInParameter(dc, "ImgThumb", DbType.String, model.ImgThumb);
            this._database.AddInParameter(dc, "Content", DbType.String, model.Content);
            this._database.AddInParameter(dc, "Opinion1", DbType.String, model.Opinion1);
            this._database.AddInParameter(dc, "Opinion2", DbType.String, model.Opinion2);
            this._database.AddInParameter(dc, "Opinion3", DbType.String, model.Opinion3);
            this._database.AddInParameter(dc, "Summary", DbType.String, model.Summary);
            this._database.AddInParameter(dc, "IssueTime", DbType.String, DateTime.Now);
            this._database.AddInParameter(dc, "OperatorId", DbType.Int32, model.OperatorId);
            return(DbHelper.ExecuteSql(dc, this._database) > 0 ? true : false);
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Supplier site = (Supplier)this.Master;

            if (site != null)
            {
                site.MenuIndex = 3;
            }

            #region  业交流专区
            CommonTopic5.PartType  = UserPublicCenter.SupplierInfo.UserControl.CommonTopicControl.PartTypes.业交流专区;
            CommonTopic5.TopicType = UserPublicCenter.SupplierInfo.UserControl.CommonTopicControl.TopicTypes.文字描述;
            #endregion

            #region 绑定最新一期的嘉宾访谈及回复
            EyouSoft.IBLL.CommunityStructure.IHonoredGuest GuestBll   = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance();
            EyouSoft.Model.CommunityStructure.HonoredGuest GuestModel = GuestBll.GetNewInfo();
            if (GuestModel != null)
            {
                ltrMoreComment.Text  = string.Format("<a href=\"/SupplierInfo/HonoredGuestComment.aspx?Id={0}\" target=\"_blank\" class=\"heise12\">更多&gt;&gt;</a>", GuestModel.ID);
                HonoredGuestInfoUrl  = "/SupplierInfo/HonoredGuestInfo.aspx?Id=" + GuestModel.ID;
                lbTitle.Text         = string.Format("<a href=\"/SupplierInfo/HonoredGuestInfo.aspx?Id={0}\">{1}</a>", GuestModel.ID, GuestModel.Title); //Utils.GetText(GuestModel.Title, 10));
                lbContent.Text       = GuestModel.Content;                                                                                               //Utils.GetText(GuestModel.Content, 50, true);
                OpinionContent1.Text = GuestModel.Opinion1;                                                                                              //Utils.GetText(GuestModel.Opinion1, 50, true);
                OpinionContent2.Text = GuestModel.Opinion2;                                                                                              //Utils.GetText(GuestModel.Opinion2, 50, true);
                OpinionContent3.Text = GuestModel.Opinion3;                                                                                              //Utils.GetText(GuestModel.Opinion3, 50, true);
                Summary.Text         = GuestModel.Summary;                                                                                               //Utils.GetText(GuestModel.Summary, 50, true);
                hGuestId.Value       = GuestModel.ID;
                #region 绑定访谈回复
                IList <EyouSoft.Model.CommunityStructure.ExchangeComment> CommentList = Ibll.GetGuestInterview(6, hGuestId.Value);
                if (CommentList != null && CommentList.Count > 0)
                {
                    RpComment.DataSource = CommentList;
                    RpComment.DataBind();
                }
                CommentList = null;
                #endregion
            }
            GuestModel = null;
            GuestBll   = null;
            #endregion
        }
Example #11
0
        /// <summary>
        /// 获取指定条数的嘉宾访谈列表集合
        /// </summary>
        /// <param name="topNumber">需要返回的记录数 =0返回全部</param>
        /// <returns>嘉宾访谈列表集合</returns>
        public virtual IList <EyouSoft.Model.CommunityStructure.HonoredGuest> GetTopNumList(int topNumber)
        {
            string strSql = string.Format(SQL_CommunityHonoredGuest_GetTopNumList, topNumber > 0 ? string.Format(" top {0} ", topNumber) : string.Empty);
            IList <EyouSoft.Model.CommunityStructure.HonoredGuest> list = new List <EyouSoft.Model.CommunityStructure.HonoredGuest>();
            DbCommand dc = this._database.GetSqlStringCommand(strSql);

            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._database))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.CommunityStructure.HonoredGuest model = new EyouSoft.Model.CommunityStructure.HonoredGuest();
                    model.ID       = dr.GetString(0);
                    model.Title    = dr.IsDBNull(1) ? string.Empty : dr.GetString(1);
                    model.ImgThumb = dr.IsDBNull(2) ? string.Empty : dr.GetString(2);
                    model.ImgPath  = dr.IsDBNull(3) ? string.Empty : dr.GetString(3);
                    model.Content  = dr.IsDBNull(4) ? string.Empty : dr.GetString(4);
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }
Example #12
0
        /// <summary>
        /// 保存嘉宾访谈
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result      = false;
            string NewImgPath  = Utils.GetFormValue("txtBanner$hidFileName");
            string NewImgThumb = Utils.GetFormValue("txtSmallImg$hidFileName");
            string OldImgPath  = Utils.InputText(hdfOldOldBanner.Value);
            string OldThumb    = Utils.InputText(hdfOldSmallImg.Value);
            string strTitle    = txtTitle.Value;
            string strContent  = txtHonoredGuest.Value;

            System.Text.StringBuilder strErr = new System.Text.StringBuilder();
            if (string.IsNullOrEmpty(strTitle))
            {
                strErr.Append("请填写标题!\\n");
            }
            if (string.IsNullOrEmpty(strContent))
            {
                strErr.Append("请填写嘉宾介绍!\\n");
            }
            if (!string.IsNullOrEmpty(strErr.ToString()))
            {
                MessageBox.ShowAndReturnBack(this, strErr.ToString(), 1);
                return;
            }
            EyouSoft.Model.CommunityStructure.HonoredGuest model = new EyouSoft.Model.CommunityStructure.HonoredGuest();
            model.Title      = txtTitle.Value;
            model.Content    = txtHonoredGuest.Value;
            model.Opinion1   = txtView1.Value;
            model.Opinion2   = txtView2.Value;
            model.Opinion3   = txtView3.Value;
            model.Summary    = txtSummary.Value;
            model.OperatorId = MasterUserInfo.ID;
            if (string.IsNullOrEmpty(HonoredGuestId))
            {
                model.ImgPath  = NewImgPath;
                model.ImgThumb = NewImgThumb;

                Result = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance().Add(model);
            }
            else
            {
                model.ID = HonoredGuestId;
                if (string.IsNullOrEmpty(NewImgPath))
                {
                    model.ImgPath = OldImgPath;
                }
                else
                {
                    model.ImgPath = NewImgPath;
                }
                if (string.IsNullOrEmpty(NewImgThumb))
                {
                    model.ImgThumb = OldThumb;
                }
                else
                {
                    model.ImgThumb = NewImgThumb;
                }

                Result = EyouSoft.BLL.CommunityStructure.HonoredGuest.CreateInstance().Update(model);
            }

            if (Result)
            {
                MessageBox.ShowAndRedirect(this, "保存成功!", "/SupplierManage/HonoredGuest.aspx");
            }
            else
            {
                MessageBox.ShowAndRedirect(this, "保存失败!", "/SupplierManage/HonoredGuest.aspx");
            }
        }