Ejemplo n.º 1
0
 /// <summary>
 /// 添加反馈
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_FeedbackTableData(Feedback_Table obj)
 {
     return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"),
                                      CommandType.StoredProcedure,
                                      new SqlParameter[] {
         new SqlParameter("@U_id", obj.U_id),
         new SqlParameter("@P_id", obj.P_id),
         new SqlParameter("@Feed_Datetime", obj.Feed_Datetime),
         new SqlParameter("@Feed_Content", obj.Feed_Content)
     }));
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Feedback_Table ft = new Feedback_Table();

            ft.FeedbackCategoryID = comboBox1.SelectedIndex + 1;
            ft.MemberID           = member_id;
            ft.Contents           = textBox1.Text;
            ft.ProgressID         = 1;
            ft.FeedbackDate       = DateTime.Today;
            if (pictureBox1.Image != null)
            {
                byte[] bytes;
                System.IO.MemoryStream ms = new System.IO.MemoryStream();
                pictureBox1.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                bytes      = ms.GetBuffer();
                ft.Picture = bytes;
            }
            DE.Feedback_Table.Add(ft);
            DE.SaveChanges();
            listBox1.Items.Clear();
            var q1 = new CCustomerMsg().get_Feedback_msg(member_id);

            foreach (var item in q1)
            {
                listBox1.Items.Add(item);
            }
            textBox1.Text     = "";
            pictureBox1.Image = null;
            var q2 = from n in DE.Feedback_Table
                     where n.MemberID == member_id
                     select new
            {
                n.Feedback_Category_Table.FeedbackCategory,
                n.Contents,
                n.FeedbackContent,
                n.Feedback_Progress_Table.ProgressContent,
                n.FeedbackDate,
                n.Picture
            };

            dataGridView1.DataSource = q2.ToList();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取全部的反馈
        /// </summary>
        /// <returns></returns>
        public List <Feedback_Table> GetFeedbackTableAll()
        {
            List <Feedback_Table> list = new List <Feedback_Table>();
            SqlDataReader         dr   = DBHerlper.ExecuteReader(GetSqlString("Select"),
                                                                 CommandType.StoredProcedure);

            while (dr.Read())
            {
                Feedback_Table obj = new Feedback_Table()
                {
                    Feed_Content  = dr["Feed_Content"].ToString(),
                    Feed_Datetime = Convert.ToDateTime(dr["Feed_Datetime"]),
                    Feed_id       = Convert.ToInt32(dr["Feed_id"]),
                    P_id          = Convert.ToInt32(dr["P_id"]),
                    U_id          = Convert.ToInt32(dr["U_id"])
                };
                list.Add(obj);
            }
            dr.Close();
            return(list);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 根据ID查询反馈信息
        /// </summary>
        /// <param name="con"></param>
        /// <returns></returns>
        public Feedback_Table GetFeedbackTableByConn(string con)
        {
            Feedback_Table obj = null;
            SqlDataReader  dr  = DBHerlper.ExecuteReader(
                "Select * from Feedback_Table where Feed_id=@Feed_id",
                CommandType.Text, new SqlParameter[] {
                new SqlParameter("@Feed_id", con)
            });

            if (dr.Read())
            {
                obj = new Feedback_Table()
                {
                    Feed_Content  = dr["Feed_Content"].ToString(),
                    Feed_Datetime = Convert.ToDateTime(dr["Feed_Datetime"]),
                    Feed_id       = Convert.ToInt32(dr["Feed_id"]),
                    P_id          = Convert.ToInt32(dr["P_id"]),
                    U_id          = Convert.ToInt32(dr["U_id"])
                };
            }
            dr.Close();
            return(obj);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 更改反馈信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Update_FeedbackTableData(Feedback_Table obj)
 {
     return(relevanceClass.Update_FeedbackTableData(obj));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 添加反馈信息
 /// </summary>
 /// <param name="obj">带入参数</param>
 /// <returns></returns>
 public int Insert_FeedbackTableData(Feedback_Table obj)
 {
     return(relevanceClass.Insert_FeedbackTableData(obj));
 }