public bool AddActiveSystem(ActiveSystemInfo 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("@useableScore", (object)info.useableScore); SqlParameters[3] = new SqlParameter("@totalScore", (object)info.totalScore); SqlParameters[4] = new SqlParameter("@AvailTime", (object)info.AvailTime); SqlParameters[5] = new SqlParameter("@NickName", (object)info.NickName); SqlParameters[6] = new SqlParameter("@CanGetGift", (object)(int)(info.CanGetGift ? 1 : 0)); SqlParameters[7] = new SqlParameter("@canOpenCounts", (object)info.canOpenCounts); SqlParameters[8] = new SqlParameter("@canEagleEyeCounts", (object)info.canEagleEyeCounts); SqlParameters[9] = new SqlParameter("@lastFlushTime", (object)info.lastFlushTime); SqlParameters[10] = new SqlParameter("@isShowAll", (object)(int)(info.isShowAll ? 1 : 0)); SqlParameters[11] = new SqlParameter("@Result", SqlDbType.Int); SqlParameters[11].Direction = ParameterDirection.ReturnValue; this.db.RunProcedure("SP_ActiveSystem_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)"Init", ex); } return flag; }
public bool UpdateActiveSystem(ActiveSystemInfo info) { bool flag = false; try { SqlParameter[] SqlParameters = new SqlParameter[12] { new SqlParameter("@ID", (object) info.ID), new SqlParameter("@UserID", (object) info.UserID), new SqlParameter("@useableScore", (object) info.useableScore), new SqlParameter("@totalScore", (object) info.totalScore), new SqlParameter("@AvailTime", (object) info.AvailTime), new SqlParameter("@NickName", (object) info.NickName), new SqlParameter("@CanGetGift", (object) (int) (info.CanGetGift ? 1 : 0)), new SqlParameter("@canOpenCounts", (object) info.canOpenCounts), new SqlParameter("@canEagleEyeCounts", (object) info.canEagleEyeCounts), new SqlParameter("@lastFlushTime", (object) info.lastFlushTime), new SqlParameter("@isShowAll", (object) (int) (info.isShowAll ? 1 : 0)), new SqlParameter("@Result", SqlDbType.Int) }; SqlParameters[11].Direction = ParameterDirection.ReturnValue; this.db.RunProcedure("SP_UpdateActiveSystem", SqlParameters); flag = (int)SqlParameters[11].Value == 0; } catch (Exception ex) { if (BaseBussiness.log.IsErrorEnabled) BaseBussiness.log.Error((object)"SP_UpdateActiveSystem", ex); } return flag; }