示例#1
0
        //添加留言事件
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //留言标题
            string msgTitle = this.txtTitle.Text;
            //留言内容
            string msgContent = this.txtMsg.Text;

            //留言操作对象
            EyouSoft.BLL.CompanyStructure.CustomerMessageReply bll = new EyouSoft.BLL.CompanyStructure.CustomerMessageReply();
            //声明新的留言model
            EyouSoft.Model.CompanyStructure.CustomerMessageModel model = new EyouSoft.Model.CompanyStructure.CustomerMessageModel();

            #region 属性赋值
            model.CompanyId         = SiteUserInfo.CompanyID;
            model.MessageCompanyId  = SiteUserInfo.TourCompany.TourCompanyId;
            model.MessageContent    = msgContent;
            model.MessageTitle      = msgTitle;
            model.MessageTime       = DateTime.Now;
            model.ReplyState        = EyouSoft.Model.EnumType.CompanyStructure.ReplyState.未回复;
            model.MessagePersonId   = SiteUserInfo.ID;
            model.MessagePersonName = SiteUserInfo.UserName;
            #endregion

            //数据操作
            if (bll.AddMessage(model))
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('留言成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.href='/GroupEnd/Messages/MessageBoard.aspx'");
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('留言失败!');window.location.href='/GroupEnd/Messages/AddMessage.aspx'");
            }
        }
示例#2
0
        /// <summary>
        /// 页面初始化方法
        /// </summary>
        private void DataInit(string msgTitle)
        {
            EyouSoft.BLL.CompanyStructure.CustomerMessageReply bll = new EyouSoft.BLL.CompanyStructure.CustomerMessageReply();

            //查询model
            EyouSoft.Model.CompanyStructure.CustomerMessageModel searchModel = new EyouSoft.Model.CompanyStructure.CustomerMessageModel();
            searchModel.MessageTitle = msgTitle;
            searchModel.CompanyId    = SiteUserInfo.CompanyID;

            //获得分页数据
            IList <EyouSoft.Model.CompanyStructure.CustomerMessageModel> list = bll.GetMessageList(SiteUserInfo.TourCompany.TourCompanyId, pageSize, pageIndex, ref recordCount, true, searchModel);

            //判断list是否有数据
            if (list != null && list.Count > 0)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
                BindPage();
                this.lblMsg.Visible = false;
            }
            else
            {
                this.ExporPageInfoSelect1.Visible = false;
                this.lblMsg.Visible = true;
            }

            list = null;
        }
示例#3
0
 /// <summary>
 /// 页面初始化方法
 /// </summary>
 /// <param name="id">记录ID</param>
 protected void DataInit(int id)
 {
     //声明留言操作对象
     EyouSoft.BLL.CompanyStructure.CustomerMessageReply bll = new EyouSoft.BLL.CompanyStructure.CustomerMessageReply();
     //声明回复信息对象
     EyouSoft.Model.CompanyStructure.CustomerMessageReplyModel model = bll.GetReplyByMessageId(SiteUserInfo.TourCompany.TourCompanyId, id, true);
     if (model != null && model.MessageInfo != null)
     {
         //标题
         this.lblTitle.Text = model.MessageInfo.MessageTitle;
         //留言时间
         this.lblMsgDate.Text = model.MessageInfo.MessageTime == null ? "" : Convert.ToDateTime(model.MessageInfo.MessageTime).ToString("yyyy-MM-dd");
         //留言人名
         this.lblMsgMan.Text = model.MessageInfo.MessagePersonName;
         //留言内容
         this.lblMsg.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.MessageInfo.MessageContent);
         //留言回复状态
         this.lblState.Text = model.MessageInfo.ReplyState.ToString();
         //回复内容
         this.lblReplyMsg.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ReplyContent);
         //回复人名
         this.lblReplyMan.Text = model.ReplyPersonName;
         //回复时间
         this.lblReplyDate.Text = model.ReplyTime == null ? "" : Convert.ToDateTime(model.ReplyTime).ToString("yyyy-MM-dd");
     }
 }