Exemplo n.º 1
0
        /// <summary>
        /// 更新发布数据
        /// </summary>
        /// <param name="AC_Id"></param>
        /// <returns></returns>
        public Message UpadteAdUserStatusGroup(View_AdUser model, string userIDArray)
        {
            Message jsonMessage;
            bool    resultB = false;
            string  reStr   = "";

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ADUser set ");
            strSql.Append(" AP_ID=" + model.AP_ID);
            strSql.Append(" ,PublishDate='" + model.PublishDate);
            strSql.Append(" ',AC_ID=" + model.AC_ID);
            strSql.Append(" where UserID in(" + userIDArray + ")");

            resultB = SQLHelper.ExecuteNonQuery(conString, CommandType.Text, strSql.ToString()) > 0;

            if (!resultB)
            {
                reStr = "用户发布失败!";
            }
            else
            {
                reStr = "用户发布成功!";
            }
            jsonMessage = new Message()
            {
                Result     = resultB,
                TxtMessage = reStr
            };
            return(jsonMessage);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新发布数据
        /// </summary>
        /// <param name="AC_Id"></param>
        /// <returns></returns>
        public Message UpadteAdUserStatus(View_AdUser model)
        {
            Message jsonMessage;
            bool    resultB = false;
            string  reStr   = "";

            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ADUser set ");
            strSql.Append(" AP_ID=@AP_ID,");
            strSql.Append(" PublishDate=@PublishDate,");
            strSql.Append(" AC_ID=@AC_ID ");
            strSql.Append(" where UserID=@UserID and CompanyID=@CompanyID  ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserID",      SqlDbType.Char,      10),
                new SqlParameter("@CompanyID",   SqlDbType.Char,       4),
                new SqlParameter("@AP_ID",       SqlDbType.BigInt,     8),
                new SqlParameter("@PublishDate", SqlDbType.DateTime),
                new SqlParameter("@AC_ID",       SqlDbType.BigInt,     8),
            };
            parameters[0].Value = model.UserID;
            parameters[1].Value = model.CompanyID;
            parameters[2].Value = model.AP_ID;
            parameters[3].Value = model.PublishDate;
            parameters[4].Value = model.AC_ID;

            resultB = SQLHelper.ExecuteNonQuery(conString, CommandType.Text, strSql.ToString(), parameters) > 0;

            if (!resultB)
            {
                reStr = "用户发布失败!";
            }
            else
            {
                reStr = "用户发布成功!";
            }
            jsonMessage = new Message()
            {
                Result     = resultB,
                TxtMessage = reStr
            };
            return(jsonMessage);
        }