Ejemplo n.º 1
0
        public void GetDnListJSON(int lotteryId, ref string _jsonstr)
        {
            DataTable table = new DataTable();

            table.Columns.Add("Title");
            table.Columns.Add("Number");
            table.Columns.Add("Number1");
            table.Columns.Add("Number2");
            table.Columns.Add("Number3");
            table.Columns.Add("Number4");
            table.Columns.Add("Number5");
            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = "select top 18 * from Sys_LotteryData where Type=" + (object)lotteryId + " order by Title desc";
                DataTable dataTable = dbOperHandler.GetDataTable();
                for (int index = 0; index < dataTable.Rows.Count; ++index)
                {
                    DataRow row = table.NewRow();
                    row["Title"]   = (object)dataTable.Rows[index]["Title"].ToString();
                    row["Number"]  = (object)(dataTable.Rows[index]["Number"].ToString() + "(" + CheckSSC_DN.CheckNNum(dataTable.Rows[index]["Number"].ToString()) + ")");
                    row["Number1"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1)) + ")");
                    row["Number2"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2)) + ")");
                    row["Number3"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3)) + ")");
                    row["Number4"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4)) + ")");
                    row["Number5"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5)) + ")");
                    table.Rows.Add(row);
                }
                _jsonstr = this.ConverTableToJSON(table);
                table.Clear();
                table.Dispose();
            }
        }
Ejemplo n.º 2
0
        private void ajaxGetDNList()
        {
            string str = this.q("u");

            this.Str2Int(this.q("gId"), 0);
            int    num1     = this.Int_ThisPage();
            int    num2     = this.Str2Int(this.q("pagesize"), 20);
            string whereStr = "[Type]=" + (object)this.Str2Int(this.q("flag"), 0);

            if (!string.IsNullOrEmpty(str))
            {
                whereStr = whereStr + "and Title like '" + str + "%'";
            }
            this.doh.Reset();
            this.doh.ConditionExpress = whereStr;
            int    totalCount = this.doh.Count("V_LotteryData");
            string sql0       = SqlHelp.GetSql0("Id,TypeName,Title,Number,OpenTime", "V_LotteryData", "OpenTime", num2, num1, "desc", whereStr);

            this.doh.Reset();
            this.doh.SqlCmd = sql0;
            DataTable dataTable = this.doh.GetDataTable();
            DataTable dt        = new DataTable();

            dt.Columns.Add("TypeName");
            dt.Columns.Add("Title");
            dt.Columns.Add("Number");
            dt.Columns.Add("Number1");
            dt.Columns.Add("Number2");
            dt.Columns.Add("Number3");
            dt.Columns.Add("Number4");
            dt.Columns.Add("Number5");
            dt.Columns.Add("Win1");
            dt.Columns.Add("Win2");
            dt.Columns.Add("Win3");
            dt.Columns.Add("Win4");
            dt.Columns.Add("Win5");
            dt.Columns.Add("Total");
            dt.Columns.Add("OpenTime");
            for (int index = 0; index < dataTable.Rows.Count; ++index)
            {
                DataRow row = dt.NewRow();
                row["TypeName"] = (object)dataTable.Rows[index]["TypeName"].ToString();
                row["Title"]    = (object)dataTable.Rows[index]["Title"].ToString();
                row["Number"]   = (object)(dataTable.Rows[index]["Number"].ToString() + "(" + CheckSSC_DN.CheckNNum(dataTable.Rows[index]["Number"].ToString()) + ")");
                row["Number1"]  = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1)) + ")");
                row["Number2"]  = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2)) + ")");
                row["Number3"]  = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3)) + ")");
                row["Number4"]  = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4)) + ")");
                row["Number5"]  = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5)) + ")");
                row["Win1"]     = (object)(CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 1).ToString() + " 倍");
                row["Win2"]     = (object)(CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 2).ToString() + " 倍");
                row["Win3"]     = (object)(CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 3).ToString() + " 倍");
                row["Win4"]     = (object)(CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 4).ToString() + " 倍");
                row["Win5"]     = (object)(CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 5).ToString() + " 倍");
                row["Total"]    = (object)((CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 1) + CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 2) + CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 3) + CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 4) + CheckSSC_DN.P_Wj(dataTable.Rows[index]["Number"].ToString(), 5) - 5) * 100);
                row["OpenTime"] = (object)dataTable.Rows[index]["OpenTime"].ToString();
                dt.Rows.Add(row);
            }
            this._response = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(3, "js", 2, totalCount, num2, num1, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dt) + "}";
            dt.Clear();
            dt.Dispose();
        }
Ejemplo n.º 3
0
        private void ajaxGetDNList()
        {
            string text     = base.q("u");
            int    num      = base.Str2Int(base.q("gId"), 0);
            int    num2     = base.Int_ThisPage();
            int    pageSize = base.Str2Int(base.q("pagesize"), 20);
            int    num3     = base.Str2Int(base.q("flag"), 0);
            string text2    = "[Type]=" + num3;

            if (!string.IsNullOrEmpty(text))
            {
                text2 = text2 + "and Title like '" + text + "%'";
            }
            this.doh.Reset();
            this.doh.ConditionExpress = text2;
            int    totalCount = this.doh.Count("V_LotteryData");
            string sql        = SqlHelp.GetSql0("Id,TypeName,Title,Number,OpenTime", "V_LotteryData", "OpenTime", pageSize, num2, "desc", text2);

            this.doh.Reset();
            this.doh.SqlCmd = sql;
            DataTable dataTable  = this.doh.GetDataTable();
            DataTable dataTable2 = new DataTable();

            dataTable2.Columns.Add("TypeName");
            dataTable2.Columns.Add("Title");
            dataTable2.Columns.Add("Number");
            dataTable2.Columns.Add("Number1");
            dataTable2.Columns.Add("Number2");
            dataTable2.Columns.Add("Number3");
            dataTable2.Columns.Add("Number4");
            dataTable2.Columns.Add("Number5");
            dataTable2.Columns.Add("Win1");
            dataTable2.Columns.Add("Win2");
            dataTable2.Columns.Add("Win3");
            dataTable2.Columns.Add("Win4");
            dataTable2.Columns.Add("Win5");
            dataTable2.Columns.Add("Total");
            dataTable2.Columns.Add("OpenTime");
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                DataRow dataRow = dataTable2.NewRow();
                dataRow["TypeName"] = dataTable.Rows[i]["TypeName"].ToString();
                dataRow["Title"]    = dataTable.Rows[i]["Title"].ToString();
                dataRow["Number"]   = dataTable.Rows[i]["Number"].ToString() + "(" + CheckSSC_DN.CheckNNum(dataTable.Rows[i]["Number"].ToString()) + ")";
                dataRow["Number1"]  = CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 1) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 1)) + ")";
                dataRow["Number2"]  = CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 2) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 2)) + ")";
                dataRow["Number3"]  = CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 3) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 3)) + ")";
                dataRow["Number4"]  = CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 4) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 4)) + ")";
                dataRow["Number5"]  = CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 5) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[i]["Number"].ToString(), 5)) + ")";
                dataRow["Win1"]     = CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 1) + " 倍";
                dataRow["Win2"]     = CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 2) + " 倍";
                dataRow["Win3"]     = CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 3) + " 倍";
                dataRow["Win4"]     = CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 4) + " 倍";
                dataRow["Win5"]     = CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 5) + " 倍";
                dataRow["Total"]    = (CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 1) + CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 2) + CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 3) + CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 4) + CheckSSC_DN.P_Wj(dataTable.Rows[i]["Number"].ToString(), 5) - 5) * 100;
                dataRow["OpenTime"] = dataTable.Rows[i]["OpenTime"].ToString();
                dataTable2.Rows.Add(dataRow);
            }
            this._response = string.Concat(new string[]
            {
                "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"",
                PageBar.GetPageBar(3, "js", 2, totalCount, pageSize, num2, "javascript:ajaxList(<#page#>);"),
                "\",",
                dtHelp.DT2JSON(dataTable2),
                "}"
            });
            dataTable2.Clear();
            dataTable2.Dispose();
        }