Example #1
0
        /// <summary>
        /// 修改一个实体
        /// </summary>
        /// <param name="_entity"></param>
        /// <returns></returns>
        public int Update(Models.APP.Feedback model)
        {
            try
            {
                SqlParameter[] para =
                {
                    new SqlParameter("@fb_id",      model.fb_id),
                    new SqlParameter("@m_id",       model.m_id),
                    new SqlParameter("@context",    model.context),
                    new SqlParameter("@reply",      model.reply),
                    new SqlParameter("@createtime", model.createtime),
                    new SqlParameter("@modifytime", model.modifytime),
                    new SqlParameter("@userid",     model.userid),
                    new SqlParameter("@muserid",    model.muserid)
                };

                StringBuilder cmdText = new StringBuilder();
                cmdText.Append(@"UPDATE [App_Feedback]
								SET [m_id]=@m_id
									   ,[context]=@context
							       ,[reply]=@reply
							       ,[createtime]=@createtime
							       ,[modifytime]=@modifytime
							       ,[userid]=@userid
							       ,[muserid]=@muserid
							  WHERE [fb_id]=@fb_id"                            );
                return(SqlHelper.ExecuteNonQuery(DefaultConnection.ConnectionStringByDefaultDB, CommandType.Text, cmdText.ToString(), para));
            }
            catch (ArgumentNullException ex)
            {
                logger.Error("调用方法Update()发生ArgumentNullException", ex);
            }
            catch (SqlException ex)
            {
                logger.Error("调用方法Update()发生SqlException", ex);
            }
            catch (Exception ex)
            {
                logger.Error("调用方法Update()发生Exception", ex);
            }
            return(-1);
        }
Example #2
0
 /// <summary>
 /// 修改一个实体
 /// </summary>
 /// <param name="_entity"></param>
 /// <returns></returns>
 public int Update(Models.APP.Feedback model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 添加一条数据
 /// </summary>
 /// <param name="model">数据实体</param>
 /// <returns></returns>
 public int Add(Models.APP.Feedback model)
 {
     return(dal.Add(model));
 }