Exemple #1
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;
        }
Exemple #2
0
 /// <summary>
 /// 添加一条留言
 /// </summary>
 /// <returns></returns>
 public bool AddMessage(EyouSoft.Model.CompanyStructure.CustomerMessageModel CustomerMessageModel)
 {
     if (CustomerMessageModel == null)
     {
         return(false);
     }
     if (dal.AddMessage(CustomerMessageModel))
     {
         #region LGWR
         //EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs();
         //logInfo.CompanyId = 0;
         //logInfo.DepatId = 0;
         //logInfo.EventCode = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode;
         //logInfo.EventIp = string.Empty;
         //logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"{0}在"+EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_留言板.ToString()+"新增了一条留言,留言标题:" + CustomerMessageModel.MessageTitle;
         //logInfo.EventTime = DateTime.Now;
         //logInfo.EventTitle = "添加留言";
         //logInfo.ModuleId = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_留言板;
         //logInfo.OperatorId = 0;
         //this.Logwr(logInfo);
         #endregion
         return(true);
     }
     return(false);
 }
Exemple #3
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'");
            }
        }
Exemple #4
0
        /// <summary>
        /// 根据留言编号获得留言
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public EyouSoft.Model.CompanyStructure.CustomerMessageModel GetMessageById(int Id)
        {
            StringBuilder SQL = new StringBuilder();

            EyouSoft.Model.CompanyStructure.CustomerMessageModel item = null;
            SQL.AppendFormat("select *,(select contactname from dbo.tbl_CompanyUser where id =(select MessagePersonId from dbo.tbl_Message where MessageId={0})) as MessagePersonName from dbo.tbl_Message where MessageId={0}", Id);
            DbCommand dc = this.SystemStore.GetSqlStringCommand(SQL.ToString());

            using (IDataReader rdr = DbHelper.ExecuteReader(dc, this.DB))
            {
                while (rdr.Read())
                {
                    item = new EyouSoft.Model.CompanyStructure.CustomerMessageModel()
                    {
                        MessageId         = rdr.IsDBNull(rdr.GetOrdinal("MessageId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("MessageId")),
                        CompanyId         = rdr.IsDBNull(rdr.GetOrdinal("CompanyId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("CompanyId")),
                        MessageCompanyId  = rdr.IsDBNull(rdr.GetOrdinal("MessageCompanyId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("MessageCompanyId")),
                        MessageContent    = rdr["MessageContent"].ToString(),
                        MessagePersonName = rdr["MessagePersonName"].ToString(),
                        MessagePersonId   = rdr.IsDBNull(rdr.GetOrdinal("MessageId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("MessageId")),
                        MessageTitle      = rdr["MessageTitle"].ToString(),

                        MessageTime = rdr.IsDBNull(rdr.GetOrdinal("MessageTime")) ? System.DateTime.Now : rdr.GetDateTime(rdr.GetOrdinal("MessageTime")),
                        ReplyState  = (EyouSoft.Model.EnumType.CompanyStructure.ReplyState)(int) rdr.GetByte(rdr.GetOrdinal("ReplyState"))
                    };
                }
                return(item);
            }
        }
Exemple #5
0
        /// 获取留言列表
        /// </summary>
        /// <param name="companyId">组团登录为组团公司编号,专线登录为专线公司编号</param>
        /// <param name="pageSize">每页显示的记录数</param>
        /// <param name="pageIndex">返回第几页</param>
        /// <param name="recordCount">返回的记录数</param>
        /// <param name="isZhuTuan">True:组团端,False:专线端</param>
        /// <param name="customerMessageModel">留言实体</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.CompanyStructure.CustomerMessageModel> GetMessageList(int companyId, int pageSize, int pageIndex, ref int recordCount, bool isZhuTuan, EyouSoft.Model.CompanyStructure.CustomerMessageModel customerMessageModel)
        {
            IList <EyouSoft.Model.CompanyStructure.CustomerMessageModel> items = new List <EyouSoft.Model.CompanyStructure.CustomerMessageModel>();

            EyouSoft.Model.CompanyStructure.CustomerMessageModel item = null;
            StringBuilder cmdQuery      = new StringBuilder();
            string        tableName     = "tbl_Message";
            string        primaryKey    = "MessageId";
            string        orderByString = "MessageTime DESC";
            StringBuilder fields        = new StringBuilder();

            #region 要查询的字段
            //fields.Append("tbl_Message.*,(select contactname from dbo.tbl_CompanyUser where id in(select ReplyPersonId from dbo.tbl_MessageReply where MessageId=tbl_Message.MessageId)) as MessageReplyPersonName,(select contactname from dbo.tbl_CompanyUser where id =tbl_Message.MessagePersonId) as MessagePersonName");
            fields.Append("tbl_Message.*,(select ReplyPersonName from dbo.tbl_MessageReply where MessageId =tbl_Message.MessageId) as ReplyPersonName,(select contactname from dbo.tbl_CompanyUser where id =tbl_Message.MessagePersonId) as MessagePersonName");
            #endregion
            #region 拼接查询条件
            if (isZhuTuan)
            {
                cmdQuery.AppendFormat(" MessageCompanyId={0} ", companyId);
            }
            else
            {
                cmdQuery.AppendFormat(" CompanyId={0} ", companyId);
            }
            if (customerMessageModel != null)
            {
                if (!String.IsNullOrEmpty(customerMessageModel.MessageTitle))
                {
                    cmdQuery.AppendFormat(" and MessageTitle like '%{0}%'", customerMessageModel.MessageTitle);
                }
            }
            #endregion
            using (IDataReader rdr = DbHelper.ExecuteReader(this.DB, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields.ToString(), cmdQuery.ToString(), orderByString))
            {
                while (rdr.Read())
                {
                    item = new EyouSoft.Model.CompanyStructure.CustomerMessageModel()
                    {
                        MessageId              = rdr.GetInt32(rdr.GetOrdinal("MessageId")),
                        CompanyId              = rdr.IsDBNull(rdr.GetOrdinal("CompanyId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("CompanyId")),
                        MessageCompanyId       = rdr.IsDBNull(rdr.GetOrdinal("MessageCompanyId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("MessageCompanyId")),
                        MessageTitle           = rdr["MessageTitle"].ToString(),
                        MessageContent         = rdr["MessageContent"].ToString(),
                        MessagePersonId        = rdr.IsDBNull(rdr.GetOrdinal("MessagePersonId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("MessagePersonId")),
                        MessageTime            = rdr.IsDBNull(rdr.GetOrdinal("MessageTime")) ? System.DateTime.Now : rdr.GetDateTime(rdr.GetOrdinal("MessageTime")),
                        MessagePersonName      = rdr["MessagePersonName"].ToString(),
                        MessageReplyPersonName = rdr["ReplyPersonName"].ToString(),
                        ReplyState             = (EyouSoft.Model.EnumType.CompanyStructure.ReplyState)rdr.GetByte(rdr.GetOrdinal("ReplyState"))
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Exemple #6
0
        /// <summary>
        /// 添加一条留言
        /// </summary>
        /// <returns></returns>
        public bool AddMessage(EyouSoft.Model.CompanyStructure.CustomerMessageModel CustomerMessageModel)
        {
            string    SQL = "INSERT INTO tbl_Message(CompanyId,MessageCompanyId,MessageTitle,MessageContent,MessagePersonId,MessageTime,ReplyState) VALUES(@CompanyId,@MessageCompanyId,@MessageTitle,@MessageContent,@MessagePersonId,@MessageTime,0)";
            DbCommand dc  = this.DB.GetSqlStringCommand(SQL);

            this.DB.AddInParameter(dc, "CompanyId", DbType.Int32, CustomerMessageModel.CompanyId);
            this.DB.AddInParameter(dc, "MessageCompanyId", DbType.Int32, CustomerMessageModel.MessageCompanyId);
            this.DB.AddInParameter(dc, "MessageTitle", DbType.String, CustomerMessageModel.MessageTitle);
            this.DB.AddInParameter(dc, "MessageContent", DbType.String, CustomerMessageModel.MessageContent);
            this.DB.AddInParameter(dc, "MessagePersonId", DbType.Int32, CustomerMessageModel.MessagePersonId);
            this.DB.AddInParameter(dc, "MessageTime", DbType.DateTime, CustomerMessageModel.MessageTime);
            return(DbHelper.ExecuteSql(dc, this.DB) > 0 ? true : false);
        }
Exemple #7
0
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            EyouSoft.Model.CompanyStructure.CustomerMessageModel cmm = e.Item.DataItem as EyouSoft.Model.CompanyStructure.CustomerMessageModel;
            EyouSoft.Model.CompanyStructure.CustomerInfo         cci = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomerModel(cmm.MessageCompanyId);
            Literal lt_groupName = e.Item.FindControl("lt_groupName") as Literal;
            Literal lt_Contract  = e.Item.FindControl("lt_Contract") as
                                   Literal;

            if (cci != null)
            {
                lt_groupName.Text = cci.Name;
                lt_Contract.Text  = cci.Phone;
            }
        }
Exemple #8
0
        /// <summary>
        /// 更新一条留言
        /// </summary>
        /// <returns></returns>
        public bool UpdateMessage(EyouSoft.Model.CompanyStructure.CustomerMessageModel CustomerMessageModel)
        {
            string    SQL = "UPDATE tbl_Message SET CompanyId=@CompanyId,MessageCompanyId=@MessageCompanyId,MessageTitle=@MessageTitle,MessageContent=@MessageContent,MessagePersonId=@MessagePersonId,MessageTime=@MessageTime,ReplyState=0 WHERE MessageId=@MessageId";
            DbCommand dc  = this.DB.GetSqlStringCommand(SQL);

            this.DB.AddInParameter(dc, "MessageId", DbType.Int32, CustomerMessageModel.MessageId);
            this.DB.AddInParameter(dc, "CompanyId", DbType.Int32, CustomerMessageModel.CompanyId);
            this.DB.AddInParameter(dc, "MessageCompanyId", DbType.Int32, CustomerMessageModel.MessageCompanyId);
            this.DB.AddInParameter(dc, "MessageTitle", DbType.String, CustomerMessageModel.MessageTitle);
            this.DB.AddInParameter(dc, "MessageContent", DbType.String, CustomerMessageModel.MessageContent);
            this.DB.AddInParameter(dc, "MessagePersonId", DbType.Int32, CustomerMessageModel.MessagePersonId);
            this.DB.AddInParameter(dc, "MessageTime", DbType.DateTime, CustomerMessageModel.MessageTime);
            return(DbHelper.ExecuteSql(dc, this.DB) > 0 ? true : false);
        }
Exemple #9
0
        /// <summary>
        /// XML转换成留言实体
        /// </summary>
        /// <param name="model"></param>
        private void XMLConvert(EyouSoft.Model.CompanyStructure.CustomerMessageReplyModel model1, string MessageInfo)
        {
            System.Xml.Linq.XElement root = System.Xml.Linq.XElement.Parse(MessageInfo);
            var xRow = root.Element("row");

            EyouSoft.Model.CompanyStructure.CustomerMessageModel Model = new EyouSoft.Model.CompanyStructure.CustomerMessageModel();
            if (xRow != null)
            {
                Model.MessageTitle      = EyouSoft.Toolkit.Utils.GetXAttributeValue(xRow, "MessageTitle");
                Model.MessageTime       = DateTime.Parse(EyouSoft.Toolkit.Utils.GetXAttributeValue(xRow, "MessageTime"));
                Model.MessageContent    = EyouSoft.Toolkit.Utils.GetXAttributeValue(xRow, "MessageContent");
                Model.MessagePersonName = EyouSoft.Toolkit.Utils.GetXAttributeValue(xRow, "MessagePersonName");
                Model.ReplyState        = (EyouSoft.Model.EnumType.CompanyStructure.ReplyState) int.Parse(EyouSoft.Toolkit.Utils.GetXAttributeValue(xRow, "ReplyState"));
                model1.MessageInfo      = Model;
            }
        }
Exemple #10
0
 /// 获取留言列表
 /// </summary>
 /// <param name="companyId">组团登录为组团公司编号,专线登录为专线公司编号</param>
 /// <param name="pageSize">每页显示的记录数</param>
 /// <param name="pageIndex">返回第几页</param>
 /// <param name="recordCount">返回的记录数</param>
 /// <param name="isZhuTuan">True:组团端,False:专线端</param>
 /// <param name="customerMessageModel">留言搜索实体</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.CompanyStructure.CustomerMessageModel> GetMessageList(int companyId, int pageSize, int pageIndex, ref int recordCount, bool isZhuTuan, EyouSoft.Model.CompanyStructure.CustomerMessageModel customerMessageModel)
 {
     return(dal.GetMessageList(companyId, pageSize, pageIndex, ref recordCount, isZhuTuan, customerMessageModel));
 }