Пример #1
0
        /// <summary>
        /// 添加问题反馈
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2011-10-28</remarks>
        public bool Add(E_Feedback data)
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter("@UserID", SqlDbType.Int),
                new SqlParameter("@UserType", SqlDbType.TinyInt),
                new SqlParameter("@Subject", SqlDbType.VarChar, 128),
                new SqlParameter("@Detail", SqlDbType.VarChar),
                new SqlParameter("@FileName", SqlDbType.VarChar, 128),
                new SqlParameter("@Url", SqlDbType.VarChar, 128),
                new SqlParameter("@FileType", SqlDbType.VarChar, 16),
                new SqlParameter("@FileSize", SqlDbType.Int),
                new SqlParameter("@FeedbackID", SqlDbType.Int),
                new SqlParameter("@EnterpriseID", SqlDbType.Int)
            };
            parms[0].Value     = data.UserID;
            parms[1].Value     = data.UserType;
            parms[2].Value     = data.Subject;
            parms[3].Value     = data.Detail;
            parms[4].Value     = data.FileName;
            parms[5].Value     = data.Url;
            parms[6].Value     = data.FileType;
            parms[7].Value     = data.FileSize;
            parms[8].Direction = ParameterDirection.Output;
            parms[9].Value     = data.EnterpriseID;
            int ReturnValue;

            DbHelperSQL.RunProcedures("ProcB_FeedbackS_Insert", parms, out ReturnValue);
            data.FeedbackID = parms[8].Value == DBNull.Value ? 0 : Convert.ToInt32(parms[8].Value);
            return(ReturnValue > 0);
        }
Пример #2
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected void databind(int id)
        {
            E_Feedback data = new E_Feedback();

            data.FeedbackID = id;
            data            = new T_Feedback().GetModel(data);
            if (data == null)
            {
                return;
            }
            lblSubject.Text = data.Subject;
            lblDetail.Text  = data.Detail;
            lblAddDate.Text = data.AddDate.ToString("yyyy-MM-dd HH:mm");
            //判断是否有附件
            if (string.IsNullOrWhiteSpace(data.Url))
            {
                imgFile.ImageUrl = data.Url;
            }
        }
Пример #3
0
        /// <summary>
        /// 查看反馈信息的详情
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2011-10-28</remarks>
        public E_Feedback GetModel(E_Feedback data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@FeedbackID", SqlDbType.Int)
            };
            parms[0].Value = data.FeedbackID;
            DataTable dt = DbHelperSQL.RunProcedureTable("ProcB_FeedbackS_Select", parms);

            if (dt != null && dt.Rows.Count == 1)
            {
                DataRow row = dt.Rows[0];
                data.Subject  = row["Subject"].ToString();
                data.Detail   = row["Detail"].ToString();
                data.AddDate  = Convert.ToDateTime(row["AddDate"]);
                data.FileName = row["FileName"].ToString();
                data.Url      = row["Url"].ToString();
                return(data);
            }
            return(null);
        }
Пример #4
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected void databind()
        {
            E_Feedback data = new E_Feedback();
            //用户类型
            int value = Requests.GetQueryInt("usertype", 0);

            rbUserType.SelectedValue = value.ToString();
            data.UserType            = value;

            //日期
            string start = Requests.GetQueryString("startdate");
            string end   = Requests.GetQueryString("enddate");

            txtStartDate.Value = start;
            txtEndDate.Value   = end;
            //初始Pgae类
            data.Page = new MLMGC.DataEntity.E_Page();
            if (start != "")
            {
                data.Page.StartDate = Convert.ToDateTime(start);
            }
            if (end != "")
            {
                data.Page.EndDate = Convert.ToDateTime(end);
            }

            //分页参数
            data.Page.PageSize  = pageSize;
            data.Page.PageIndex = pageIndex;

            rpList.DataSource = new T_Feedback().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;";
        }
Пример #5
0
        /// <summary>
        /// 查看问题反馈列表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        /// <remarks>tianzhenyun 2011-10-28</remarks>
        public DataTable GetList(E_Feedback data)
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter("@UserType", SqlDbType.TinyInt),
                new SqlParameter("@StartDate", SqlDbType.SmallDateTime),
                new SqlParameter("@EndDate", SqlDbType.SmallDateTime),
                new SqlParameter("@PageIndex", SqlDbType.Int),
                new SqlParameter("@PageSize", SqlDbType.Int),
                new SqlParameter("@TotalCount", SqlDbType.Int)
            };
            parms[0].Value     = data.UserType;
            parms[1].Value     = data.Page.StartDate;
            parms[2].Value     = data.Page.EndDate;
            parms[3].Value     = data.Page.PageIndex;
            parms[4].Value     = data.Page.PageSize;
            parms[5].Direction = ParameterDirection.Output;

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

            data.Page.TotalCount = parms[5].Value == DBNull.Value ? 0 : Convert.ToInt32(parms[5].Value);
            return(dt);
        }
Пример #6
0
        /// <summary>
        /// 点击保存按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //判断是否输入标题和分类
            if (string.IsNullOrWhiteSpace(txtSubject.Text) && string.IsNullOrWhiteSpace(txtDetail.Text))
            {
                MLMGC.COMP.Jscript.ShowMsg("请输入标题和描述", this);
                return;
            }
            else if (string.IsNullOrWhiteSpace(txtSubject.Text))
            {
                MLMGC.COMP.Jscript.ShowMsg("请输入标题", this);
                return;
            }
            else if (string.IsNullOrWhiteSpace(txtDetail.Text))
            {
                MLMGC.COMP.Jscript.ShowMsg("请输入描述", this);
                return;
            }

            //----封装对象----
            E_Feedback data = new E_Feedback();

            data.UserID   = UserID;
            data.UserType = (int)MLMGC.DataEntity.User.UserType.个人用户;
            data.Subject  = txtSubject.Text;
            data.Detail   = txtDetail.Text;

            //判断是否上传附件
            if (FileUpload1.HasFiles)
            {
                //上传文件
                List <PFileInfo> list = FileUpload1.Upload();
                if (list == null || list.Count == 0)
                {
                    MLMGC.COMP.Jscript.ShowMsg("上传文件失败", this);
                    return;
                }
                data.FileName = list[0].FileName;
                data.FileType = list[0].FileType;
                data.FileSize = Convert.ToInt32(list[0].FileSize);
                data.Url      = list[0].FileAddress;
            }
            else
            {
                data.FileName = "";
                data.FileType = "";
                data.FileSize = 0;
                data.Url      = "";
            }


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

            if (flag)
            {
                MLMGC.COMP.Jscript.ShowMsg("添加成功", this);
            }
            else
            {
                MLMGC.COMP.Jscript.ShowMsg("添加失败", this);
            }
        }
Пример #7
0
 /// <summary>
 /// 查看反馈信息列表
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public DataTable GetList(E_Feedback data)
 {
     return(dal.GetList(data));
 }
Пример #8
0
 /// <summary>
 /// 查看反馈信息详情
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public E_Feedback GetModel(E_Feedback data)
 {
     return(dal.GetModel(data));
 }
Пример #9
0
 /// <summary>
 /// 添加问题反馈
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public bool Add(E_Feedback data)
 {
     return(dal.Add(data));
 }