/// <summary> /// me_是否一键除虫 /// </summary> public long Getchuchong(int usid) { StringBuilder strSql = new StringBuilder(); strSql.Append("select isinsect from tb_NC_user "); strSql.Append(" where usid=@usid "); SqlParameter[] parameters = { new SqlParameter("@usid", SqlDbType.Int, 4) }; parameters[0].Value = usid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// 得到特定房间ID和桌面table的最旧的下注时间 /// </summary> /// <param name="RoomID"></param> /// <param name="RoomDoTable"></param> /// <returns></returns> public DateTime GetMinTime(int RoomID, int RoomDoTable) { StringBuilder strSql = new StringBuilder(); //SELECT * from tb_BaccaratHistory where RoomID=16 and RoomDoTable=1 ORDER by BonusTimes ASC strSql.Append("select top(1)BonusTimes from tb_BaccaratHistory "); strSql.Append("where RoomID=@RoomID and RoomDoTable=@RoomDoTable order by BonusTimes asc"); SqlParameter[] parameters = { new SqlParameter("@RoomID", SqlDbType.Int, 4), new SqlParameter("@RoomDoTable", SqlDbType.Int, 4) }; parameters[0].Value = RoomID; parameters[1].Value = RoomDoTable; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetDateTime(0)); } else { return(DateTime.Now); } } }
/// <summary> /// 得到用 /// </summary> public int GetCounts(int Rank) { StringBuilder strSql = new StringBuilder(); strSql.Append("select GoodsCounts from tb_DrawTen "); strSql.Append(" where Rank=@Rank "); SqlParameter[] parameters = { new SqlParameter("@Rank", SqlDbType.Int, 4) }; parameters[0].Value = Rank; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// me_得到是否锁定 /// </summary> public int Get_suoding(int meid, int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select * from tb_NC_mydaoju "); strSql.Append(" where usid=@meid and name_id=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@meid", SqlDbType.Int, 4) }; parameters[0].Value = ID; parameters[1].Value = meid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { try { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } catch { return(0); } } }
/// <summary> /// me_根据期号得到奖池 /// </summary> public long GetGold_phase(int phase) { StringBuilder strSql = new StringBuilder(); strSql.Append("select TOP(1) Jackpot from tb_JQC_Jackpot where phase=@phase ORDER BY id desc"); SqlParameter[] parameters = { new SqlParameter("@phase", SqlDbType.Int, 4) }; parameters[0].Value = phase; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt64(0)); } else { return(0); } } }
/// <summary> /// me_得到道具数量 /// </summary> public int Get_daojunum2(int meid, int ID, int iszengsong) { StringBuilder strSql = new StringBuilder(); strSql.Append("select num from tb_NC_mydaoju "); strSql.Append(" where usid=@meid and huafei_id=@ID and iszengsong=@iszengsong "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@meid", SqlDbType.Int, 4), new SqlParameter("@iszengsong", SqlDbType.Int, 4) }; parameters[0].Value = ID; parameters[1].Value = meid; parameters[2].Value = iszengsong; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { try { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } catch { return(0); } } }
/// <summary> /// 得到 /// </summary> public string GetMyGoodsbynum(int Num) { StringBuilder strSql = new StringBuilder(); strSql.Append("select MyGoods from tb_DrawUser "); strSql.Append(" where Num=@Num "); SqlParameter[] parameters = { new SqlParameter("@Num", SqlDbType.Int, 4) }; parameters[0].Value = Num; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetString(0)); } else { return(null); } } }
/// <summary> /// me_得到总价钱 /// </summary> public long Get_allprice(int usid) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT SUM(num*(price_out)) as aa FROM tb_NC_GetCrop WHERE num>0 and usid=@usid and suoding=0"); SqlParameter[] parameters = { new SqlParameter("@usid", SqlDbType.Int, 4) }; parameters[0].Value = usid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); try { return(reader.GetInt64(0)); } catch { return(0); } } else { return(0); } } }
/// <summary> /// 根据号码得到你的答案 /// </summary> public string GetAnswer(int account) { StringBuilder strSql = new StringBuilder(); strSql.Append("select Answer from tb_Question "); strSql.Append(" where ID=@account "); SqlParameter[] parameters = { new SqlParameter("@account", SqlDbType.Int, 4) }; parameters[0].Value = account; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetString(0)); } else { return(""); } } }
/// <summary> /// 得到用户昵称 /// </summary> public string GetUsName(int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select UsName from tb_user "); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4) }; parameters[0].Value = ID; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetString(0)); } else { return(""); } } }
/// <summary> /// 得到第几轮奖池 /// </summary> public int Getlun() { StringBuilder strSql = new StringBuilder(); strSql.Append("select Top(1) lun from tb_DrawBox "); strSql.Append(" where lun!=0 Order by lun "); SqlParameter[] parameters = { new SqlParameter("@lun", SqlDbType.Int, 4) }; parameters[0].Value = 0; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// me_得到开庄数 /// </summary> public int Get_kz_num(int meid, int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT COUNT(*) FROM tb_BJL_Room WHERE UsID=@meid and state=@ID"); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@meid", SqlDbType.Int, 4) }; parameters[0].Value = ID; parameters[1].Value = meid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// me_得到种子数量 /// </summary> public int Get_daoju_num(int meid, int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select num from tb_NC_hecheng "); strSql.Append(" where UsID=@meid and GiftId=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@meid", SqlDbType.Int, 4) }; parameters[0].Value = ID; parameters[1].Value = meid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// 得到进行中的奖品的总余量 /// </summary> public int GetAllNumS(int lun) { StringBuilder strSql = new StringBuilder(); strSql.Append("select sum(GoodsNum) from tb_DrawBox "); strSql.Append(" where lun=@lun and Statue=0 "); SqlParameter[] parameters = { new SqlParameter("@lun", SqlDbType.Int, 4) }; parameters[0].Value = lun; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { if (lun != 0) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } else { return(0); } } }
/// <summary> /// me_根据期号得到未开奖的奖池——20160713 /// </summary> public long Getweikai_phase(int phase) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT sum(InPrize) FROM tb_JQC_Jackpot where phase=@phase"); SqlParameter[] parameters = { new SqlParameter("@phase", SqlDbType.Int, 4) }; parameters[0].Value = phase; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { try { if (reader.HasRows) { reader.Read(); return(reader.GetInt64(0)); } else { return(0); } } catch { return(0); } } }
/// <summary> /// me_根据投注ID得到奖池——20160713 /// </summary> public long Get_BetID(int BetID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select TOP(1) Jackpot from tb_JQC_Jackpot where BetID=@BetID"); SqlParameter[] parameters = { new SqlParameter("@BetID", SqlDbType.Int, 4) }; parameters[0].Value = BetID; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt64(0)); } else { return(0); } } }
/// <summary> /// me_得到道具图片路径 /// </summary> public string Get_picture(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select picture from tb_NC_daoju "); strSql.Append(" where id=@id "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetString(0)); } else { return(""); } } }
/// <summary> /// me_得到总价钱 /// </summary> public long get_usergoid(int usid) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SUM(s.num * (m.price_in/2)) from tb_NC_mydaoju s inner join tb_NC_shop m on s.name_id=m.num_id AND s.usid=@usid AND s.suoding=0"); SqlParameter[] parameters = { new SqlParameter("@usid", SqlDbType.Int, 4) }; parameters[0].Value = usid; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); try { return(reader.GetInt64(0)); } catch { return(0); } } else { return(0); } } }
/// <summary> /// 得到最低下注 /// </summary> public int GetPtype(string GameName) { StringBuilder strSql = new StringBuilder(); strSql.Append("select ptype from tb_WinnersGame "); strSql.Append(" where GameName=@GameName "); SqlParameter[] parameters = { new SqlParameter("@GameName", SqlDbType.NVarChar, 50) }; parameters[0].Value = GameName; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// 根据号码得到验证码 /// </summary> public string GetCode(string Mypmobile) { StringBuilder strSql = new StringBuilder(); strSql.Append("select code from tb_Question "); strSql.Append(" where Mobile=@Mypmobile "); SqlParameter[] parameters = { new SqlParameter("@Mypmobile", SqlDbType.NVarChar, 50) }; parameters[0].Value = Mypmobile; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetString(0)); } else { return(""); } } }
/// <summary> /// me_得到设置游戏的总个数 /// </summary> public int Get_yx() { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(*) as a FROM tb_bossrobot WHERE type=1"); using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString())) { try { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } catch { return(0); } } }
/// <summary> /// 得到签到时间 /// </summary> public DateTime getQdTime(int UsID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select QdTime from tb_DrawJifen "); strSql.Append(" where UsID=@UsID "); SqlParameter[] parameters = { new SqlParameter("@UsID", SqlDbType.Int, 4) }; parameters[0].Value = UsID; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetDateTime(0)); } else { return(DateTime.Now); } } }
/// <summary> ///得到特定房间ID和桌面table的最旧的下注时间 /// </summary> public DateTime GetMinBetTime(int RoomID, int RoomDoTable, int type) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top(1)BetDate from tb_BaccaratUserDo "); strSql.Append("where RoomID=@RoomID and RoomDoTable=@RoomDoTable and type=@type order by BetDate asc"); SqlParameter[] parameters = { new SqlParameter("@RoomID", SqlDbType.Int, 4), new SqlParameter("@RoomDoTable", SqlDbType.Int, 4), new SqlParameter("@type", SqlDbType.Int, 4) }; parameters[0].Value = RoomID; parameters[1].Value = RoomDoTable; parameters[2].Value = type; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetDateTime(0)); } else { return(DateTime.Now); } } }
/// <summary> /// me_得到用户币 /// </summary> public long GetGold(int UserID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select XK3Money from tb_SWB "); strSql.Append(" where UserID=@UserID "); SqlParameter[] parameters = { new SqlParameter("@UserID", SqlDbType.Int, 4) }; parameters[0].Value = UserID; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt64(0)); } else { return(0); } } }
/// <summary> /// me_得到签到信息 /// </summary> public BCW.farm.Model.NC_user GetSignData(int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SignTotal,SignKeep,SignTime from tb_NC_user "); strSql.Append(" where usid=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4) }; parameters[0].Value = ID; BCW.farm.Model.NC_user model = new BCW.farm.Model.NC_user(); using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); model.SignTotal = reader.GetInt32(0); model.SignKeep = reader.GetInt32(1); if (!reader.IsDBNull(2)) { model.SignTime = reader.GetDateTime(2); } return(model); } else { return(null); } } }
/// <summary> /// 得到编号取奖品类型 /// </summary> public int GetMyGoodsType(int GoodsCounts) { StringBuilder strSql = new StringBuilder(); strSql.Append("select MyGoodsType from tb_DrawUser "); strSql.Append(" where GoodsCounts=@GoodsCounts "); SqlParameter[] parameters = { new SqlParameter("@GoodsCounts", SqlDbType.Int, 4) }; parameters[0].Value = GoodsCounts; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> ///me_得到特定房间ID和桌面table的最旧的下注时间 /// </summary> public DateTime GetMinBetTime(int RoomID, int Play_Table) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top(1)updatetime from tb_BJL_Play "); strSql.Append("where RoomID=@RoomID and Play_Table=@Play_Table order by updatetime ASC"); SqlParameter[] parameters = { new SqlParameter("@RoomID", SqlDbType.Int, 4), new SqlParameter("@Play_Table", SqlDbType.Int, 4) }; parameters[0].Value = RoomID; parameters[1].Value = Play_Table; using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); return(reader.GetDateTime(0)); } else { return(DateTime.Now); } } }
/// <summary> ///me_后台奖池查询——20160808 /// </summary> public int Get_oldID2() { StringBuilder strSql = new StringBuilder(); strSql.Append("select TOP(1) phase from tb_JQC_Internet where phase!='' and Result!='' order by id desc"); using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString())) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// me_得到系统回收的次数 /// </summary> public int Getxitong_huishou() { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT COUNT(*) FROM tb_JQC_Jackpot WHERE type=4 AND OutPrize>0"); using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString())) { if (reader.HasRows) { reader.Read(); return(reader.GetInt32(0)); } else { return(0); } } }
/// <summary> /// me_根据id得到奖池 /// </summary> public long GetGold() { StringBuilder strSql = new StringBuilder(); strSql.Append("select TOP(1) Jackpot from tb_JQC_Jackpot "); strSql.Append(" ORDER BY ID desc "); using (SqlDataReader reader = SqlHelperUser.ExecuteReader(strSql.ToString())) { if (reader.HasRows) { reader.Read(); return(reader.GetInt64(0)); } else { return(0); } } }