public static IKalladaAPILayer GetKalladaAPILayerObject()
 {
     if (m_KalladaAPILayer == null)
     {
         m_KalladaAPILayer = new KalladaAPILayer();
     }
     return m_KalladaAPILayer;
 }
        public KABCommon(KesineniDetails kesineniDetails, AbhiBusDetails abhiBusDetails, BitlaDetails bitlaDetails)
        {
            try
            {
                objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
                objBitlaAPILayer.ApiKey = bitlaDetails.ApiKey;
                objBitlaAPILayer.URL = bitlaDetails.Url;

                objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
                objKesineniAPILayer.LoginId = kesineniDetails.LoginId;
                objKesineniAPILayer.Password = kesineniDetails.PassWord;

                objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();

                objKalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();

                objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
                objTicketGooseAPILayer.UserId = "ssdtech";
                objTicketGooseAPILayer.Password = "******";
            }
            catch (Exception)
            {
                throw;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
        objBitlaAPILayer.ApiKey = BitlaConstants.API_KEY;
        objBitlaAPILayer.URL = BitlaConstants.URL;

        objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
        objKesineniAPILayer.LoginId = KesineniConstants.LoginId;
        objKesineniAPILayer.Password = KesineniConstants.Password;

        objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();
        objkalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();

        objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
        objTicketGooseAPILayer.UserId = TicketGooseConstants.USERID;
        objTicketGooseAPILayer.Password = TicketGooseConstants.PASSWORD;

        this.Page.Title = "LoveJourney - Bus - CancelTicket";
        // if (Session["BusAgentStatus"] == null || Session["UserID"] == null || Session["Role"] == null) { Response.Redirect("~/Default.aspx", false); return; }

        if (!IsPostBack)
        {
            pnlcancel.Visible = true;
            if (Request.QueryString["RefNo"] != null && Request.QueryString["EmID"] != null)
            {
                txtEmailID.Text = Request.QueryString["EmID"].ToString();
                txtMBRefNo.Text = Request.QueryString["RefNo"].ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
        objBitlaAPILayer.ApiKey = BitlaConstants.API_KEY;
        objBitlaAPILayer.URL = BitlaConstants.URL;

        objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
        objKesineniAPILayer.LoginId = KesineniConstants.LoginId;
        objKesineniAPILayer.Password = KesineniConstants.Password;

        objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();
        objkalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();
        this.Page.Title = "LoveJourney - Bus - CancelTicket";

        objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
        objTicketGooseAPILayer.UserId = TicketGooseConstants.USERID;
        objTicketGooseAPILayer.Password = TicketGooseConstants.PASSWORD;

        if (!IsPostBack)
        {
            CheckPermission("Cancel Ticket", Session["Role"].ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
        objBitlaAPILayer.ApiKey = BitlaConstants.API_KEY;
        objBitlaAPILayer.URL = BitlaConstants.URL;
        objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
        objKesineniAPILayer.LoginId = KesineniConstants.LoginId;
        objKesineniAPILayer.Password = KesineniConstants.Password;
        objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();
        objKalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();
        objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
        objTicketGooseAPILayer.UserId = TicketGooseConstants.USERID;
        objTicketGooseAPILayer.Password = TicketGooseConstants.PASSWORD;
        try
        {
            if (!IsPostBack)
            {
                BookTicket();
            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
        objBitlaAPILayer.ApiKey = BitlaConstants.API_KEY;
        objBitlaAPILayer.URL = BitlaConstants.URL;
        objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
        objKesineniAPILayer.LoginId = KesineniConstants.LoginId;
        objKesineniAPILayer.Password = KesineniConstants.Password;
        objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();

        kesineniDetails = new KesineniDetails();
        kesineniDetails.LoginId = KesineniConstants.LoginId;
        kesineniDetails.PassWord = KesineniConstants.Password;

        abhiBusDetails = new AbhiBusDetails();
        abhiBusDetails.Url = AbhiBusConstants.URL;

        objKalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();

        objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
        objTicketGooseAPILayer.UserId = TicketGooseConstants.USERID;
        objTicketGooseAPILayer.Password = TicketGooseConstants.PASSWORD;

        bitlaDetails = new BitlaDetails();
        bitlaDetails.ApiKey = BitlaConstants.API_KEY;
        bitlaDetails.Url = BitlaConstants.URL;

        objCommon = new KABCommon(kesineniDetails, abhiBusDetails, bitlaDetails);

        if (!IsPostBack)
        {
            this.Page.Title = "LoveJourney - Bus - ProceedToBook";
            if (
                Session["ddlSources"] != null && Session["ddlDestinations"] != null && Session["DOJ"] != null
                   && Session["From"] != null && Session["To"] != null
                   && Session["OneWayOrRoundTrip"] != null && Session["ddlSourcesReturn"] != null
                   && Session["ddlDestinationsReturn"] != null && Session["DOJReturn"] != null
                   && Session["FromReturn"] != null && Session["ToReturn"] != null
                )
            {
                MVIEW.ActiveViewIndex = 0;
                ViewState["ddlSources"] = Session["ddlSources"].ToString();
                ViewState["ddlDestinations"] = Session["ddlDestinations"].ToString();
                ViewState["DOJ"] = Session["DOJ"].ToString();
                ViewState["From"] = Session["From"].ToString();
                ViewState["To"] = Session["To"].ToString();

                ViewState["ddlSourcesReturn"] = Session["ddlSourcesReturn"].ToString();
                ViewState["ddlDestinationsReturn"] = Session["ddlDestinationsReturn"].ToString();
                ViewState["DOJReturn"] = Session["DOJReturn"].ToString();
                ViewState["FromReturn"] = Session["FromReturn"].ToString();
                ViewState["ToReturn"] = Session["ToReturn"].ToString();

                ViewState["OneWayOrRoundTrip"] = Session["OneWayOrRoundTrip"].ToString();

                lblMsg.Text = "";
                DataTable dt = (DataTable)Session["dtTicketInfo"];
                pnlOnwardTicketDetails.Visible = true;
                pnlreturnticketdetails.Visible = false;
                lblRouteValue.Text = dt.Rows[0]["Route"].ToString();
                lblJourneyDate.Text = dt.Rows[0]["JourneyDate"].ToString();
                lblBusOperator.Text = dt.Rows[0]["Travels"].ToString();
                lblBusType.Text = dt.Rows[0]["BusType"].ToString();
                lblSeatNos.Text = dt.Rows[0]["SeatNos"].ToString();
                lblFare.Text = dt.Rows[0]["TotalFare"].ToString();
                lblTotalAmountPayable.Text = dt.Rows[0]["TotalFare"].ToString();
                lblBoardingPoint.Text = dt.Rows[0]["BoardingPoint"].ToString();
                ViewState["CashCouponcode"] = null;
                ViewState["Promocode"] = null;
                DataTable dt1 = null;
                DataTable dtseats = new DataTable();
                dtseats.Columns.Add("SeatNos");
                char[] separator = { ',' };
                string[] seatnos = lblSeatNos.Text.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                foreach (string item in seatnos)
                {
                    DataRow dr = dtseats.NewRow();
                    dr["SeatNos"] = item;
                    dtseats.Rows.Add(dr);
                }

                if (dtseats != null)
                {
                    ddlPrimaryPassenger.DataSource = dtseats;
                    ddlPrimaryPassenger.DataTextField = "SeatNos";
                    ddlPrimaryPassenger.DataBind();
                    rptPassengersonward.DataSource = dtseats;
                    rptPassengersonward.DataBind();
                }
                int NoOFSeats = seatnos.Length;
                if (NoOFSeats == 1)
                {
                    pnlPriamryPassenger.Visible = false;
                }
                if (ViewState["OneWayOrRoundTrip"].ToString() == "RoundTrip")
                {
                    pnlOnwardTicketDetails.Visible = true;
                    pnlreturnticketdetails.Visible = true;
                    dt1 = (DataTable)Session["dtTicketInfoReturn"];
                    lblRoutereturn.Text = dt1.Rows[0]["Route"].ToString();
                    lblJourneydatereturn.Text = dt1.Rows[0]["JourneyDate"].ToString();

                    if (Convert.ToDateTime(lblJourneyDate.Text.ToString()) >= Convert.ToDateTime(lblJourneydatereturn.Text.ToString()))
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('" + "ReturnDate should be greater than TravelingDate." + "');</script>", false);
                        return;
                    }


                    lblbusoperatorreturn.Text = dt1.Rows[0]["Travels"].ToString();
                    lblbustypereturn.Text = dt1.Rows[0]["BusType"].ToString();
                    lblseatNosReturn.Text = dt1.Rows[0]["SeatNos"].ToString();
                    lbltotalFarereturn.Text = dt1.Rows[0]["TotalFare"].ToString();
                    double totalamntPayable = Convert.ToDouble(dt1.Rows[0]["TotalFare"].ToString()) + Convert.ToDouble(dt.Rows[0]["TotalFare"].ToString());
                    lblTotalAmountPayable.Text = Convert.ToString(totalamntPayable);
                    lblBoardingpointreturn.Text = dt1.Rows[0]["BoardingPoint"].ToString();
                    DataTable dtseatsreturn = new DataTable();
                    dtseatsreturn.Columns.Add("SeatNosreturn");

                    string[] seatnosreturn = lblseatNosReturn.Text.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string item in seatnosreturn)
                    {
                        DataRow dr = dtseats.NewRow();
                        DataRow drreturn = dtseatsreturn.NewRow();
                        dr["SeatNos"] = item;
                        drreturn["SeatNosreturn"] = item;
                        dtseats.Rows.Add(dr);
                        dtseatsreturn.Rows.Add(drreturn);
                    }
                    if (dtseats != null && dtseatsreturn != null)
                    {
                        ddlPrimaryPassenger.DataSource = dtseats.DefaultView.ToTable(true, "SeatNos");
                        ddlPrimaryPassenger.DataTextField = "SeatNos";
                        ddlPrimaryPassenger.DataBind();
                        rptrPsgrDetailsReturn.DataSource = dtseatsreturn;
                        rptrPsgrDetailsReturn.DataBind();
                    }
                    NoOFSeats = seatnos.Length + seatnosreturn.Length;
                    if (NoOFSeats == 1)
                    {
                        pnlPriamryPassenger.Visible = false;
                    }
                }
            }
            else { Response.Redirect("~/Users/Bus/Bus_Search.aspx", false); }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objBitlaAPILayer = BitlaFactoryManager.GetBitlaAPILayerObject();
        objBitlaAPILayer.ApiKey = BitlaConstants.API_KEY;
        objBitlaAPILayer.URL = BitlaConstants.URL;
        objKesineniAPILayer = KesineniFactoryManager.GetKesineniAPILayerObject();
        objKesineniAPILayer.LoginId = KesineniConstants.LoginId;
        objKesineniAPILayer.Password = KesineniConstants.Password;
        objAbhiBusAPILayer = AbhiBusFactoryManager.GetAbhiBusAPILayerObject();
        objKalladaAPILayer = KalladaFactoryManager.GetKalladaAPILayerObject();
        objTicketGooseAPILayer = TicketGooseFactoryManager.GetTicketGooseAPILayerObject();
        objTicketGooseAPILayer.UserId = TicketGooseConstants.USERID;
        objTicketGooseAPILayer.Password = TicketGooseConstants.PASSWORD;
        if (!IsPostBack)
        {
            pnlmail.Visible = false;
        }

        populate(sender, e);
    }