コード例 #1
0
    protected void SaveData()
    {
        string strEntryDate    = "";
        string strActionDate   = "";
        string strReviewDate   = "";
        string strResponseDate = "";

        if (string.IsNullOrEmpty(txtEntryDate.Text.Trim()) == false)
        {
            strEntryDate = Common.ReturnDate(txtEntryDate.Text.Trim());
        }

        if (string.IsNullOrEmpty(txtActionDate.Text.Trim()) == false)
        {
            strActionDate = Common.ReturnDate(txtActionDate.Text.Trim());
        }

        if (string.IsNullOrEmpty(txtReviewDate.Text.Trim()) == false)
        {
            strReviewDate = Common.ReturnDate(txtReviewDate.Text.Trim());
        }

        if (string.IsNullOrEmpty(txtResponseDate.Text.Trim()) == false)
        {
            strResponseDate = Common.ReturnDate(txtResponseDate.Text.Trim());
        }

        if (hfIsUpdate.Value == "Y")
        {
            hfId.Value = hfId.Value;
        }
        else
        {
            hfId.Value = Common.getMaxId("EmpDisciplinaryLog", "DisciplinaryId");
        }

        objEmpMgr.InsertDisciplinary(hfId.Value.ToString(), txtEmpID.Text.Trim(), strEntryDate, ddlAction.SelectedValue.ToString(), ddlReasonList.SelectedValue.ToString(), strActionDate, strReviewDate, chkIsReviewed.Checked == true ? "Y" : "N",
                                     chkIsSuspendInc.Checked == true ? "Y":"N", txtResponseDays.Text.Trim(), strResponseDate, txtEmpResponse.Text.Trim(), txtRemarks.Text.Trim(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value.ToString(), txtFine.Text.Trim());

        if (hfIsUpdate.Value == "N")
        {
            lblMsg.Text = "Record Saved Successfully";
        }
        else
        {
            lblMsg.Text = "Record Updated Successfully";
        }
        this.OpenRecord();
        this.EntryMode(false);
    }