Esempio n. 1
0
    private int BuildAdditionasXmlForZCDC(ref string AdditionasXml)
    {
        int CompetitionCount = Shove._Convert.StrToInt(CompetitionNum.Text.Trim(), 0);

        if (CompetitionCount < 10)
        {
            Shove._Web.JavaScript.Alert(this.Page, "输入的本期比赛总场数输入有误!");

            return(-1);
        }

        TextBox[]      tb1           = new TextBox[CompetitionCount];
        TextBox[]      tb2           = new TextBox[CompetitionCount];
        TextBox[]      tb3           = new TextBox[CompetitionCount];
        DropDownList[] ddlLetBall    = new DropDownList[CompetitionCount];
        DropDownList[] ddlLeagueType = new DropDownList[CompetitionCount];

        string[] Xmlparams = new string[CompetitionCount * 5];

        //构建格式:类别,主场,客场,让球数,比赛时间|类别,主场,客场,让球数,比赛时间
        int DataCount = DataListZCDC.Items.Count;

        for (int i = 0; i < DataCount; i++)
        {
            tb1[i]           = (TextBox)(DataListZCDC.Items[i].FindControl("tb1ZCDC"));
            tb2[i]           = (TextBox)(DataListZCDC.Items[i].FindControl("tb2ZCDC"));
            tb3[i]           = (TextBox)(DataListZCDC.Items[i].FindControl("tb3ZCDC"));
            ddlLetBall[i]    = (DropDownList)(DataListZCDC.Items[i].FindControl("ddlLetBall"));
            ddlLeagueType[i] = (DropDownList)(DataListZCDC.Items[i].FindControl("ddlLeagueType"));

            if ((tb1[i].Text.Trim() == "") || (tb2[i].Text.Trim() == "") || (tb3[i].Text.Trim() == ""))
            {
                Shove._Web.JavaScript.Alert(this.Page, "第 " + (i + 1).ToString() + " 场比赛球队名称输入不完整!");
                return(-2);
            }

            object dt = PF.ValidLotteryTime(tb3[i].Text.Trim());
            if (dt == null)
            {
                Shove._Web.JavaScript.Alert(this.Page, "第 " + (i + 1).ToString() + " 场比赛球队时间输入不正确!(格式:0000-00-00 00:00:00)");
                return(-3);
            }

            Xmlparams[i * 5]     = ddlLeagueType[i].SelectedValue;
            Xmlparams[i * 5 + 1] = tb1[i].Text.Trim();
            Xmlparams[i * 5 + 2] = tb2[i].Text.Trim();
            Xmlparams[i * 5 + 3] = ddlLetBall[i].SelectedValue;
            Xmlparams[i * 5 + 4] = dt.ToString();
        }

        AdditionasXml = PF.BuildIsuseAdditionasXmlForZCDC(Xmlparams);

        return(0);
    }
    private int BuildAdditionasXmlForZCDC(ref string AdditionasXml)
    {
        int num = _Convert.StrToInt(this.CompetitionNum.Text.Trim(), 0);

        if (num < 10)
        {
            JavaScript.Alert(this.Page, "输入的本期比赛总场数输入有误!");
            return(-1);
        }
        TextBox[]      boxArray   = new TextBox[num];
        TextBox[]      boxArray2  = new TextBox[num];
        TextBox[]      boxArray3  = new TextBox[num];
        DropDownList[] listArray  = new DropDownList[num];
        DropDownList[] listArray2 = new DropDownList[num];
        string[]       str        = new string[num * 5];
        int            count      = this.DataListZCDC.Items.Count;

        for (int i = 0; i < count; i++)
        {
            boxArray[i]   = (TextBox)this.DataListZCDC.Items[i].FindControl("tb1ZCDC");
            boxArray2[i]  = (TextBox)this.DataListZCDC.Items[i].FindControl("tb2ZCDC");
            boxArray3[i]  = (TextBox)this.DataListZCDC.Items[i].FindControl("tb3ZCDC");
            listArray[i]  = (DropDownList)this.DataListZCDC.Items[i].FindControl("ddlLetBall");
            listArray2[i] = (DropDownList)this.DataListZCDC.Items[i].FindControl("ddlLeagueType");
            if (((boxArray[i].Text.Trim() == "") || (boxArray2[i].Text.Trim() == "")) || (boxArray3[i].Text.Trim() == ""))
            {
                JavaScript.Alert(this.Page, "第 " + ((i + 1)).ToString() + " 场比赛球队名称输入不完整!");
                return(-2);
            }
            object obj2 = PF.ValidLotteryTime(boxArray3[i].Text.Trim());
            if (obj2 == null)
            {
                JavaScript.Alert(this.Page, "第 " + ((i + 1)).ToString() + " 场比赛球队时间输入不正确!(格式:0000-00-00 00:00:00)");
                return(-3);
            }
            str[i * 5]       = listArray2[i].SelectedValue;
            str[(i * 5) + 1] = boxArray[i].Text.Trim();
            str[(i * 5) + 2] = boxArray2[i].Text.Trim();
            str[(i * 5) + 3] = listArray[i].SelectedValue;
            str[(i * 5) + 4] = obj2.ToString();
        }
        AdditionasXml = PF.BuildIsuseAdditionasXmlForZCDC(str);
        return(0);
    }