Ejemplo n.º 1
0
        /// <summary>
        /// 管理员获取项目留言列表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2012-04-28</remarks>
        public DataTable AdminGetList(E_ItemMessage data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseName", SqlDbType.VarChar, 128),
                new SqlParameter("@ItemName",       SqlDbType.VarChar,  64),
                new SqlParameter("@UserName",       SqlDbType.VarChar, 128),
                new SqlParameter("@Mobile",         SqlDbType.VarChar,  11),
                new SqlParameter("@Email",          SqlDbType.VarChar, 128),
                new SqlParameter("@DelFlag",        SqlDbType.Int),
                new SqlParameter("@PageSize",       SqlDbType.Int),
                new SqlParameter("@PageIndex",      SqlDbType.Int),
                new SqlParameter("@TotalCount",     SqlDbType.Int)
            };
            parms[0].Value     = data.EnterpriseName;
            parms[1].Value     = data.ItemName;
            parms[2].Value     = data.UserName;
            parms[3].Value     = data.Mobile;
            parms[4].Value     = data.Email;
            parms[5].Value     = data.DelFlag;
            parms[6].Value     = data.Page.PageSize;
            parms[7].Value     = data.Page.PageIndex;
            parms[8].Direction = ParameterDirection.Output;

            DataTable dt = DbHelperSQL.RunProcedureTable("ProcEP_B_ItemMessage_AdminSelectList", parms);

            data.Page.TotalCount = parms[8].Value == DBNull.Value ? 0 : Convert.ToInt32(parms[8].Value);
            return(dt);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加留言信息
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2012-04-27</remarks>
        public bool Add(E_ItemMessage data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@ItemID",   SqlDbType.Int),
                new SqlParameter("@UserID",   SqlDbType.Int),
                new SqlParameter("@UserName", SqlDbType.VarChar, 128),
                new SqlParameter("@Mobile",   SqlDbType.VarChar,  11),
                new SqlParameter("@Tel",      SqlDbType.VarChar,  64),
                new SqlParameter("@Email",    SqlDbType.VarChar, 128),
                new SqlParameter("@Address",  SqlDbType.VarChar, 128),
                new SqlParameter("@Message",  SqlDbType.VarChar, 1024)
            };
            parms[0].Value = data.ItemID;
            parms[1].Value = data.UserID;
            parms[2].Value = data.UserName;
            parms[3].Value = data.Mobile;
            parms[4].Value = data.Tel;
            parms[5].Value = data.Email;
            parms[6].Value = data.Address;
            parms[7].Value = data.Message;

            int ReturnValue;

            DbHelperSQL.RunProcedures("ProcEP_B_ItemMessage_Insert", parms, out ReturnValue);
            return(ReturnValue > 0);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 后台管理员真正删除
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool AdminDelete(E_ItemMessage data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@ID", SqlDbType.Int)
            };
            parms[0].Value = data.ID;

            int ReturnValue;

            DbHelperSQL.RunProcedures("ProcEP_B_ItemMessage_AdminDelete", parms, out ReturnValue);
            return(ReturnValue > 0);
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 加载留言信息
        /// </summary>
        protected void loadMessage()
        {
            E_ItemMessage data = new E_ItemMessage();

            data.EnterpriseID   = eid;
            data.Page           = new MLMGC.DataEntity.E_Page();
            data.Page.PageIndex = pageIndex;
            data.Page.PageSize  = pageSize;

            rpList.DataSource = new T_ItemMessage().GetList(data);
            rpList.DataBind();

            //设置分页样式
            pageList1.PageSize              = pageSize;
            pageList1.CurrentPageIndex      = pageIndex;
            pageList1.RecordCount           = data.Page.TotalCount;
            pageList1.CustomInfoHTML        = string.Format("共有记录 <span class='red_font'>{0}</span> 条", pageList1.RecordCount);
            pageList1.TextAfterPageIndexBox = "&nbsp;页/" + pageList1.PageCount + "&nbsp;";
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查看留言列表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2012-04-27</remarks>
        public DataTable GetList(E_ItemMessage data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@PageSize",     SqlDbType.Int),
                new SqlParameter("@PageIndex",    SqlDbType.Int),
                new SqlParameter("@TotalCount",   SqlDbType.Int)
            };
            parms[0].Value     = data.EnterpriseID;
            parms[1].Value     = data.Page.PageSize;
            parms[2].Value     = data.Page.PageIndex;
            parms[3].Direction = ParameterDirection.Output;

            DataTable dt = DbHelperSQL.RunProcedureTable("ProcEP_B_ItemMessage_SelectList", parms);

            data.Page.TotalCount = parms[3].Value == DBNull.Value ? 0 : Convert.ToInt32(parms[3].Value);
            return(dt);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected void databind()
        {
            string epname   = Requests.GetQueryString("epname");
            string itemname = Requests.GetQueryString("itemname");
            string username = Requests.GetQueryString("username");
            string mobile   = Requests.GetQueryString("mobile");
            string email    = Requests.GetQueryString("email");
            int    delflag  = Requests.GetQueryInt("delflag", -1);

            txtEPName.Text   = epname;
            txtItemName.Text = itemname;
            txtUserName.Text = username;
            txtMobile.Text   = mobile;
            txtEmail.Text    = email;

            cbDelFlag.Checked = delflag == 0;

            E_ItemMessage data = new E_ItemMessage();

            data.EnterpriseName = epname;
            data.ItemName       = itemname;
            data.UserName       = username;
            data.Mobile         = mobile;
            data.Email          = email;
            data.DelFlag        = delflag;
            data.Page           = new MLMGC.DataEntity.E_Page();
            data.Page.PageIndex = pageIndex;
            data.Page.PageSize  = pageSize;

            rpList.DataSource = new T_ItemMessage().AdminGetList(data);
            rpList.DataBind();

            //设置分页样式
            pageList1.PageSize              = pageSize;
            pageList1.CurrentPageIndex      = pageIndex;
            pageList1.RecordCount           = data.Page.TotalCount;
            pageList1.CustomInfoHTML        = string.Format("共有记录 <span class='red_font'>{0}</span> 条", pageList1.RecordCount);
            pageList1.TextAfterPageIndexBox = "&nbsp;页/" + pageList1.PageCount + "&nbsp;";
        }
Ejemplo n.º 8
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);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 后台管理员真正删除
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public bool AdminDelete(E_ItemMessage data)
 {
     return(dal.AdminDelete(data));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 总监删除留言
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 /// <remarks>tianzhenyun 2012-04-27</remarks>
 public bool Delete(E_ItemMessage data)
 {
     return(dal.Delete(data));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 管理员获取项目留言列表
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 /// <remarks>tianzhenyun 2012-04-28</remarks>
 public DataTable AdminGetList(E_ItemMessage data)
 {
     return(dal.AdminGetList(data));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 添加留言信息
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 /// <remarks>tianzhenyun 2012-04-27</remarks>
 public bool Add(E_ItemMessage data)
 {
     return(dal.Add(data));
 }