Exemple #1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        string rq = TextBox5.Text.Trim();

        string hour = DropDownList1.SelectedValue;
        string min  = DropDownList2.SelectedValue;
        string sec  = DropDownList3.SelectedValue;

        int isjs = 0;

        if (Textbox4.Text == "y")
        {
            isjs = 1; //结算时创建新一期选中
        }
        if (DateTime.Compare(Convert.ToDateTime(rq + " " + hour + ":" + min + ":" + sec), DateTime.Now) < 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007128", "选择日期不能小于当前时间!") + "');</script>");
            return;
        }

        string zqts = jszq.Text.Trim();

        try
        {
            Convert.ToInt32(zqts);
        }
        catch
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('自动结算周期只能为整数!');</script>");
            return;
        }

        if (Convert.ToInt32(zqts) < 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('自动结算周期不能为负数!');</script>");
            return;
        }

        int a = ReleaseDAL.UpdJiesuantime(rq + " " + hour + ":" + min + ":" + sec, isjs, zqts);

        if (a == 1)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('设置成功!');window.location.href=window.location.href</script>");
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('设置失败!');</script>");
        }
    }