protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        try
        {
            IncentiveBusiness obj = new IncentiveBusiness();
            IncentivePoint    j   = new IncentivePoint();

            if (txtMemberId.Text.Trim() == "")
            {
                string CloseWindow1 = "alert('Please enter member id')";
                ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                return;
            }
            string memberid      = txtMemberId.Text.Trim();
            string year          = DdlYear.SelectedValue;
            string pointsAwarded = txtPointsAwarded.Text.Trim();
            j.MemberId = memberid;
            j.Year     = Convert.ToInt32(year);


            j.Points         = Convert.ToDouble(pointsAwarded);
            j.TotalPoint     = j.Points;
            j.ThresholdPoint = j.Points;
            string currentbalance = obj.SelectMemberCurrentBal(memberid);
            j.CurrentBalance = Convert.ToDouble(currentbalance);
            j.CurrentBalance = j.CurrentBalance + j.TotalPoint;
            j.Remarks        = txtRemarks.Text;
            bool result = false;


            result = obj.AdditionalPointAward(memberid, j);

            if (result == true)
            {
                SendMail();
                string CloseWindow1 = "alert('Additional Points Saved successfully')";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
                btnSave.Enabled       = false;
                txtPointsAwarded.Text = "";
                txtMemberId.Text      = "";
                txtcurbal.Text        = "";
                txtRemarks.Text       = "";
                lblNote.Visible       = false;
                lblNote1.Visible      = false;
                DdlYear.Items.Clear();
            }
            else
            {
                string CloseWindow1 = "alert('problem while saving')";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
                btnSave.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            string CloseWindow1 = "alert('problem while saving points')";
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "CloseWindow", CloseWindow1, true);
            btnSave.Enabled = true;
            log.Error(ex.Message);
            log.Error(ex.StackTrace);
        }
    }