Пример #1
0
    private void SaveData(string IsDelete)
    {
        long lngID = 0;

        try
        {
            if (hfIsUpdate.Value == "N")
            {
                lngID = objDB.GerMaxIDNumber("FiscalYearList", "FiscalYrId");
            }
            else
            {
                lngID = Convert.ToInt32(hfID.Value);
            }


            Payroll_FiscalYear objFiscalYr = new Payroll_FiscalYear(lngID.ToString(), "", txtTitle.Text.Trim(), txtDescription.Text.Trim(),
                                                                    txtStartDate.Text.Trim(), txtEndDate.Text.Trim(), (chkIsClosed.Checked == true ? "Y" : "N"), (chkCurrFiscalYr.Checked == true ? "Y" : "N"),
                                                                    "N", Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), "N", "N");

            objPayrollMgr.InsertFiscalYear(objFiscalYr, hfIsUpdate.Value, IsDelete, (chkIsTax.Checked == true ? "Y" : "N"),
                                           (chkIsPF.Checked == true ? "Y" : "N"), (chkIsMed.Checked == true ? "Y" : "N"));

            if (hfIsUpdate.Value == "N")
            {
                lblMsg.Text = "Record Saved Successfully";
            }
            else
            {
                lblMsg.Text = "Record Updated Successfully";
            }
            Common.EmptyTextBoxValues(this);
            this.EntryMode(false);
            this.OpenRecord();
        }
        catch (Exception ex)
        {
            lblMsg.Text = "";
            throw (ex);
        }
    }