Exemple #1
0
        /// <summary>
        /// 删除个人用户留言信息
        /// </summary>
        private void DeleteMessage()
        {
            int mid;

            if (!int.TryParse(nv["mid"], out mid))
            {
                HttpContext.Current.Response.Write("0");
                return;
            }
            E_ItemMessage data = new E_ItemMessage();

            data.ID = mid;
            bool flag = new T_ItemMessage().AdminDelete(data);

            HttpContext.Current.Response.Write(flag ? "1" : "0");
        }
Exemple #2
0
        /// <summary>
        /// 提交留言处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //获取界面数据
            string username = txtUserName.Text.Trim();
            string mobile   = txtMobile.Text.Trim();
            string tel      = txtTel.Text.Trim();
            string address  = txtAddress.Text.Trim();
            string email    = txtEmail.Text.Trim();
            string message  = txtMessage.Text.Trim();

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(message))
            {
                Jscript.ShowMsg("请请认真填写以上内容!", this);
                return;
            }

            E_ItemMessage data = new E_ItemMessage();

            data.ItemID   = iid;
            data.UserID   = UserID;
            data.UserName = username;
            data.Mobile   = mobile;
            data.Tel      = tel;
            data.Address  = address;
            data.Email    = email;
            data.Message  = message;

            bool flag = new T_ItemMessage().Add(data);

            if (flag)
            {
                loadMessage();
                txtMessage.Text = "";
            }
            else
            {
                Jscript.ShowMsg("留言失败!", this);
            }
        }