DAL/LotteryJoinUserService.cs

(开头部分) 14KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;

namespace DAL
{
	/// <summary>
	/// 数据访问类:LotteryJoinUserService
	/// </summary>
	public partial class LotteryJoinUserService
	{
		public LotteryJoinUserService()
		{}
		#region  BasicMethod
        /// <summary>
        /// 更新中奖信息
        /// </summary>
        /// <param name="productId">活动ID</param>
        /// <param name="num">中奖颜色1黑,2白</param>
        /// <returns></returns>
        public static int Update(int type,object productId,int num) 
        {
            if(num == 1)
            {
                string sql = "update LotteryJoinUser set rightAnswer = " + num + ",status = 1,isRight = " + num + " where productId = " + productId + " and selAnswer = 1 and typeId = " + type;
                DBHelperSQL.ExecuteSql(sql);
                sql = "update LotteryJoinUser set rightAnswer = " + num + ",status = 1,isRight = 2 where productId = " + productId + " and selAnswer = 2 and typeId = " + type;
                return DBHelperSQL.ExecuteSql(sql);
            }else{
                string sql = "update LotteryJoinUser set rightAnswer = " + num + ",status = 1,isRight = 2 where productId = " + productId + " and selAnswer = 1 and typeId = " + type;
                DBHelperSQL.ExecuteSql(sql);
                sql = "update LotteryJoinUser set rightAnswer = " + num + ",status = 1,isRight = 1 where productId = " + productId + " and selAnswer = 2 and typeId = " + type;
                return DBHelperSQL.ExecuteSql(sql);
            }
            
        }

        /// <summary>
        /// 获取抽奖颜色数量
        /// </summary>
        /// <param name="id"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public static int GetCount(int type,object id,int num) 
        {
            string sql = "select count(id) from LotteryJoinUser where typeId = " + type + " and productId = " + id + " and selAnswer = " + num;
            object obj = DBHelperSQL.GetSingle(sql);
            if(obj != null)
            {
                return Convert.ToInt32(obj);
            }
            return 0;
        }
		/// <summary>
		/// 是否存在该记录
		/// </summary>
        public static bool Exists(Model.LotteryJoinUser model)
		{
			StringBuilder strSql=new StringBuilder();
后面还有 386 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。