Exemple #1
0
 private bool SetStat(string aPid, PassMark aMark)
 {
     try
     {
         string sTmp    = aPid.Substring(section.PreAccount.Length);
         var    command = ConnectManager.Provider.CreateCommandStruct("SnsPassportLog", CommandMode.Modify);
         command.AddParameter("mark", Convert.ToInt32(aMark));
         if (aMark == PassMark.IsPushToNewUser)
         {
             command.AddParameter("regpushtime", MathUtils.Now);
         }
         else if (aMark == PassMark.IsReg)
         {
             command.AddParameter("regtime", MathUtils.Now);
         }
         command.Filter           = ConnectManager.Provider.CreateCommandFilter();
         command.Filter.Condition = command.Filter.FormatExpression("PassportId");
         command.Filter.AddParam("PassportId", sTmp);
         command.Parser();
         return(ConnectManager.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0);
     }
     catch
     {
         return(false);
     }
 }
Exemple #2
0
 private bool SetStat(string aPid, PassMark aMark)
 {
     try
     {
         string sUpSql = "update SnsPassportLog set mark=@aNewMark,";
         if (aMark == PassMark.IsPushToNewUser)
         {
             sUpSql += " regpushtime=getdate()";
         }
         else if (aMark == PassMark.IsReg)
         {
             sUpSql += " regtime=getdate()";
         }
         sUpSql += " where passportid=@aPid";
         SqlParameter[] paramsUpdate = new SqlParameter[2];
         string         sTmp         = aPid.Substring(PreAccount.Length);
         paramsUpdate[0] = SqlParamHelper.MakeInParam("@anewMark", SqlDbType.Int, 0, Convert.ToInt32(aMark));
         paramsUpdate[1] = SqlParamHelper.MakeInParam("@aPid", SqlDbType.VarChar, 0, sTmp);
         SqlHelper.ExecuteNonQuery(config.connectionString, CommandType.Text, sUpSql, paramsUpdate);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #3
0
 private bool SetStat(string aPid, PassMark aMark)
 {
     try
     {
         string sTmp = aPid.Substring(section.PreAccount.Length);
         var command = ConnectManager.Provider.CreateCommandStruct("SnsPassportLog", CommandMode.Modify);
         command.AddParameter("mark", Convert.ToInt32(aMark));
         if (aMark == PassMark.IsPushToNewUser)
         {
             command.AddParameter("regpushtime", MathUtils.Now);
         }
         else if (aMark == PassMark.IsReg)
         {
             command.AddParameter("regtime", MathUtils.Now);
         }
         command.Filter = ConnectManager.Provider.CreateCommandFilter();
         command.Filter.Condition = command.Filter.FormatExpression("PassportId");
         command.Filter.AddParam("PassportId", sTmp);
         command.Parser();
         return ConnectManager.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0;
     }
     catch
     {
         return false;
     }
 }
Exemple #4
0
 private bool SetStat(string aPid, PassMark aMark)
 {
     try
     {
         string sUpSql = "update SnsPassportLog set mark=@aNewMark,";
         if (aMark == PassMark.IsPushToNewUser)
         {
             sUpSql += " regpushtime=getdate()";
         }
         else if (aMark == PassMark.IsReg)
         {
             sUpSql += " regtime=getdate()";
         }
         sUpSql += " where passportid=@aPid";
         SqlParameter[] paramsUpdate = new SqlParameter[2];
         string sTmp = aPid.Substring(PreAccount.Length);
         paramsUpdate[0] = SqlParamHelper.MakeInParam("@anewMark", SqlDbType.Int, 0, Convert.ToInt32(aMark));
         paramsUpdate[1] = SqlParamHelper.MakeInParam("@aPid", SqlDbType.VarChar, 0, sTmp);
         SqlHelper.ExecuteNonQuery(config.connectionString, CommandType.Text, sUpSql, paramsUpdate);
         return true;
     }
     catch
     {
         return false;
     }
 }