/// <summary>
        /// 更新绑定
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="status">0未关注 1关注</param>
        /// <returns></returns>
        public bool BindingUsers(Bus_BindingUsers_Request req)
        {
            StringBuilder     strSql = new StringBuilder();
            DynamicParameters dp     = new DynamicParameters();

            strSql.Append(" UPDATE Users SET ");
            if (req.source == "em")
            {
                strSql.Append(" emcompany=@emcompany, ");
                dp.Add("@emcompany", req.companycode, DbType.String, ParameterDirection.Input);
            }
            else if (req.source == "stock")
            {
                strSql.Append(" stockcompany=@stockcompany, ");
                dp.Add("@stockcompany", req.companycode, DbType.String, ParameterDirection.Input);
            }
            strSql.Append(" updatetime=@updatetime ");
            strSql.Append(" WHERE unionid=@unionid ");
            dp.Add("@unionid", req.unionid, DbType.String, ParameterDirection.Input);
            dp.Add("@updatetime", DateTime.Now, DbType.DateTime, ParameterDirection.Input);
            using (IDbConnection connection = new SqlConnection(DBConnectionStringConfig.Default.WechatServerDBReadConnStr))
            {
                return(connection.Execute(strSql.ToString(), dp) > 0);
            }
        }
Esempio n. 2
0
 public bool BindingUsers(Bus_BindingUsers_Request req)
 {
     return(wechatdal.BindingUsers(req));
 }