protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            objBAL = new ClsBAL();
            string str = objBAL.Updatecancelstatus(Session["refno"].ToString(), "Booked");
            //lblCancel.Text = str;

                BindTicketDetails();

        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        objResult.ReferanceId = txtBookingRefNo.Text;
        objResult.EmailId = txtEmailId.Text;
        objResult.ScreenInd = blossom.GetCancellationdetails;

        _objDataSet = (DataSet)objResult.fnGetData();
        if (_objDataSet != null)
        {
            if (_objDataSet.Tables[0].Rows[0]["Status"].ToString() == "Canceled")
            {
                lblCancel.Text = "Ticket Has been already cancelled";
                lblCancel.ForeColor = System.Drawing.Color.Red;
                return;
            }
            string actualfare = _objDataSet.Tables[0].Rows[0]["BasicFare"].ToString();
            comm = 10.0;
            double cancellationAmount = Convert.ToDouble(actualfare) * comm / 100;
            double refundTotalAmount = Convert.ToDouble(actualfare) - cancellationAmount;
            ClsBAL objBAL;
            objBAL = new ClsBAL();
            objBAL.AdjustAgentBalance1(txtBookingRefNo.Text.Trim().ToString(),
                Convert.ToDouble(refundTotalAmount), Convert.ToDouble(cancellationAmount),
                Convert.ToInt32(Session["UserID"].ToString()));

            DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));

            string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
            Label lbl = (Label)this.Master.FindControl("lblBalance");
            lbl.Text = balance.ToString();
            Session["Balance"] = balance;

            string str=objBAL.Updatecancelstatus(txtBookingRefNo.Text,"Canceled");
            lblCancel.Text = str;
            lblCancel.ForeColor = System.Drawing.Color.Green;

            txtEmailId.Text = txtBookingRefNo.Text = "";

        }
        else
        {
            lblCancel.Text = "Invalid Ref/EmailId";
        }
    }