Пример #1
0
 /// <summary>
 /// 更新云秒杀记录
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int UpdateDsYmsUser(DsYmsUserModel model)
 {
     string sql = "update selfstock.DS_YMS_USER set showname=:showname,lastresults=:lastresults,sort=:sort where username=:username";
     var commandParameters = new[]
                                 {
                                     new OracleParameter(":showname", OracleDbType.Varchar2),
                                     new OracleParameter(":lastresults", OracleDbType.Decimal),
                                     new OracleParameter(":sort", OracleDbType.Int32),
                                     new OracleParameter(":username", OracleDbType.Varchar2)                                            
                                 };
     commandParameters[0].Value = model.ShowName;
     commandParameters[1].Value = model.LastResults;
     commandParameters[2].Value = model.Sort;
     commandParameters[3].Value = model.UserName;
     return OracleDataAccess.ExecuteNonQuery(OracleDataAccess.OracleConnectionUpdbString, CommandType.Text, sql, commandParameters);
 }
Пример #2
0
 /// <summary>
 /// 删除云秒杀记录
 /// </summary>
 /// <param name="UserName"></param>
 /// <returns></returns>
 public int DeleteDsYmsUser(string UserName)
 {
     try
     {
         string sql = "DELETE FROM selfstock.DS_YMS_USER WHERE USERNAME=:USERNAME";
         var commandParameters = new[]
                                     {
                                         new OracleParameter(":USERNAME", OracleDbType.Varchar2)
                                     };
         commandParameters[0].Value = UserName;
         return OracleDataAccess.ExecuteNonQuery(OracleDataAccess.OracleConnectionUpdbString, CommandType.Text, sql, commandParameters);
     }
     catch (OracleException ce)
     {
         Loger.Error(ce);
     }
     return 0;
 }
Пример #3
0
 /// <summary>
 /// 插入云秒杀记录
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int InsertDsYmsUser(DsYmsUserModel model)
 {
     string sql = "INSERT INTO selfstock.DS_YMS_USER (username,showname,lastresults,sort,package)";
     sql += " VALUES(:username,:showname,:lastresults,:sort,:package)";
     var commandParameters = new[]
                                 {
                                     new OracleParameter(":username", OracleDbType.Varchar2),
                                     new OracleParameter(":showname", OracleDbType.Varchar2),
                                     new OracleParameter(":lastresults", OracleDbType.Decimal),
                                     new OracleParameter(":sort", OracleDbType.Int32),
                                     new OracleParameter(":package", OracleDbType.Varchar2)
                                 };
     commandParameters[0].Value = model.UserName;
     commandParameters[1].Value = model.ShowName;
     commandParameters[2].Value = model.LastResults;
     commandParameters[3].Value = model.Sort;
     commandParameters[4].Value = model.Package.ToLower();
     return OracleDataAccess.ExecuteNonQuery(OracleDataAccess.OracleConnectionUpdbString, CommandType.Text, sql, commandParameters);
 }