예제 #1
0
        public static bool Checking(DataRow row, string LotteryNumber, SqlCommand sqlCommand)
        {
            bool result;

            try
            {
                if (Convert.ToInt32(row["State"]) != 0)
                {
                    result = true;
                }
                else
                {
                    int     logSysId  = Convert.ToInt32(row["Id"]);
                    string  ssId      = row["SsId"].ToString();
                    int     num       = Convert.ToInt32(row["UserId"]);
                    int     num2      = Convert.ToInt32(row["LotteryId"]);
                    int     num3      = Convert.ToInt32(row["PlayId"]);
                    int     value     = Convert.ToInt32(row["Num"]);
                    string  arg       = row["IssueNum"].ToString();
                    string  betDetail = BetDetailDAL.GetBetDetail2(Convert.ToDateTime(row["STime2"]).ToString("yyyyMMdd"), num.ToString(), logSysId.ToString());
                    decimal d         = Convert.ToDecimal(row["Total"]);
                    decimal num4      = Convert.ToDecimal(row["point"]);
                    decimal num5      = Convert.ToDecimal(row["PointMoney"]);
                    decimal num6      = Convert.ToDecimal(row["Bonus"]);
                    decimal d2        = Convert.ToDecimal(row["Times"]);
                    decimal d3        = Convert.ToDecimal(row["SingleMoney"]);
                    string  pos       = row["Pos"].ToString();
                    string  text      = row["PlayCode"].ToString();
                    Convert.ToInt32(row["IsCheat"]);
                    Convert.ToInt32(row["IsDelay"]);
                    int      num7  = Convert.ToInt32(row["ZhId"]);
                    string   sTime = row["STime"].ToString();
                    string[] array = LotteryNumber.Split(new char[]
                    {
                        ','
                    });
                    if (text.Equals("P_5QJ3"))
                    {
                        string[] array2 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array2[0].IndexOf(CheckOperation.ReplaceStr(array[0])) == -1 || array2[1].IndexOf(CheckOperation.ReplaceStr(array[1])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_5QJ3'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_5QJ3", "P_5QJ3_2");
                        }
                        else
                        {
                            text = text.Replace("P_5QJ3", "P_5QJ3_1");
                        }
                    }
                    if (text.Equals("P_4QJ3"))
                    {
                        string[] array3 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array3[0].IndexOf(CheckOperation.ReplaceStr(array[1])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_4QJ3'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_4QJ3", "P_4QJ3_2");
                        }
                        else
                        {
                            text = text.Replace("P_4QJ3", "P_4QJ3_1");
                        }
                    }
                    if (text.Equals("P_3QJ2_L"))
                    {
                        string[] array4 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array4[0].IndexOf(CheckOperation.ReplaceStr(array[0])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_3QJ2_L'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_3QJ2_L", "P_3QJ2_L_2");
                        }
                        else
                        {
                            text = text.Replace("P_3QJ2_L", "P_3QJ2_L_1");
                        }
                    }
                    if (text.Equals("P_3QJ2_R"))
                    {
                        string[] array5 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array5[0].IndexOf(CheckOperation.ReplaceStr(array[2])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_3QJ2_R'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_3QJ2_R", "P_3QJ2_R_2");
                        }
                        else
                        {
                            text = text.Replace("P_3QJ2_R", "P_3QJ2_R_1");
                        }
                    }
                    if (text.Equals("P_5QW3"))
                    {
                        string[] array6 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array6[0].IndexOf(CheckOperation.ReplaceDX(array[0])) == -1 || array6[1].IndexOf(CheckOperation.ReplaceDX(array[1])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_5QW3'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_5QW3", "P_5QW3_2");
                        }
                        else
                        {
                            text = text.Replace("P_5QW3", "P_5QW3_1");
                        }
                    }
                    if (text.Equals("P_4QW3"))
                    {
                        string[] array7 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array7[0].IndexOf(CheckOperation.ReplaceDX(array[1])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_4QW3'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_4QW3", "P_4QW3_2");
                        }
                        else
                        {
                            text = text.Replace("P_4QW3", "P_4QW3_1");
                        }
                    }
                    if (text.Equals("P_3QW2_L"))
                    {
                        string[] array8 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array8[0].IndexOf(CheckOperation.ReplaceDX(array[0])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_3QW2_L'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_3QW2_L", "P_3QW2_L_2");
                        }
                        else
                        {
                            text = text.Replace("P_3QW2_L", "P_3QW2_L_1");
                        }
                    }
                    if (text.Equals("P_3QW2_R"))
                    {
                        string[] array9 = betDetail.Split(new char[]
                        {
                            ','
                        });
                        if (array9[0].IndexOf(CheckOperation.ReplaceDX(array[2])) == -1)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Concat(new object[]
                            {
                                "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=",
                                num,
                                ")-",
                                num4,
                                ") from Sys_PlaySmallType where title2='P_3QW2_R'"
                            });
                            num6 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                            text = text.Replace("P_3QW2_R", "P_3QW2_R_2");
                        }
                        else
                        {
                            text = text.Replace("P_3QW2_R", "P_3QW2_R_1");
                        }
                    }
                    if (text.Equals("P_3ZBD_L"))
                    {
                        if (array[0] == array[1] || array[1] == array[2] || array[0] == array[2])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("P_3ZBD_C"))
                    {
                        if (array[1] == array[2] || array[2] == array[3] || array[1] == array[3])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("P_3ZBD_R"))
                    {
                        if (array[2] == array[3] || array[3] == array[4] || array[2] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[2] != array[3] && array[3] != array[4] && array[2] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WQB"))
                    {
                        if (array[0] == array[1] || array[1] == array[2] || array[0] == array[2])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WQS"))
                    {
                        if (array[0] == array[1] || array[1] == array[3] || array[0] == array[3])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[1] && array[1] != array[3] && array[0] != array[3])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WQG"))
                    {
                        if (array[0] == array[1] || array[1] == array[4] || array[0] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[1] && array[1] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WBS"))
                    {
                        if (array[0] == array[2] || array[2] == array[3] || array[0] == array[3])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[2] && array[2] != array[3] && array[0] != array[3])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WBG"))
                    {
                        if (array[0] == array[2] || array[2] == array[4] || array[0] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[2] && array[2] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_WSG"))
                    {
                        if (array[0] == array[3] || array[3] == array[4] || array[0] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[0] != array[3] && array[3] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_QBS"))
                    {
                        if (array[1] == array[2] || array[2] == array[3] || array[1] == array[3])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_QBG"))
                    {
                        if (array[1] == array[2] || array[2] == array[4] || array[1] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[1] != array[2] && array[2] != array[4] && array[1] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_QSG"))
                    {
                        if (array[1] == array[3] || array[3] == array[4] || array[1] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[1] != array[3] && array[3] != array[4] && array[1] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("R_3ZBD_BSG"))
                    {
                        if (array[2] == array[3] || array[3] == array[4] || array[2] == array[4])
                        {
                            text = text.Replace("3ZBD", "3ZBDZ3");
                        }
                        if (array[2] != array[3] && array[3] != array[4] && array[2] != array[4])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3ZBD", "3ZBDZ6");
                        }
                    }
                    if (text.Equals("P_3ZHE_L") && array[0] != array[1] && array[0] != array[2] && array[1] != array[2])
                    {
                        num6 /= 2m;
                    }
                    if (text.Equals("P_3ZHE_C") && array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                    {
                        num6 /= 2m;
                    }
                    if (text.Equals("P_3ZHE_R") && array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                    {
                        num6 /= 2m;
                    }
                    if (text.Equals("P_3HX_L"))
                    {
                        if (array[0] == array[1] || array[1] == array[2] || array[0] == array[2])
                        {
                            text = text.Replace("3HX", "3Z3_2");
                        }
                        if (array[0] != array[1] && array[0] != array[2] && array[1] != array[2])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3HX", "3Z6_2");
                        }
                    }
                    if (text.Equals("P_3HX_C"))
                    {
                        if (array[1] == array[2] || array[2] == array[3] || array[1] == array[3])
                        {
                            text = text.Replace("3HX", "3Z3_2");
                        }
                        if (array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                        {
                            num6 /= 2m;
                            text  = text.Replace("3HX", "3Z6_2");
                        }
                    }
                    if (text.Equals("P_3HX_R"))
                    {
                        if (array.Length == 3)
                        {
                            if (array[0] == array[1] || array[1] == array[2] || array[0] == array[2])
                            {
                                text = text.Replace("3HX", "3Z3_2");
                            }
                            if (array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                            {
                                num6 /= 2m;
                                text  = text.Replace("3HX", "3Z6_2");
                            }
                        }
                        else
                        {
                            if (array[2] == array[3] || array[3] == array[4] || array[2] == array[4])
                            {
                                text = text.Replace("3HX", "3Z3_2");
                            }
                            if (array[2] != array[3] && array[3] != array[4] && array[2] != array[4])
                            {
                                num6 /= 2m;
                                text  = text.Replace("3HX", "3Z6_2");
                            }
                        }
                    }
                    if (text.Contains("R_3HX"))
                    {
                        if (array.Length == 3)
                        {
                            if (array[0] == array[1] || array[1] == array[2] || array[0] == array[2])
                            {
                                text = text.Replace("3HX", "3Z3_2");
                            }
                            if (array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                            {
                                num6 /= 2m;
                                text  = text.Replace("3HX", "3Z6_2");
                            }
                        }
                        else
                        {
                            if (text.Equals("R_3HX_WQB") && array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_WQS") && array[0] != array[1] && array[1] != array[3] && array[0] != array[3])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_WQG") && array[0] != array[1] && array[1] != array[4] && array[0] != array[4])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_WBS") && array[0] != array[2] && array[2] != array[3] && array[0] != array[3])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_WBG") && array[0] != array[2] && array[2] != array[4] && array[0] != array[4])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_WSG") && array[0] != array[3] && array[3] != array[4] && array[0] != array[4])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_QBS") && array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_QBG") && array[1] != array[2] && array[2] != array[4] && array[1] != array[4])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_QSG") && array[1] != array[3] && array[3] != array[4] && array[1] != array[4])
                            {
                                num6 /= 2m;
                            }
                            if (text.Equals("R_3HX_BSG") && array[2] != array[3] && array[3] != array[4] && array[2] != array[4])
                            {
                                num6 /= 2m;
                            }
                        }
                    }
                    if (text.Contains("R_3ZHE"))
                    {
                        if (text.Equals("R_3ZHE_WQB") && array[0] != array[1] && array[1] != array[2] && array[0] != array[2])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_WQS") && array[0] != array[1] && array[1] != array[3] && array[0] != array[3])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_WQG") && array[0] != array[1] && array[1] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_WBS") && array[0] != array[2] && array[2] != array[3] && array[0] != array[3])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_WBG") && array[0] != array[2] && array[2] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_WSG") && array[0] != array[3] && array[3] != array[4] && array[0] != array[4])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_QBS") && array[1] != array[2] && array[2] != array[3] && array[1] != array[3])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_QBG") && array[1] != array[2] && array[2] != array[4] && array[1] != array[4])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_QSG") && array[1] != array[3] && array[3] != array[4] && array[1] != array[4])
                        {
                            num6 /= 2m;
                        }
                        if (text.Equals("R_3ZHE_BSG") && array[2] != array[3] && array[3] != array[4] && array[2] != array[4])
                        {
                            num6 /= 2m;
                        }
                    }
                    int num8 = 0;
                    int num9 = 0;
                    if (text.Equals("P_LHH_WQ"))
                    {
                        num8 = Convert.ToInt32(array[0]);
                        num9 = Convert.ToInt32(array[1]);
                    }
                    if (text.Equals("P_LHH_WB"))
                    {
                        num8 = Convert.ToInt32(array[0]);
                        num9 = Convert.ToInt32(array[2]);
                    }
                    if (text.Equals("P_LHH_WS"))
                    {
                        num8 = Convert.ToInt32(array[0]);
                        num9 = Convert.ToInt32(array[3]);
                    }
                    if (text.Equals("P_LHH_WG"))
                    {
                        num8 = Convert.ToInt32(array[0]);
                        num9 = Convert.ToInt32(array[4]);
                    }
                    if (text.Equals("P_LHH_QB"))
                    {
                        num8 = Convert.ToInt32(array[1]);
                        num9 = Convert.ToInt32(array[2]);
                    }
                    if (text.Equals("P_LHH_QS"))
                    {
                        num8 = Convert.ToInt32(array[1]);
                        num9 = Convert.ToInt32(array[3]);
                    }
                    if (text.Equals("P_LHH_QG"))
                    {
                        num8 = Convert.ToInt32(array[1]);
                        num9 = Convert.ToInt32(array[4]);
                    }
                    if (text.Equals("P_LHH_BS"))
                    {
                        num8 = Convert.ToInt32(array[2]);
                        num9 = Convert.ToInt32(array[3]);
                    }
                    if (text.Equals("P_LHH_BG"))
                    {
                        num8 = Convert.ToInt32(array[2]);
                        num9 = Convert.ToInt32(array[4]);
                    }
                    if (text.Equals("P_LHH_SG"))
                    {
                        num8 = Convert.ToInt32(array[3]);
                        num9 = Convert.ToInt32(array[4]);
                    }
                    if (num8 != num9)
                    {
                        num6 = Convert.ToDecimal(num6 / Convert.ToDecimal(4.5));
                    }
                    int num10 = CheckPlay.Check(LotteryNumber, betDetail, pos, text);
                    num5 *= d2;
                    int num11;
                    if (num10 > 0)
                    {
                        num11 = 3;
                        num6  = num6 * d2 * num10 * d3 / 2m;
                        decimal num12 = 200000m;
                        if (num6 > num12)
                        {
                            num6 = num12;
                        }
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select top 1 MinNum from Sys_PlaySmallType where Id=" + num3;
                        decimal num13 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        if (num13 == 0m)
                        {
                            if (num6 > d * d2 * 100m)
                            {
                                decimal num14 = 18000m;
                                if (num6 > num14)
                                {
                                    num6 = num14;
                                }
                            }
                        }
                        else if (value < num13)
                        {
                            decimal num15 = 18000m;
                            if (num6 > num15)
                            {
                                num6 = num15;
                            }
                        }
                    }
                    else
                    {
                        num11 = 2;
                        num6  = 0m;
                    }
                    decimal num16 = num6 + num5 - d * d2;
                    sqlCommand.CommandType = CommandType.Text;
                    sqlCommand.CommandText = string.Concat(new string[]
                    {
                        "update N_UserBet set State=",
                        num11.ToString(),
                        ",WinNum=",
                        num10.ToString(),
                        ",WinBonus=",
                        num6.ToString(),
                        ",RealGet=",
                        num16.ToString(),
                        " where Id=",
                        logSysId.ToString()
                    });
                    sqlCommand.ExecuteNonQuery();
                    if (num6 > 0m)
                    {
                        new UserTotalTran().MoneyOpers(ssId, num.ToString(), num6, num2, num3, logSysId, 5, 99, "", "", "奖金派发", sTime);
                    }
                    if (num5 > 0m)
                    {
                        new UserTotalTran().MoneyOpers(ssId, num.ToString(), num5, num2, num3, logSysId, 4, 99, "", "", "返点派发", sTime);
                    }
                    if (num7 != 0)
                    {
                        string str = string.Format(" where LotteryId={0} and state=0 and zhid={1} and IssueNum>'{2}'", num2, num7, arg);
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select count(Id) from N_UserBet" + str;
                        if (Convert.ToInt32(sqlCommand.ExecuteScalar()) > 0 && num10 > 0)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = string.Format("select count(Id) from N_UserZhBet with(nolock) where isstop=1 and Id={0}", num7);
                            if (Convert.ToInt32(sqlCommand.ExecuteScalar()) > 0)
                            {
                                sqlCommand.CommandType = CommandType.Text;
                                sqlCommand.CommandText = "select isnull(sum(Total*Times),0) from N_UserBet " + str;
                                decimal money = Convert.ToDecimal(string.Concat(sqlCommand.ExecuteScalar()));
                                sqlCommand.CommandType = CommandType.Text;
                                sqlCommand.CommandText = "update N_UserBet set State=1 " + str;
                                sqlCommand.ExecuteNonQuery();
                                new UserTotalTran().MoneyOpers(ssId, num.ToString(), money, num2, num3, logSysId, 6, 99, "", "", "终止追号", sTime);
                            }
                        }
                    }
                    result = true;
                }
            }
            catch (Exception ex)
            {
                new LogExceptionDAL().Save("程序异常", "派奖过程中出现异常:" + ex.Message);
                result = false;
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="row">投注信息</param>
        /// <param name="LotteryNumber">期号</param>
        /// <param name="sqlCommand"></param>
        /// <returns></returns>
        public static bool Checking(DataRow row, string LotteryNumber, SqlCommand sqlCommand)
        {
            try
            {
                if (Convert.ToInt32(row["State"]) != 0)
                {
                    return(true);
                }
                int     int32_1    = Convert.ToInt32(row["Id"]);
                string  ssId       = row["SsId"].ToString();
                int     int32_2    = Convert.ToInt32(row["UserId"]);
                int     int32_3    = Convert.ToInt32(row["LotteryId"]);
                int     int32_4    = Convert.ToInt32(row["PlayId"]);
                int     int32_5    = Convert.ToInt32(row["Num"]);
                string  str1       = row["IssueNum"].ToString();
                string  betDetail2 = BetDetailDAL.GetBetDetail2(Convert.ToDateTime(row["STime2"]).ToString("yyyyMMdd"), int32_2.ToString(), int32_1.ToString());
                Decimal num1       = Convert.ToDecimal(row["Total"]);
                Decimal num2       = Convert.ToDecimal(row["point"]);
                Decimal num3       = Convert.ToDecimal(row["PointMoney"]);
                Decimal num4       = Convert.ToDecimal(row["Bonus"]);
                Decimal num5       = Convert.ToDecimal(row["Times"]);
                Decimal num6       = Convert.ToDecimal(row["SingleMoney"]);
                string  Pos        = row["Pos"].ToString();
                string  sType      = row["PlayCode"].ToString();
                Convert.ToInt32(row["IsCheat"]);
                Convert.ToInt32(row["IsDelay"]);
                int      int32_6   = Convert.ToInt32(row["ZhId"]);
                string   STime2    = row["STime"].ToString();
                string[] strArray1 = LotteryNumber.Split(',');

                if (sType.Equals("P_5QJ3"))
                {
                    string[] strArray2 = betDetail2.Split(',');
                    if (strArray2[0].IndexOf(CheckOperation.ReplaceStr(strArray1[0])) == -1 || strArray2[1].IndexOf(CheckOperation.ReplaceStr(strArray1[1])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_5QJ3'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_5QJ3", "P_5QJ3_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_5QJ3", "P_5QJ3_1");
                    }
                }

                if (sType.Equals("P_4QJ3"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceStr(strArray1[1])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_4QJ3'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_4QJ3", "P_4QJ3_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_4QJ3", "P_4QJ3_1");
                    }
                }

                if (sType.Equals("P_3QJ2_L"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceStr(strArray1[0])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_3QJ2_L'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_3QJ2_L", "P_3QJ2_L_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_3QJ2_L", "P_3QJ2_L_1");
                    }
                }

                if (sType.Equals("P_3QJ2_R"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceStr(strArray1[2])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_3QJ2_R'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_3QJ2_R", "P_3QJ2_R_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_3QJ2_R", "P_3QJ2_R_1");
                    }
                }

                if (sType.Equals("P_5QW3"))
                {
                    string[] strArray2 = betDetail2.Split(',');
                    if (strArray2[0].IndexOf(CheckOperation.ReplaceDX(strArray1[0])) == -1 || strArray2[1].IndexOf(CheckOperation.ReplaceDX(strArray1[1])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_5QW3'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_5QW3", "P_5QW3_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_5QW3", "P_5QW3_1");
                    }
                }

                if (sType.Equals("P_4QW3"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceDX(strArray1[1])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_4QW3'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_4QW3", "P_4QW3_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_4QW3", "P_4QW3_1");
                    }
                }

                if (sType.Equals("P_3QW2_L"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceDX(strArray1[0])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_3QW2_L'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_3QW2_L", "P_3QW2_L_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_3QW2_L", "P_3QW2_L_1");
                    }
                }

                if (sType.Equals("P_3QW2_R"))
                {
                    if (betDetail2.Split(',')[0].IndexOf(CheckOperation.ReplaceDX(strArray1[2])) == -1)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = "select MinBonus2+20*PosBonus2*(0.1*(SELECT top 1 [Point] FROM [N_User] where Id=" + (object)int32_2 + ")-" + (object)num2 + ") from Sys_PlaySmallType where title2='P_3QW2_R'";
                        num4  = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                        sType = sType.Replace("P_3QW2_R", "P_3QW2_R_2");
                    }
                    else
                    {
                        sType = sType.Replace("P_3QW2_R", "P_3QW2_R_1");
                    }
                }

                if (sType.Equals("P_3ZBD_L"))
                {
                    if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[2] || strArray1[0] == strArray1[2])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("P_3ZBD_C"))
                {
                    if (strArray1[1] == strArray1[2] || strArray1[2] == strArray1[3] || strArray1[1] == strArray1[3])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[1] != strArray1[2] && strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("P_3ZBD_R"))
                {
                    if (strArray1[2] == strArray1[3] || strArray1[3] == strArray1[4] || strArray1[2] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[2] != strArray1[3] && strArray1[3] != strArray1[4] && strArray1[2] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WQB"))
                {
                    if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[2] || strArray1[0] == strArray1[2])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WQS"))
                {
                    if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[3] || strArray1[0] == strArray1[3])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[3] && strArray1[0] != strArray1[3])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WQG"))
                {
                    if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[4] || strArray1[0] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[4] && strArray1[0] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WBS"))
                {
                    if (strArray1[0] == strArray1[2] || strArray1[2] == strArray1[3] || strArray1[0] == strArray1[3])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[2] && strArray1[2] != strArray1[3] && strArray1[0] != strArray1[3])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WBG"))
                {
                    if (strArray1[0] == strArray1[2] || strArray1[2] == strArray1[4] || strArray1[0] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[2] && strArray1[2] != strArray1[4] && strArray1[0] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_WSG"))
                {
                    if (strArray1[0] == strArray1[3] || strArray1[3] == strArray1[4] || strArray1[0] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[0] != strArray1[3] && strArray1[3] != strArray1[4] && strArray1[0] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_QBS"))
                {
                    if (strArray1[1] == strArray1[2] || strArray1[2] == strArray1[3] || strArray1[1] == strArray1[3])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[1] != strArray1[2] && strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_QBG"))
                {
                    if (strArray1[1] == strArray1[2] || strArray1[2] == strArray1[4] || strArray1[1] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[1] != strArray1[2] && strArray1[2] != strArray1[4] && strArray1[1] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_QSG"))
                {
                    if (strArray1[1] == strArray1[3] || strArray1[3] == strArray1[4] || strArray1[1] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[1] != strArray1[3] && strArray1[3] != strArray1[4] && strArray1[1] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("R_3ZBD_BSG"))
                {
                    if (strArray1[2] == strArray1[3] || strArray1[3] == strArray1[4] || strArray1[2] == strArray1[4])
                    {
                        sType = sType.Replace("3ZBD", "3ZBDZ3");
                    }
                    if (strArray1[2] != strArray1[3] && strArray1[3] != strArray1[4] && strArray1[2] != strArray1[4])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3ZBD", "3ZBDZ6");
                    }
                }

                if (sType.Equals("P_3ZHE_L") && strArray1[0] != strArray1[1] && (strArray1[0] != strArray1[2] && strArray1[1] != strArray1[2]))
                {
                    num4 /= new Decimal(2);
                }

                if (sType.Equals("P_3ZHE_C") && strArray1[1] != strArray1[2] && (strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3]))
                {
                    num4 /= new Decimal(2);
                }

                if (sType.Equals("P_3ZHE_R") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2]))
                {
                    num4 /= new Decimal(2);
                }

                if (sType.Equals("P_3HX_L"))
                {
                    if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[2] || strArray1[0] == strArray1[2])
                    {
                        sType = sType.Replace("3HX", "3Z3_2");
                    }
                    if (strArray1[0] != strArray1[1] && strArray1[0] != strArray1[2] && strArray1[1] != strArray1[2])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3HX", "3Z6_2");
                    }
                }

                if (sType.Equals("P_3HX_C"))
                {
                    if (strArray1[1] == strArray1[2] || strArray1[2] == strArray1[3] || strArray1[1] == strArray1[3])
                    {
                        sType = sType.Replace("3HX", "3Z3_2");
                    }
                    if (strArray1[1] != strArray1[2] && strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3])
                    {
                        num4 /= new Decimal(2);
                        sType = sType.Replace("3HX", "3Z6_2");
                    }
                }

                if (sType.Equals("P_3HX_R"))
                {
                    if (strArray1.Length == 3)
                    {
                        if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[2] || strArray1[0] == strArray1[2])
                        {
                            sType = sType.Replace("3HX", "3Z3_2");
                        }
                        if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2])
                        {
                            num4 /= new Decimal(2);
                            sType = sType.Replace("3HX", "3Z6_2");
                        }
                    }
                    else
                    {
                        if (strArray1[2] == strArray1[3] || strArray1[3] == strArray1[4] || strArray1[2] == strArray1[4])
                        {
                            sType = sType.Replace("3HX", "3Z3_2");
                        }
                        if (strArray1[2] != strArray1[3] && strArray1[3] != strArray1[4] && strArray1[2] != strArray1[4])
                        {
                            num4 /= new Decimal(2);
                            sType = sType.Replace("3HX", "3Z6_2");
                        }
                    }
                }

                if (sType.Contains("R_3HX"))
                {
                    if (strArray1.Length == 3)
                    {
                        if (strArray1[0] == strArray1[1] || strArray1[1] == strArray1[2] || strArray1[0] == strArray1[2])
                        {
                            sType = sType.Replace("3HX", "3Z3_2");
                        }
                        if (strArray1[0] != strArray1[1] && strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2])
                        {
                            num4 /= new Decimal(2);
                            sType = sType.Replace("3HX", "3Z6_2");
                        }
                    }
                    else
                    {
                        if (sType.Equals("R_3HX_WQB") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_WQS") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[3] && strArray1[0] != strArray1[3]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_WQG") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[4] && strArray1[0] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_WBS") && strArray1[0] != strArray1[2] && (strArray1[2] != strArray1[3] && strArray1[0] != strArray1[3]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_WBG") && strArray1[0] != strArray1[2] && (strArray1[2] != strArray1[4] && strArray1[0] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_WSG") && strArray1[0] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[0] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_QBS") && strArray1[1] != strArray1[2] && (strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_QBG") && strArray1[1] != strArray1[2] && (strArray1[2] != strArray1[4] && strArray1[1] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_QSG") && strArray1[1] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[1] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                        if (sType.Equals("R_3HX_BSG") && strArray1[2] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[2] != strArray1[4]))
                        {
                            num4 /= new Decimal(2);
                        }
                    }
                }

                if (sType.Contains("R_3ZHE"))
                {
                    if (sType.Equals("R_3ZHE_WQB") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[2] && strArray1[0] != strArray1[2]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_WQS") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[3] && strArray1[0] != strArray1[3]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_WQG") && strArray1[0] != strArray1[1] && (strArray1[1] != strArray1[4] && strArray1[0] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_WBS") && strArray1[0] != strArray1[2] && (strArray1[2] != strArray1[3] && strArray1[0] != strArray1[3]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_WBG") && strArray1[0] != strArray1[2] && (strArray1[2] != strArray1[4] && strArray1[0] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_WSG") && strArray1[0] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[0] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_QBS") && strArray1[1] != strArray1[2] && (strArray1[2] != strArray1[3] && strArray1[1] != strArray1[3]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_QBG") && strArray1[1] != strArray1[2] && (strArray1[2] != strArray1[4] && strArray1[1] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_QSG") && strArray1[1] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[1] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                    if (sType.Equals("R_3ZHE_BSG") && strArray1[2] != strArray1[3] && (strArray1[3] != strArray1[4] && strArray1[2] != strArray1[4]))
                    {
                        num4 /= new Decimal(2);
                    }
                }

                int num7 = 0;
                int num8 = 0;

                if (sType.Equals("P_LHH_WQ"))
                {
                    num7 = Convert.ToInt32(strArray1[0]);
                    num8 = Convert.ToInt32(strArray1[1]);
                }

                if (sType.Equals("P_LHH_WB"))
                {
                    num7 = Convert.ToInt32(strArray1[0]);
                    num8 = Convert.ToInt32(strArray1[2]);
                }

                if (sType.Equals("P_LHH_WS"))
                {
                    num7 = Convert.ToInt32(strArray1[0]);
                    num8 = Convert.ToInt32(strArray1[3]);
                }

                if (sType.Equals("P_LHH_WG"))
                {
                    num7 = Convert.ToInt32(strArray1[0]);
                    num8 = Convert.ToInt32(strArray1[4]);
                }

                if (sType.Equals("P_LHH_QB"))
                {
                    num7 = Convert.ToInt32(strArray1[1]);
                    num8 = Convert.ToInt32(strArray1[2]);
                }

                if (sType.Equals("P_LHH_QS"))
                {
                    num7 = Convert.ToInt32(strArray1[1]);
                    num8 = Convert.ToInt32(strArray1[3]);
                }

                if (sType.Equals("P_LHH_QG"))
                {
                    num7 = Convert.ToInt32(strArray1[1]);
                    num8 = Convert.ToInt32(strArray1[4]);
                }

                if (sType.Equals("P_LHH_BS"))
                {
                    num7 = Convert.ToInt32(strArray1[2]);
                    num8 = Convert.ToInt32(strArray1[3]);
                }

                if (sType.Equals("P_LHH_BG"))
                {
                    num7 = Convert.ToInt32(strArray1[2]);
                    num8 = Convert.ToInt32(strArray1[4]);
                }

                if (sType.Equals("P_LHH_SG"))
                {
                    num7 = Convert.ToInt32(strArray1[3]);
                    num8 = Convert.ToInt32(strArray1[4]);
                }

                if (num7 != num8)
                {
                    num4 = Convert.ToDecimal(num4 / Convert.ToDecimal(4.5));
                }

                int num9 = CheckPlay.Check(LotteryNumber, betDetail2, Pos, sType);

                Decimal Money1 = num3 * num5;
                int     num10;
                Decimal Money2;
                if (num9 > 0)
                {
                    num10  = 3;
                    Money2 = num4 * num5 * (Decimal)num9 * num6 / new Decimal(2);
                    Decimal num11 = new Decimal(200000);
                    if (Money2 > num11)
                    {
                        Money2 = num11;
                    }
                    sqlCommand.CommandType = CommandType.Text;
                    sqlCommand.CommandText = "select top 1 MinNum from Sys_PlaySmallType where Id=" + (object)int32_4;
                    Decimal num12 = Convert.ToDecimal(sqlCommand.ExecuteScalar().ToString());
                    if (num12 == new Decimal(0))
                    {
                        if (Money2 > num1 * num5 * new Decimal(100))
                        {
                            Decimal num13 = new Decimal(18000);
                            if (Money2 > num13)
                            {
                                Money2 = num13;
                            }
                        }
                    }
                    else if ((Decimal)int32_5 < num12)
                    {
                        Decimal num13 = new Decimal(18000);
                        if (Money2 > num13)
                        {
                            Money2 = num13;
                        }
                    }
                }
                else
                {
                    num10  = 2;
                    Money2 = new Decimal(0);
                }
                Decimal num14 = Money2 + Money1 - num1 * num5;
                sqlCommand.CommandType = CommandType.Text;
                sqlCommand.CommandText = "update N_UserBet set State=" + num10.ToString() + ",WinNum=" + num9.ToString() + ",WinBonus=" + Money2.ToString() + ",RealGet=" + num14.ToString() + " where Id=" + int32_1.ToString();
                sqlCommand.ExecuteNonQuery();
                if (Money2 > new Decimal(0))
                {
                    new UserTotalTran().MoneyOpers(ssId, int32_2.ToString(), Money2, int32_3, int32_4, int32_1, 5, 99, "", "", "奖金派发", STime2);
                }
                if (Money1 > new Decimal(0))
                {
                    new UserTotalTran().MoneyOpers(ssId, int32_2.ToString(), Money1, int32_3, int32_4, int32_1, 4, 99, "", "", "返点派发", STime2);
                }
                if (int32_6 != 0)
                {
                    string str2 = string.Format(" where LotteryId={0} and state=0 and zhid={1} and IssueNum>'{2}'", (object)int32_3, (object)int32_6, (object)str1);
                    sqlCommand.CommandType = CommandType.Text;
                    sqlCommand.CommandText = "select count(Id) from N_UserBet" + str2;
                    if (Convert.ToInt32(sqlCommand.ExecuteScalar()) > 0 && num9 > 0)
                    {
                        sqlCommand.CommandType = CommandType.Text;
                        sqlCommand.CommandText = string.Format("select count(Id) from N_UserZhBet with(nolock) where isstop=1 and Id={0}", (object)int32_6);
                        if (Convert.ToInt32(sqlCommand.ExecuteScalar()) > 0)
                        {
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = "select isnull(sum(Total*Times),0) from N_UserBet " + str2;
                            Decimal Money3 = Convert.ToDecimal(string.Concat(sqlCommand.ExecuteScalar()));
                            sqlCommand.CommandType = CommandType.Text;
                            sqlCommand.CommandText = "update N_UserBet set State=1 " + str2;
                            sqlCommand.ExecuteNonQuery();
                            new UserTotalTran().MoneyOpers(ssId, int32_2.ToString(), Money3, int32_3, int32_4, int32_1, 6, 99, "", "", "终止追号", STime2);
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                new LogExceptionDAL().Save("程序异常", "派奖过程中出现异常:" + ex.Message);
                return(false);
            }
        }