protected void btnupdatePatent_Click(object sender, EventArgs e)
    {
        //if (!Page.IsValid)
        //{
        //    return;
        //}
        try
        {
            if (txttotalPointPatent.Text.Trim() == "")
            {
                string CloseWindow1 = "alert('Please enter total point')";
                ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                return;
            }
            if (txtPatentRemarks.Text.Trim() == "")
            {
                string CloseWindow1 = "alert('Please enter Remarks')";
                ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                return;
            }



            bool result = B.CheckPatentId(txtreferencePatent.Text.Trim(), txtmemberPatent.Text.Trim());
            if (result == false)
            {
                string CloseWindow1 = "alert('Invalid reference id')";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                return;
            }
            obj.MemberId       = txtmemberPatent.Text.Trim();
            obj.CurrentBalance = Convert.ToDouble(TxtcurrentPatent.Text.Trim());
            //if (txtBasePoint.Text.Trim() != "")
            //{
            //    obj.BasePoint = Convert.ToDouble(txtBasePoint.Text.Trim());
            //}
            //if (txtSNIPSJRPoint.Text.Trim() != "")
            //{
            //    obj.SNIPSJRPoint = Convert.ToDouble(txtSNIPSJRPoint.Text.Trim());
            //}
            //point 3 (crosses 6 publication) is awarded once in a year
            //if (txtThresholdPoint.Text.Trim() != "")
            //{
            //    obj.ThresholdPoint = Convert.ToDouble(txtThresholdPoint.Text.Trim());
            //}
            obj.TotalPoint      = Convert.ToDouble(txttotalPointPatent.Text);
            obj.ReferenceNumber = txtreferencePatent.Text.Trim();
            obj.Remarks         = txtPatentRemarks.Text.Trim();
            obj.CurrentBalance  = obj.CurrentBalance + obj.TotalPoint;
            obj.TransactionType = "ADJ";
            bool result1 = B.UpdateCurBal(obj);     //Business layer

            if (result1 == true)
            {
                string CloseWindow1 = "alert('Incentive Point Saved successfully')";
                //ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
                btnupdatePatent.Enabled = false;
                TxtcurrentPatent.Text   = obj.CurrentBalance.ToString();
                //txtBasePoint.Text = "";
                //txtSNIPSJRPoint.Text = "";
                txtPatentRemarks.Text    = "";
                txttotalPointPatent.Text = "";
            }
            else
            {
                string CloseWindow1 = "alert('Incentive Point Saved successfully')";
                // ScriptManager.RegisterStartupScript(EditUpdatePanel, EditUpdatePanel.GetType(), "alert", CloseWindow1, true);
                btnupdatePatent.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.StackTrace);
            log.Error(ex.Message);
            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error')</script>");
        }
    }