Beispiel #1
0
 public bool UpdatePyramid(PyramidInfo info)
 {
     bool flag = false;
     try
     {
         SqlParameter[] SqlParameters = new SqlParameter[12]
     {
       new SqlParameter("@ID", (object) info.ID),
       new SqlParameter("@UserID", (object) info.UserID),
       new SqlParameter("@currentLayer", (object) info.currentLayer),
       new SqlParameter("@maxLayer", (object) info.maxLayer),
       new SqlParameter("@totalPoint", (object) info.totalPoint),
       new SqlParameter("@turnPoint", (object) info.turnPoint),
       new SqlParameter("@pointRatio", (object) info.pointRatio),
       new SqlParameter("@currentFreeCount", (object) info.currentFreeCount),
       new SqlParameter("@currentReviveCount", (object) info.currentReviveCount),
       new SqlParameter("@isPyramidStart", (object) (int) (info.isPyramidStart ? 1 : 0)),
       new SqlParameter("@LayerItems", (object) info.LayerItems),
       new SqlParameter("@Result", SqlDbType.Int)
     };
         SqlParameters[11].Direction = ParameterDirection.ReturnValue;
         this.db.RunProcedure("SP_UpdatePyramid", SqlParameters);
         flag = (int)SqlParameters[11].Value == 0;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"SP_UpdatePyramid", ex);
     }
     return flag;
 }
Beispiel #2
0
 public bool AddPyramid(PyramidInfo info)
 {
     bool flag = false;
     try
     {
         SqlParameter[] SqlParameters = new SqlParameter[12];
         SqlParameters[0] = new SqlParameter("@ID", (object)info.ID);
         SqlParameters[0].Direction = ParameterDirection.Output;
         SqlParameters[1] = new SqlParameter("@UserID", (object)info.UserID);
         SqlParameters[2] = new SqlParameter("@currentLayer", (object)info.currentLayer);
         SqlParameters[3] = new SqlParameter("@maxLayer", (object)info.maxLayer);
         SqlParameters[4] = new SqlParameter("@totalPoint", (object)info.totalPoint);
         SqlParameters[5] = new SqlParameter("@turnPoint", (object)info.turnPoint);
         SqlParameters[6] = new SqlParameter("@pointRatio", (object)info.pointRatio);
         SqlParameters[7] = new SqlParameter("@currentFreeCount", (object)info.currentFreeCount);
         SqlParameters[8] = new SqlParameter("@currentReviveCount", (object)info.currentReviveCount);
         SqlParameters[9] = new SqlParameter("@isPyramidStart", (object)(int)(info.isPyramidStart ? 1 : 0));
         SqlParameters[10] = new SqlParameter("@LayerItems", (object)info.LayerItems);
         SqlParameters[11] = new SqlParameter("@Result", SqlDbType.Int);
         SqlParameters[11].Direction = ParameterDirection.ReturnValue;
         this.db.RunProcedure("SP_Pyramid_Add", SqlParameters);
         flag = (int)SqlParameters[11].Value == 0;
         info.ID = (int)SqlParameters[0].Value;
         info.IsDirty = false;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"SP_Pyramid_Add", ex);
     }
     return flag;
 }