コード例 #1
0
ファイル: VDM022.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btnExtendDate_Click(object sender, EventArgs e)
    {
        BCO.MaintainVendorAgm bco = new BCO.MaintainVendorAgm(ConntionDB);
        string strLastMonth = bco.GetLastCheckMonth();
        slpRESUME_DATE_E.Text = strLastMonth.Substring(0, 4) + "/" + strLastMonth.Substring(4, 2) + "/25";
        UpdatePanel2.Update();

        if (DateTime.Parse(slpRESUME_DATE_B.Text) >= DateTime.Parse(slpRESUME_DATE_E.Text))
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "ClientScript", "alert('履歷結束日須大於履歷起始日');", true);
            return;
        }
        //if (DateTime.Parse(slpCNT_END_DATE.Text) <= DateTime.Parse(slpRESUME_DATE_E.Text))
        //{
        //    ScriptManager.RegisterStartupScript(Page, this.GetType(), "ClientScript", "alert('履歷結束日須小於合約結束日');", true);
        //    return;
        //}
        if (ViewState["STOP_DATE"].ToString() != "")
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "ClientScript", "alert('該份合約已終止往來,無法新增履歷');", true);
            return;
        }
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "if (confirm('確定執行後舊合約的【履歷結束日】將無法還原,是否確定新增履歷')){this.disabled=true;__doPostBack('AddResume2','');}", true);


    }