/// <summary> /// 更新平盘业务 /// </summary> /// <param name="model"></param> /// <returns></returns> public void UpdatePPCase(TPR.Model.guess.BaPay model) { //更新此记录得到的币 StringBuilder strSql = new StringBuilder(); strSql.Append("update tb_BaPay set "); strSql.Append("p_getMoney=@p_getMoney,"); strSql.Append("p_case=@p_case,"); strSql.Append("p_result_one=@p_result_one,"); strSql.Append("p_result_two=@p_result_two,"); strSql.Append("p_active=@p_active"); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@p_getMoney", SqlDbType.Money, 8), new SqlParameter("@p_case", SqlDbType.Int, 4), new SqlParameter("@p_result_one", SqlDbType.Int, 4), new SqlParameter("@p_result_two", SqlDbType.Int, 4), new SqlParameter("@p_active", SqlDbType.Int, 4) }; parameters[0].Value = model.ID; parameters[1].Value = model.p_getMoney; parameters[2].Value = 0; parameters[3].Value = model.p_result_one; parameters[4].Value = model.p_result_two; parameters[5].Value = model.p_active; SqlHelper.ExecuteSql(strSql.ToString(), parameters); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TPR.Model.guess.BaPay model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into tb_BaPay("); strSql.Append("payview,payusid,payusname,bcid,pType,PayType,payCent,payonLuone,payonLutwo,payonLuthr,p_pk,p_dx_pk,p_pn,paytimes,p_result_temp1,p_result_temp2,itypes,types)"); strSql.Append(" values ("); strSql.Append("@payview,@payusid,@payusname,@bcid,@pType,@PayType,@payCent,@payonLuone,@payonLutwo,@payonLuthr,@p_pk,@p_dx_pk,@p_pn,@paytimes,@p_result_temp1,@p_result_temp2,@itypes,@types)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@payview", SqlDbType.NVarChar, 500), new SqlParameter("@payusid", SqlDbType.Int, 4), new SqlParameter("@payusname", SqlDbType.NVarChar, 500), new SqlParameter("@bcid", SqlDbType.Int, 4), new SqlParameter("@pType", SqlDbType.Int, 4), new SqlParameter("@PayType", SqlDbType.Int, 4), new SqlParameter("@payCent", SqlDbType.Money, 8), new SqlParameter("@payonLuone", SqlDbType.Money, 8), new SqlParameter("@payonLutwo", SqlDbType.Money, 8), new SqlParameter("@payonLuthr", SqlDbType.Money, 8), new SqlParameter("@p_pk", SqlDbType.Money, 8), new SqlParameter("@p_dx_pk", SqlDbType.Money, 8), new SqlParameter("@p_pn", SqlDbType.Int, 4), new SqlParameter("@paytimes", SqlDbType.DateTime), new SqlParameter("@p_result_temp1", SqlDbType.Int, 4), new SqlParameter("@p_result_temp2", SqlDbType.Int, 4), new SqlParameter("@itypes", SqlDbType.Int, 4), new SqlParameter("@types", SqlDbType.Int, 4) }; parameters[0].Value = model.payview; parameters[1].Value = model.payusid; parameters[2].Value = model.payusname; parameters[3].Value = model.bcid; parameters[4].Value = model.pType; parameters[5].Value = model.PayType; parameters[6].Value = model.payCent; parameters[7].Value = model.payonLuone; parameters[8].Value = model.payonLutwo; parameters[9].Value = model.payonLuthr; parameters[10].Value = model.p_pk; parameters[11].Value = model.p_dx_pk; parameters[12].Value = model.p_pn; parameters[13].Value = model.paytimes; parameters[14].Value = model.p_result_temp1; parameters[15].Value = model.p_result_temp2; parameters[16].Value = model.itypes; parameters[17].Value = model.Types; object obj = SqlHelper.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 更新开奖业务 /// </summary> /// <param name="model"></param> /// <param name="p_strVal"></param> /// <returns></returns> public void UpdateCase(TPR.Model.guess.BaPay model, string p_strVal, out decimal p_intDuVal, out int p_intWin) { string[] strVal = { }; decimal duVal = 0; if (!string.IsNullOrEmpty(p_strVal)) { strVal = p_strVal.Split("|".ToCharArray()); duVal = Convert.ToDecimal(strVal[0]); p_intWin = 1; p_intDuVal = duVal; } else { p_intWin = 0; p_intDuVal = 0; } //更新此记录得到的币 StringBuilder strSql = new StringBuilder(); strSql.Append("update tb_BaPay set "); strSql.Append("p_getMoney=@p_getMoney,"); strSql.Append("p_case=@p_case,"); strSql.Append("p_result_one=@p_result_one,"); strSql.Append("p_result_two=@p_result_two,"); strSql.Append("p_active=@p_active"); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@p_getMoney", SqlDbType.Money, 8), new SqlParameter("@p_case", SqlDbType.Int, 4), new SqlParameter("@p_result_one", SqlDbType.Int, 4), new SqlParameter("@p_result_two", SqlDbType.Int, 4), new SqlParameter("@p_active", SqlDbType.Int, 4) }; parameters[0].Value = model.ID; parameters[1].Value = duVal; parameters[2].Value = 0; parameters[3].Value = model.p_result_one; parameters[4].Value = model.p_result_two; parameters[5].Value = model.p_active; SqlHelper.ExecuteSql(strSql.ToString(), parameters); }
/// <summary> /// 得到一个对象实体 /// </summary> public TPR.Model.guess.BaPay GetModelIsCase(int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 ID,payview,p_getMoney,pType,bcid from tb_BaPay "); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4) }; parameters[0].Value = ID; TPR.Model.guess.BaPay model = new TPR.Model.guess.BaPay(); DataSet ds = SqlHelper.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["ID"].ToString() != "") { model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); } model.payview = ds.Tables[0].Rows[0]["payview"].ToString(); if (ds.Tables[0].Rows[0]["p_getMoney"].ToString() != "") { model.p_getMoney = decimal.Parse(ds.Tables[0].Rows[0]["p_getMoney"].ToString()); } if (ds.Tables[0].Rows[0]["pType"].ToString() != "") { model.pType = int.Parse(ds.Tables[0].Rows[0]["pType"].ToString()); } if (ds.Tables[0].Rows[0]["bcid"].ToString() != "") { model.bcid = int.Parse(ds.Tables[0].Rows[0]["bcid"].ToString()); } return(model); } else { return(null); } }
public static string getLqdxCase(TPR.Model.guess.BaPay model) { string strVal = ""; /*---------------------------大小盘----------------------------------------------*/ if (model.p_result_one + model.p_result_two - model.p_dx_pk == 0) { strVal = model.payCent + "|平盘";//平盘 } else if ((model.p_result_one + model.p_result_two) - model.p_dx_pk > 0 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if ((model.p_result_one + model.p_result_two) - model.p_dx_pk < 0 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } /*-------------------------------------------------------------------------------*/ return(strVal); }
/// <summary> /// 篮球让球逻辑类 /// </summary> /// <param name="model"></param> /// <returns></returns> public static string getLqsxCase(TPR.Model.guess.BaPay model) { string strVal = ""; /*---------------------------让球盘----------------------------------------------*/ if (model.p_result_one - model.p_result_two == model.p_pk) { strVal = model.payCent + "|平盘";//平盘 } else if ((model.p_result_one - model.p_result_two) - model.p_pk > 0 && model.PayType == 1) { strVal = model.payCent * model.payonLuone + "|全赢";//上盘全赢 } else if ((model.p_result_one - model.p_result_two) - model.p_pk < 0 && model.PayType == 2) { strVal = model.payCent * model.payonLutwo + "|全赢";//下盘全赢 } /*--------------------------------------------------------------------------------*/ return(strVal); }
/// <summary> /// 标准盘逻辑类 /// </summary> /// <param name="model"></param> /// <returns></returns> public static string getZqbzCase(TPR.Model.guess.BaPay model) { string strVal = ""; int intone, inttwo; intone = Convert.ToInt32(model.p_result_one); inttwo = Convert.ToInt32(model.p_result_two); /*---------------------------标准欧盘----------------------------------------------*/ if (intone > inttwo && model.PayType == 5) { strVal = model.payCent * model.payonLuone + "|全赢";//主胜全赢 } if (intone == inttwo && model.PayType == 6) { strVal = model.payCent * model.payonLutwo + "|全赢";//平手全赢 } if (intone < inttwo && model.PayType == 7) { strVal = model.payCent * model.payonLuthr + "|全赢";//客胜全赢 } /*---------------------------标准欧盘----------------------------------------------*/ return(strVal); }
/// <summary> /// 得到一个对象实体 /// </summary> public TPR.Model.guess.BaPay GetModel(int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 pType,PayType,payCent,payonLuone,payonLutwo,payonLuthr,p_pk,p_dx_pk,p_pn,paytimes from tb_BaPay "); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4) }; parameters[0].Value = ID; TPR.Model.guess.BaPay model = new TPR.Model.guess.BaPay(); using (SqlDataReader reader = SqlHelper.ExecuteReader(strSql.ToString(), parameters)) { if (reader.HasRows) { reader.Read(); model.pType = reader.GetInt32(0); model.PayType = reader.GetInt32(1); model.payCent = reader.GetDecimal(2); model.payonLuone = reader.GetDecimal(3); model.payonLutwo = reader.GetDecimal(4); model.payonLuthr = reader.GetDecimal(5); model.p_pk = reader.GetDecimal(6); model.p_dx_pk = reader.GetDecimal(7); model.p_pn = reader.GetInt32(8); model.paytimes = reader.GetDateTime(9); return(model); } else { return(null); } } }
/// <summary> /// 大小盘逻辑类 /// </summary> /// <param name="model"></param> /// <returns></returns> public static string getZqdxCase(TPR.Model.guess.BaPay model) { string strVal = ""; int intone, inttwo; intone = Convert.ToInt32(model.p_result_one); inttwo = Convert.ToInt32(model.p_result_two); /*---------------------------0.5/1.0----------------------------------------------*/ if (model.p_dx_pk == 21) { if (intone + inttwo == 1 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 1 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 2 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 0 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------1.0/1.5----------------------------------------------*/ else if (model.p_dx_pk == 23) { if (intone + inttwo == 1 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 1 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 2 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 0 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------1.5/2.0----------------------------------------------*/ else if (model.p_dx_pk == 2) { if (intone + inttwo == 2 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 2 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 3 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 1 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------2.0/2.5----------------------------------------------*/ else if (model.p_dx_pk == 4) { if (intone + inttwo == 2 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 2 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 3 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 1 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------2.5/3.0----------------------------------------------*/ else if (model.p_dx_pk == 6) { if (intone + inttwo == 3 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 3 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 4 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 2 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------3.0/3.5----------------------------------------------*/ else if (model.p_dx_pk == 8) { if (intone + inttwo == 3 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 3 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 4 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 2 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------3.5/4.0----------------------------------------------*/ else if (model.p_dx_pk == 10) { if (intone + inttwo == 4 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 4 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 5 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 3 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------4.0/4.5----------------------------------------------*/ else if (model.p_dx_pk == 12) { if (intone + inttwo == 4 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 4 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 5 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 3 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------4.5/5.0----------------------------------------------*/ else if (model.p_dx_pk == 14) { if (intone + inttwo == 5 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 5 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 6 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 4 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------5.0/5.5----------------------------------------------*/ else if (model.p_dx_pk == 16) { if (intone + inttwo == 5 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 5 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 6 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 4 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------5.5/6.0----------------------------------------------*/ else if (model.p_dx_pk == 18) { if (intone + inttwo == 6 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 6 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 7 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 5 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------6.0/6.5----------------------------------------------*/ else if (model.p_dx_pk == 24) { if (intone + inttwo == 6 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 6 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 7 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 5 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------6.5/7.0----------------------------------------------*/ else if (model.p_dx_pk == 26) { if (intone + inttwo == 7 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 7 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 8 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 6 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------7.0/7.5----------------------------------------------*/ else if (model.p_dx_pk == 28) { if (intone + inttwo == 7 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 7 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 8 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 6 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------7.5/8.0----------------------------------------------*/ else if (model.p_dx_pk == 30) { if (intone + inttwo == 8 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 8 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 9 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 7 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------8.0/8.5----------------------------------------------*/ else if (model.p_dx_pk == 32) { if (intone + inttwo == 8 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 8 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 9 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 7 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------8.5/9.0----------------------------------------------*/ else if (model.p_dx_pk == 34) { if (intone + inttwo == 9 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 9 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 10 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 8 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------9.0/9.5----------------------------------------------*/ else if (model.p_dx_pk == 36) { if (intone + inttwo == 8 && model.PayType == 3) { strVal = model.payCent / 2 + "|输半";//大盘输半 } else if (intone + inttwo == 9 && model.PayType == 4) { strVal = (model.payCent * model.payonLutwo - model.payCent) / 2 + model.payCent + "|赢半";//小盘赢半 } else if (intone + inttwo >= 10 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 8 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------9.5/10.0----------------------------------------------*/ else if (model.p_dx_pk == 38) { if (intone + inttwo == 10 && model.PayType == 3) { strVal = (model.payCent * model.payonLuone - model.payCent) / 2 + model.payCent + "|赢半";//大盘赢半 } else if (intone + inttwo == 10 && model.PayType == 4) { strVal = model.payCent / 2 + "|输半";//小盘输半 } else if (intone + inttwo >= 11 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo <= 9 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------大小盘单盘口----------------------------------------------*/ else { decimal dx_pk = Convert.ToDecimal(GCK.getDxPkName(Convert.ToInt32(model.p_dx_pk))); if (intone + inttwo - dx_pk == 0) { strVal = model.payCent + "|平盘";//平盘 } else if (intone + inttwo - dx_pk > 0 && model.PayType == 3) { strVal = model.payCent * model.payonLuone + "|全赢";//大盘全赢 } else if (intone + inttwo - dx_pk < 0 && model.PayType == 4) { strVal = model.payCent * model.payonLutwo + "|全赢";//小盘全赢 } } /*-------------------------------------------------------------------------*/ return(strVal); }
/// <summary> /// 让球盘逻辑类 //p_pk 让受球盘口 //p_dx_pk 大小球盘口 //p_pn 让或者受让 //p_result_one 结果1 //p_result_two 结果2 //payType 会员选择上下,大小,标准盘 //payCent 本金 //payonLuone 赔率1 //payonLutwo 赔率2 //payonLuthr 赔率3 /// <param name="model"></param> /// <returns></returns> public static string getZqsxCase(TPR.Model.guess.BaPay model) { string strVal = ""; int intone, inttwo, iTypeone, iTypetwo; decimal iTypeonelu, iTypetwolu; if (model.p_pn == 1) {//让 iTypeone = 1; iTypetwo = 2; iTypeonelu = Convert.ToDecimal(model.payonLuone); iTypetwolu = Convert.ToDecimal(model.payonLutwo); intone = Convert.ToInt32(model.p_result_one); inttwo = Convert.ToInt32(model.p_result_two); } else {//受让 iTypeone = 2; iTypetwo = 1; iTypeonelu = Convert.ToDecimal(model.payonLutwo); iTypetwolu = Convert.ToDecimal(model.payonLuone); intone = Convert.ToInt32(model.p_result_two); inttwo = Convert.ToInt32(model.p_result_one); } /*---------------------------平手----------------------------------------------*/ if (model.p_pk == 1) { if (intone == inttwo) { strVal = model.payCent + "|平盘";//平盘 } else if (intone > inttwo && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘赢盘 } else if (intone < inttwo && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘赢盘 } } /*-------------------------------------------------------------------------*/ /*---------------------------平手/半球----------------------------------------------*/ else if (model.p_pk == 2) { if (intone == inttwo && model.PayType == iTypeone) { strVal = model.payCent / 2 + "|输半";//上盘输半 } else if (intone == inttwo && model.PayType == iTypetwo) { strVal = (model.payCent * iTypetwolu - model.payCent) / 2 + model.payCent + "|赢半";//下盘赢半 } else if (intone - inttwo >= 1 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (inttwo - intone >= 0 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------半球----------------------------------------------*/ else if (model.p_pk == 3) { if (intone - inttwo >= 1 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo < 1 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------半球/一球----------------------------------------------*/ else if (model.p_pk == 4) { if (intone - inttwo == 1 && model.PayType == iTypeone) { strVal = (model.payCent * iTypeonelu - model.payCent) / 2 + model.payCent + "|赢半";//上盘赢半 } else if (intone - inttwo == 1 && model.PayType == iTypetwo) { strVal = model.payCent / 2 + "|输半";//下盘输半 } else if (intone - inttwo >= 2 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (inttwo - intone >= 0 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 一球----------------------------------------------*/ else if (model.p_pk == 5) { if (intone - inttwo == 1) { strVal = model.payCent + "|平盘";//平盘 } else if (intone - inttwo >= 2 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo < 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 一球/球半----------------------------------------------*/ else if (model.p_pk == 6) { if (intone - inttwo == 1 && model.PayType == iTypeone) { strVal = model.payCent / 2 + "|输半";//上盘输半 } else if (intone - inttwo == 1 && model.PayType == iTypetwo) { strVal = (model.payCent * iTypetwolu - model.payCent) / 2 + model.payCent + "|赢半";//下盘赢半 } else if (intone - inttwo >= 2 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 1 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------球半----------------------------------------------*/ else if (model.p_pk == 7) { if (intone - inttwo >= 2 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo < 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------球半/二球----------------------------------------------*/ else if (model.p_pk == 8) { if (intone - inttwo == 2 && model.PayType == iTypeone) { strVal = (model.payCent * iTypeonelu - model.payCent) / 2 + model.payCent + "|赢半";//上盘赢半 } else if (intone - inttwo == 2 && model.PayType == iTypetwo) { strVal = model.payCent / 2 + "|输半";//下盘输半 } else if (intone - inttwo >= 3 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 1 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 二球----------------------------------------------*/ else if (model.p_pk == 9) { if (intone - inttwo == 2) { strVal = model.payCent + "|平盘";//平盘 } else if (intone - inttwo >= 3 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 1 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 二球/二球半----------------------------------------------*/ else if (model.p_pk == 10) { if (intone - inttwo == 2 && model.PayType == iTypeone) { strVal = model.payCent / 2 + "|输半";//上盘输半 } else if (intone - inttwo == 2 && model.PayType == iTypetwo) { strVal = (model.payCent * iTypetwolu - model.payCent) / 2 + model.payCent + "|赢半";//下盘赢半 } else if (intone - inttwo >= 3 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 1 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------二球半----------------------------------------------*/ else if (model.p_pk == 11) { if (intone - inttwo >= 3 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------二球半/三球----------------------------------------------*/ else if (model.p_pk == 12) { if (intone - inttwo == 3 && model.PayType == iTypeone) { strVal = (model.payCent * iTypeonelu - model.payCent) / 2 + model.payCent + "|赢半";//上盘赢半 } else if (intone - inttwo == 3 && model.PayType == iTypetwo) { strVal = model.payCent / 2 + "|输半";//下盘输半 } else if (intone - inttwo >= 4 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 三球----------------------------------------------*/ else if (model.p_pk == 13) { if (intone - inttwo == 3) { strVal = model.payCent + "|平盘";//平盘 } else if (intone - inttwo >= 4 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 三球/三球半----------------------------------------------*/ else if (model.p_pk == 14) { if (intone - inttwo == 3 && model.PayType == iTypeone) { strVal = model.payCent / 2 + "|输半";//上盘输半 } else if (intone - inttwo == 3 && model.PayType == iTypetwo) { strVal = (model.payCent * iTypetwolu - model.payCent) / 2 + model.payCent + "|赢半";//下盘赢半 } else if (intone - inttwo >= 4 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 2 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------三球半----------------------------------------------*/ else if (model.p_pk == 15) { if (intone - inttwo >= 4 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 3 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------三球半/四球----------------------------------------------*/ else if (model.p_pk == 16) { if (intone - inttwo == 4 && model.PayType == iTypeone) { strVal = (model.payCent * iTypeonelu - model.payCent) / 2 + model.payCent + "|赢半";//上盘赢半 } else if (intone - inttwo == 4 && model.PayType == iTypetwo) { strVal = model.payCent / 2 + "|输半";//下盘输半 } else if (intone - inttwo >= 5 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 3 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 四球----------------------------------------------*/ else if (model.p_pk == 17) { if (intone - inttwo == 4) { strVal = model.payCent + "|平盘";//平盘 } else if (intone - inttwo >= 5 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 3 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 四球/四球半----------------------------------------------*/ else if (model.p_pk == 18) { if (intone - inttwo == 4 && model.PayType == iTypeone) { strVal = model.payCent / 2 + "|输半";//上盘输半 } else if (intone - inttwo == 4 && model.PayType == iTypetwo) { strVal = (model.payCent * iTypetwolu - model.payCent) / 2 + model.payCent + "|赢半";//下盘赢半 } else if (intone - inttwo >= 5 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 3 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------四球半----------------------------------------------*/ else if (model.p_pk == 19) { if (intone - inttwo >= 5 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 4 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*---------------------------四球半/五球----------------------------------------------*/ else if (model.p_pk == 20) { if (intone - inttwo == 5 && model.PayType == iTypeone) { strVal = (model.payCent * iTypeonelu - model.payCent) / 2 + model.payCent + "|赢半";//上盘赢半 } else if (intone - inttwo == 5 && model.PayType == iTypetwo) { strVal = model.payCent / 2 + "|输半";//下盘输半 } else if (intone - inttwo >= 6 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 4 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ /*--------------------------- 五球----------------------------------------------*/ else if (model.p_pk == 21) { if (intone - inttwo == 5) { strVal = model.payCent + "|平盘";//平盘 } else if (intone - inttwo >= 6 && model.PayType == iTypeone) { strVal = model.payCent * iTypeonelu + "|全赢";//上盘全赢 } else if (intone - inttwo <= 4 && model.PayType == iTypetwo) { strVal = model.payCent * iTypetwolu + "|全赢";//下盘全赢 } } /*-------------------------------------------------------------------------*/ return(strVal); }
/// <summary> /// 取得详细排行榜记录 /// </summary> /// <param name="p_pageIndex">当前页</param> /// <param name="p_pageSize">分页大小</param> /// <param name="p_recordCount">返回总记录数</param> /// <returns>IList BaPayTop</returns> public IList <TPR.Model.guess.BaPay> GetBaPayTop(int p_pageIndex, int p_pageSize, string strWhere, int itype, out int p_recordCount) { IList <TPR.Model.guess.BaPay> listBaPayTop = new List <TPR.Model.guess.BaPay>(); if (strWhere != "") { strWhere = strWhere + " and itypes=0 and Types=0"; } else { strWhere = "itypes=0 and Types=0"; } // 计算记录数 string countString = "SELECT COUNT(DISTINCT payusid) FROM tb_BaPay where " + strWhere + ""; p_recordCount = Convert.ToInt32(SqlHelper.GetSingle(countString)); if (p_recordCount > 0) { int pageCount = BasePage.CalcPageCount(p_recordCount, p_pageSize, ref p_pageIndex); } else { return(listBaPayTop); } // 取出相关记录 string queryString = ""; if (itype != 1) { queryString = "SELECT payusid,count(payusid) as payCount,sum(payCent) as payCents FROM tb_BaPay where " + strWhere + " group by payusid Order by Count(ID) desc"; } else { queryString = "SELECT payusid,sum(p_getMoney-payCent) as payCents FROM tb_BaPay where " + strWhere + " group by payusid Order by sum(p_getMoney-payCent) desc"; } using (SqlDataReader reader = SqlHelper.ExecuteReader(queryString)) { int stratIndex = (p_pageIndex - 1) * p_pageSize; int endIndex = p_pageIndex * p_pageSize; int k = 0; while (reader.Read()) { if (k >= stratIndex && k < endIndex) { TPR.Model.guess.BaPay objBaPay = new TPR.Model.guess.BaPay(); objBaPay.payusid = reader.GetInt32(0); if (itype != 1) { objBaPay.payCount = Convert.ToDecimal(reader.GetInt32(1)); } else { objBaPay.payCount = reader.GetDecimal(1); } listBaPayTop.Add(objBaPay); } if (k == endIndex) { break; } k++; } } return(listBaPayTop); }
/// <summary> /// 取得每页记录 /// </summary> /// <param name="p_pageIndex">当前页</param> /// <param name="p_pageSize">分页大小</param> /// <param name="p_recordCount">返回总记录数</param> /// <returns>IList BaPay</returns> public IList <TPR.Model.guess.BaPay> GetBaPays(int p_pageIndex, int p_pageSize, string strWhere, out int p_recordCount) { IList <TPR.Model.guess.BaPay> listBaPays = new List <TPR.Model.guess.BaPay>(); string sTable = "tb_BaPay"; string sPkey = "id"; string sField = "id,payview,payusid,payusname,pType,PayType,payCent,payonLuone,payonLutwo,payonLuthr,p_pk,p_dx_pk,p_pn,p_result_one,p_result_two,p_getMoney,paytimes,p_active,p_result_temp1,p_result_temp2,itypes,types"; string sCondition = strWhere; string sOrder = "id desc"; int iSCounts = 0; using (SqlDataReader reader = SqlHelper.RunProcedureMe(sTable, sPkey, sField, p_pageIndex, p_pageSize, sCondition, sOrder, iSCounts, out p_recordCount)) { //计算总页数 if (p_recordCount > 0) { int pageCount = BasePage.CalcPageCount(p_recordCount, p_pageSize, ref p_pageIndex); } else { return(listBaPays); } while (reader.Read()) { TPR.Model.guess.BaPay objBaPay = new TPR.Model.guess.BaPay(); objBaPay.ID = reader.GetInt32(0); objBaPay.payview = reader.GetString(1); objBaPay.payusid = reader.GetInt32(2); objBaPay.payusname = reader.GetString(3); objBaPay.pType = reader.GetInt32(4); objBaPay.PayType = reader.GetInt32(5); objBaPay.payCent = reader.GetDecimal(6); objBaPay.payonLuone = reader.GetDecimal(7); objBaPay.payonLutwo = reader.GetDecimal(8); objBaPay.payonLuthr = reader.GetDecimal(9); objBaPay.p_pk = reader.GetDecimal(10); objBaPay.p_dx_pk = reader.GetDecimal(11); objBaPay.p_pn = reader.GetInt32(12); if (reader.IsDBNull(13)) { objBaPay.p_result_one = null; } else { objBaPay.p_result_one = reader.GetInt32(13); } if (reader.IsDBNull(14)) { objBaPay.p_result_two = null; } else { objBaPay.p_result_two = reader.GetInt32(14); } objBaPay.p_getMoney = reader.GetDecimal(15); objBaPay.paytimes = reader.GetDateTime(16); objBaPay.p_active = reader.GetInt32(17); if (reader.IsDBNull(18)) { objBaPay.p_result_temp1 = null; } else { objBaPay.p_result_temp1 = reader.GetInt32(18); } if (reader.IsDBNull(19)) { objBaPay.p_result_temp2 = null; } else { objBaPay.p_result_temp2 = reader.GetInt32(19); } objBaPay.itypes = reader.GetInt32(20); objBaPay.Types = reader.GetInt32(21); listBaPays.Add(objBaPay); } } return(listBaPays); }