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

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

            if (chkPercent.Checked == true)
            {
                strSHEADID = ddlPercentSalHead.SelectedValue.ToString();
            }
            else
            {
                strSHEADID = null;
            }

            Payroll_BonusPak objBonus = new Payroll_BonusPak(lngID.ToString(), txtHeadTitle.Text.Trim(), txtDescription.Text.Trim(),
                                                             txtBonusAmount.Text, (chkPercent.Checked == true ? "Y" : "N"), strSHEADID, txtNoOfPayment.Text, ddlCurrency.SelectedValue.ToString(),
                                                             (chkInActive.Checked == true ? "N" : "Y"), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), "N", "N");

            objPayrollMgr.InsertBonusPackage(objBonus, hfIsUpdate.Value, IsDelete);

            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);
        }
    }