public static string GetCancellationPolicy(String travelsName, String busType)
 {
     try
     {
         StringBuilder sbCancellation = new StringBuilder();
         DataTable dtCancellation = null;
         ClsBAL objManabusBAL = new ClsBAL();
         objManabusBAL.api = travelsName.ToString();
         dtCancellation = objManabusBAL.GetCancelPercentageByAPI().Tables[0];
         if (dtCancellation.Rows.Count > 0)
         {
             sbCancellation.Append("<table width='450px' cellpadding='5'><tr><th colspan='2' align='center'>");
             sbCancellation.Append("Operator: " + travelsName + " || Type: " + busType);
             sbCancellation.Append("</th></tr><tr><td colspan='2'> </td></tr><tr><th>Cancellation Time</th><th>Percentage</th></tr>");
             foreach (DataRow dr in dtCancellation.Rows)
             {
                 sbCancellation.Append("<tr><td >");
                 sbCancellation.Append(dr["BeforeTime"]);
                 sbCancellation.Append("</td><td>");
                 sbCancellation.Append(dr["CancePercentage"]);
                 sbCancellation.Append("</td></tr>");
             }
             sbCancellation.Append("<tr><td ></td>");
             sbCancellation.Append("<td align='right'>   <img alt='i' src='Images/001_051.png' onclick='CloseDiv();' title='Click to close'/>   </td>");
             sbCancellation.Append("</tr></table>");
         }
         else
         {
             sbCancellation.Append("<table width='450px' cellpadding='5'><tr><th colspan='2' align='center'>");
             sbCancellation.Append("Operator: " + travelsName + " || Type: " + busType);
             sbCancellation.Append("</th></tr><tr><td colspan='2'> </td></tr><tr><th>Cancellation Time</th><th>Percentage</th></tr>");
             sbCancellation.Append("<tr><td colspan='2'> No Cancellation Policy Found. </td></tr><tr><td ></td>");
             sbCancellation.Append("<td align='right'>   <img alt='i' src='Images/001_051.png' onclick='CloseDiv();' title='Click to close'/>   </td></tr></table>");
         }
         return sbCancellation.ToString();
     }
     catch (Exception)
     {
         throw;
     }
 }
 protected void GetCancellationPolicy(string API)
 {
     try
     {
         ClsBAL ObjManbusBAL = new ClsBAL();
        ObjManbusBAL.api = API;
         DataSet _objDataSet = (DataSet)ObjManbusBAL.GetCancelPercentageByAPI();
         if (_objDataSet != null)
         {
             if (_objDataSet.Tables.Count > 0)
             {
                 gvCancellationDetails.DataSource = _objDataSet.Tables[0];
                 gvCancellationDetails.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
    protected void GetCancellationPolicy(string travelname)
    {
        try
        {
            ClsBAL objManabusBAL = new ClsBAL();
            if (travelname.Length >= 5)
            {
                objManabusBAL.api = travelname.Substring(0, 5);
            }
            else { objManabusBAL.api = travelname; }

            DataSet ObjDataset = (DataSet)objManabusBAL.GetCancelPercentageByAPI();
            if (ObjDataset != null)
            {
                if (ObjDataset.Tables[0].Rows.Count > 0)
                {
                    gvCancellationDetails.DataSource = ObjDataset.Tables[0];
                    gvCancellationDetails.DataBind();
                }
                else { gvCancellationDetails.DataSource = null; gvCancellationDetails.DataBind(); }
            }
            else { gvCancellationDetails.DataSource = null; gvCancellationDetails.DataBind(); }
        }
        catch (Exception ex)
        {
            lblMsg.InnerHtml = ex.Message;
            throw ex;
        }
    }
    protected void GetCancellationPolicy(string travelname)
    {
        try
        {
            objBAL = new ClsBAL();
            if (travelname.Length >= 5)
            {
                objBAL.api = travelname.Substring(0, 5);
            }
            else { objBAL.api = travelname; }
            ObjDataset = (DataSet)objBAL.GetCancelPercentageByAPI();
            if (ObjDataset != null)
            {
                if (ObjDataset.Tables[0].Rows.Count > 0)
                {
                    gvCancellationDetails.DataSource = ObjDataset.Tables[0];
                    gvCancellationDetails.DataBind();
                }
            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
        finally
        {

            if (ObjDataset != null)
            {
                ObjDataset = null;
            }

        }
    }
    protected void GetCancellationPolicy(string travelname)
    {
        try
        {

            ClsBAL ObjManbusBAL = new ClsBAL();
            ObjManbusBAL.api =Convert.ToString(travelname);
            DataSet ds = (DataSet)ObjManbusBAL.GetCancelPercentageByAPI();
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    gvCancellationDetails.DataSource = ds.Tables[0];
                    gvCancellationDetails.DataBind();
                }
                else { gvCancellationDetails.DataSource = null; gvCancellationDetails.DataBind(); }
            }
            else { gvCancellationDetails.DataSource = null; gvCancellationDetails.DataBind(); }
        }
        catch (Exception ex)
        {

            throw ex;
        }
        finally
        {

            if (ds != null)
            {
                ds = null;
            }

        }
    }
    protected void GetCancellationPolicy(string API)
    {
        try
        {
            ObjManbusBAL = new ClsBAL();
            //if (API.Length >= 5)
            //{
            //    ObjManbusBAL.api = API.Substring(0, 5);
            //}
            //else { ObjManbusBAL.api = API; }
            ObjManbusBAL.api = API;
            _objDataSet = (DataSet)ObjManbusBAL.GetCancelPercentageByAPI();
            if (_objDataSet != null)
            {
                if (_objDataSet.Tables.Count > 0)
                {
                    gvCancellationDetails.DataSource = _objDataSet.Tables[0];
                    gvCancellationDetails.DataBind();
                }
            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
        finally
        {

            if (_objDataSet != null)
            {
                _objDataSet = null;
            }
        }
    }