コード例 #1
0
    private void SaveData()
    {
        if (hfIsUpdate.Value == "Y")
        {
            hfContExtId.Value = hfContExtId.Value;
        }
        else
        {
            hfContExtId.Value = Common.getMaxId("EmpContractExtLog", "ContractExtId");
        }

        string strEffDate     = "";
        string strContExtDate = "";

        if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false)
        {
            strEffDate = Common.ReturnDate(txtEffDate.Text.Trim());
        }

        if (string.IsNullOrEmpty(txtContExpDate.Text.Trim()) == false)
        {
            strContExtDate = Common.ReturnDate(txtContExpDate.Text.Trim());
        }

        clsContractExt objContExt = new clsContractExt(txtEmpID.Text.Trim(), hfContExtId.Value.ToString(), ddlAction.SelectedValue.ToString(), strEffDate, strContExtDate,
                                                       Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()));

        EmpInfoManager objEmp = new EmpInfoManager();

        objEmp.InsertContractExtension(objContExt, ddlAction.SelectedItem.ToString(), hfIsUpdate.Value);

        if (hfIsUpdate.Value == "N")
        {
            lblMsg.Text = "Record Saved Successfully";
        }

        else if (hfIsUpdate.Value == "Y")
        {
            lblMsg.Text = "Record Updated Successfully";
        }

        this.OpenRecord();
        this.EntryMode(false);
        this.ClearControl();
    }