Пример #1
0
    protected void btnAdd_Click(object sender, System.EventArgs e)
    {
        if (string.IsNullOrEmpty(tbMoney.Text.Trim()))
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入方案最低金额!");

            return;
        }

        if (Shove._Convert.StrToFloat(tbMoney.Text.Trim(), 0) == 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入最低方案金额输入有误,请重新输入!");

            return;
        }

        if (string.IsNullOrEmpty(tbSchedule.Text.Trim()))
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入方案进度加保底的最少金额!");

            return;
        }

        if (Shove._Convert.StrToFloat(tbSchedule.Text.Trim(), 0) == 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入方案的最少进度加保底金额输入有误,请重新输入!");

            return;
        }

        if (string.IsNullOrEmpty(tbMinMoney.Text.Trim()))
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入方案最小进度!");

            return;
        }

        if (Shove._Convert.StrToFloat(tbMinMoney.Text.Trim(), 0) == 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入方案的最少进度输入有误,请重新输入!");

            return;
        }

        DAL.Tables.T_SchemesFormulae t_SchemesFormulae = new DAL.Tables.T_SchemesFormulae();

        t_SchemesFormulae.Money.Value = Shove._Convert.StrToFloat(tbMoney.Text.Trim(), 0);
        t_SchemesFormulae.Schedule.Value = Shove._Convert.StrToFloat(tbSchedule.Text.Trim(), 0);
        t_SchemesFormulae.MinMoney.Value = Shove._Convert.StrToFloat(tbMinMoney.Text.Trim(), 0);

        if (IsSet.Value != "1")
        {
            t_SchemesFormulae.LotteryID.Value = Shove._Convert.StrToShort(ddlLottery.SelectedValue, 0);

            t_SchemesFormulae.Insert();

            Shove._Web.JavaScript.Alert(this.Page, "彩种已经设置成功!");

            return;
        }

        t_SchemesFormulae.Update("LotteryID=" + ddlLottery.SelectedValue);

        Shove._Web.JavaScript.Alert(this.Page, "彩种已经设置成功!");

        return;
    }