protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();
                // 消息标题
                ht["MessageTitle"] = this.txtMessageTitle.Text.Trim();
                // 启用时间
                ht["BeginTime"] = txtBegin.Text.Trim();
                // 结束时间
                ht["EndTime"] = txtEnd.Text.Trim();
                // 摘要简介
                ht["Summary"] = this.txtSummary.Text.Trim();
                // 消息内容
                ht["MessageContent"] = this.ckeId.Text;
                // 图片地址
                ht["ImageUrl"] = this.hidPath.Value.ToString().Trim();
                //消息类型 2 用户消息
                ht["MessageType"] = "2";
                // 状态(0未启用,1启用)
                if (radOK.Checked)
                {
                    ht["State"] = "1";
                }
                else
                {
                    ht["State"] = "0";
                }
                // 操作人员ID
                ht["OperatorID"] = RequestSession.GetSessionUser().UserId.ToString();
                //发布时间
                ht["ReleaseTime"] = DateTime.Now.ToString();
                if (!string.IsNullOrEmpty(_key))
                {
                    ht["ID"] = _key;
                }
                else
                {
                    ht["ID"] = CommonHelper.GetGuid;
                }
                bool result = messageManager.AddOrEditMessageInfo(ht, _key);

                if (result)
                {
                    ShowMsgHelper.AlertMsg("操作成功!");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("操作失败!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();

                #region 初始化消息内容
                // 消息标题
                ht["MessageTitle"] = MessageTitle.Value;
                // 消息内容
                ht["MessageContent"] = MessageContent.Value;
                // 消息类型
                ht["MessageType"] = MessageType.System.GetHashCode();
                // 模块类型
                ht["ModuleType"] = ModuleType.Value;
                // 发布时间
                ht["ReleaseTime"] = SiteHelper.GetWebServerCurrentTime().ToString();
                // 操作人员ID
                ht["OperatorID"] = RequestSession.GetSessionUser().UserId.ToString();
                // 状态
                ht["State"] = MessageState.Enable.GetHashCode();
                if (!string.IsNullOrEmpty(_key))
                {
                    ht["ID"] = _key;
                }
                else
                {
                    ht["ID"] = CommonHelper.GetGuid;
                }
                #endregion

                bool returnValue = messageManager.AddOrEditMessageInfo(ht, _key);

                if (returnValue)
                {
                    ShowMsgHelper.AlertMsg("操作成功!");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("操作失败!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }