当前位置: 首页>>代码示例>>C#>>正文


C# ClsBAL.GetCities方法代码示例

本文整理汇总了C#中BAL.ClsBAL.GetCities方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetCities方法的具体用法?C# ClsBAL.GetCities怎么用?C# ClsBAL.GetCities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BAL.ClsBAL的用法示例。


在下文中一共展示了ClsBAL.GetCities方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            kesineniDetails = new KesineniDetails();
            kesineniDetails.LoginId = KesineniConstants.LoginId;
            kesineniDetails.PassWord = KesineniConstants.Password;

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

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

            objCommon = new KABCommon(kesineniDetails, abhiBusDetails, bitlaDetails);
            this.Page.Title = "LoveJourney - Bus - Search";

            if (!IsPostBack)
            {
                getservices();
                if (val != "true")
                {
                    if (Session["Role"] != null)
                    {
                        CheckPermission("Book Ticket", Session["Role"].ToString());

                        objDataSet = null;
                        if (objDataSet == null)
                        {
                            objBAL = new ClsBAL();
                            objDataSet = objBAL.GetCities();
                            //HttpContext.Current.Session["Cities"] = objDataSet;

                        }
                        if (objDataSet != null)
                        {
                            if (objDataSet.Tables.Count > 0)
                            {
                                if (objDataSet.Tables[0].Rows.Count > 0)
                                {
                                    ddlSources.DataSource = objDataSet.Tables[0];
                                    ddlSources.DataTextField = "SourceName";
                                    ddlSources.DataValueField = "ID";
                                    ddlSources.DataBind();

                                    ddlDestinations.Items.Clear();
                                    ddlDestinations.DataSource = objDataSet.Tables[0];
                                    ddlDestinations.DataTextField = "SourceName";
                                    ddlDestinations.DataValueField = "ID";
                                    ddlDestinations.DataBind();

                                    if (Request.QueryString.Count == 0)
                                    {
                                        ddlSources.SelectedValue = ddlSources.Items.FindByText("Hyderabad").Value;
                                        ddlDestinations.SelectedValue = ddlDestinations.Items.FindByText("Bangalore").Value;
                                    }

                                    if (ddlSources.SelectedItem != null)
                                    {
                                        Session["From"] = ddlSources.SelectedItem.Text.ToString();
                                        Session["To"] = ddlDestinations.SelectedItem.Text.ToString();
                                    }
                                }
                            }
                        }

                        Session["DOJ"] = txtFromDate.Text.ToString();
                        Session["From"] = ddlSources.SelectedItem.Text.ToString();
                        Session["To"] = ddlDestinations.SelectedItem.Text.ToString();
                    }
                    else
                    {
                        Response.Redirect("~/Default.aspx", false);
                    }
                }
                else
                {
                    lblMainMsg.Text = "This Service is temporarily unavaliable";
                    lblMainMsg.ForeColor = System.Drawing.Color.Maroon;
                    tdmsg.Visible = true;
                    pnlBook.Visible = false;

                }
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:91,代码来源:Bus_Search1.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        lblUPDOWNDate.Text = lblUPDOWNDateReturn.Text = "";
        try
        {
            if (!IsPostBack)
            {
                HttpContext.Current.Session["travelOperatorSelected"] = "";

                BaseClass baseCls = new BaseClass();
                baseCls = (BaseClass)(HttpContext.Current.Session["Parameters"]);

                lblRoute.Text = baseCls.preLoadParams[4].Trim() + "<span style='color:Blue;'> to </span>" + baseCls.preLoadParams[5].Trim()
                    + "<span style='color:Blue;'> on </span>" + baseCls.preLoadParams[2].Trim();

                Boolean tempParams = false;
                //Loop through baseCls.preLoadParams and check if all required values are set
                foreach (String item in baseCls.preLoadParams)
                {
                    //If return type is one way ReturnJourneyDate is optional
                    if (baseCls.preLoadParams[6].ToUpper().Equals("ONEWAY"))
                        if (baseCls.preLoadParams[3].Trim() == String.Empty)
                            continue;

                    if (item.Trim() == String.Empty)
                    {
                        tempParams = true;
                        break;
                    }
                }

                //If all required parameters are not set, reqirect user to default page.
                if (tempParams)
                {
                    Response.Redirect("~/Default.aspx", false);
                }
                else
                {
                    HttpContext.Current.Session["btnType"] = "btnContinue";

                    #region Load Sources and destinations in dropdowns

                    if (ObjDataset == null)
                    {
                        objBAL = new ClsBAL();
                        ObjDataset = objBAL.GetCities();
                    }
                    if (ObjDataset != null)
                    {
                        if (ObjDataset.Tables.Count > 0)
                        {
                            if (ObjDataset.Tables[0].Rows.Count > 0)
                            {
                                ddlSources.DataSource = ObjDataset.Tables[0];
                                ddlSources.DataTextField = "SourceName";
                                ddlSources.DataValueField = "ID";
                                ddlSources.DataBind();
                                ddlSources.Items.Insert(0, "----------");
                                //Session["sesDTDestinations"] = ObjDataset.Tables[0];
                            }
                        }
                    }

                    #endregion

                    DateTime dt = Convert.ToDateTime(baseCls.preLoadParams[2].ToString());
                    string sss = dt.ToString("dd-MMMM-yyyy");
                    lblJD.Text = sss;

                    ListItem lt = ddlSources.Items.FindByText(baseCls.preLoadParams[4].ToString());
                    ddlSources.SelectedValue = lt.Value;

                    DataTable dtDestinations = ObjDataset.Tables[0];//(DataTable)Session["sesDTDestinations"];
                    StringBuilder sbTravels = new StringBuilder();
                    if (dtDestinations.Rows.Count > 0)
                    {
                        sbTravels.Append("<select id=\"ddldestinationsDiv\" name=\"ddldestinationsDiv\" class=\"Dropdownlist\" >");

                        sbTravels.Append("<option value=''>----------</option>");
                        foreach (DataRow item in dtDestinations.Rows)
                        {
                            if (baseCls.preLoadParams[5].ToString() != item["SourceName"].ToString())
                            {
                                sbTravels.Append("<option value=" + item["ID"].ToString() + ">" + item["SourceName"].ToString() + "</option>");
                            }
                            else
                            {
                                sbTravels.Append("<option selected='selected' value=" + item["ID"].ToString() + ">" + item["SourceName"].ToString() + "</option>");
                            }
                        }
                        sbTravels.Append("</select>");
                    }
                    destinationsDiv.InnerHtml = sbTravels.ToString();

                    if (baseCls.preLoadParams[6].ToString() == "OneWay")
                    {
                        lblOnwardJourneyHeader.Visible = false;
                    }
                    else { lblOnwardJourneyHeader.Visible = true; }
                }
//.........这里部分代码省略.........
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:101,代码来源:ShowTrips.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.UserAgent.IndexOf("AppleWebKit") > 0) { Request.Browser.Adapters.Clear(); }
        //kesineniDetails = new KesineniDetails();
        //kesineniDetails.LoginId = KesineniConstants.LoginId;
        //kesineniDetails.PassWord = KesineniConstants.Password;

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

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

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

        lblUPDOWNDate.Text = lblUPDOWNDateReturn.Text = "";

        try
        {
            if (!IsPostBack)
            {
                if (Session["UserName"] != null)
                {
                    if (Session["Role"].ToString() == "Admin" || Session["Role"].ToString() == "CSE")
                    {
                        showmenus();
                        lblUsername.Text = "Welcome " + Session["UserName"].ToString();
                    }
                    else if (Session["Role"].ToString() == "User")
                    {
                        showmenus();
                        lblUsername.Text = "Welcome " + Session["UserName"].ToString();
                    }

                }
                BaseClass baseCls = new BaseClass();
                baseCls = (BaseClass)(HttpContext.Current.Session["Parameters"]);
                travelOperatorSelected = "";

                lblRoute.Text = baseCls.preLoadParams[4].Trim() + "<span style='color:Black;'> <i>to</i> </span>" + baseCls.preLoadParams[5].Trim()
                    + "<span style='color:Black;'> <i>on</i> </span>" + baseCls.preLoadParams[2].Trim();

                Boolean tempParams = false;
                //Loop through baseCls.preLoadParams and check if all required values are set
                foreach (String item in baseCls.preLoadParams)
                {
                    //If return type is one way ReturnJourneyDate is optional
                    if (baseCls.preLoadParams[6].ToUpper().Equals("ONEWAY"))
                        if (baseCls.preLoadParams[3].Trim() == String.Empty)
                            continue;

                    if (item.Trim() == String.Empty)
                    {
                        tempParams = true;
                        break;
                    }
                }

                //If all required parameters are not set, reqirect user to default page.
                if (tempParams)
                {
                    Response.Redirect("~/Default.aspx", false);
                }
                else
                {
                    HttpContext.Current.Session["btnType"] = "btnContinue";

                    #region Load Sources and destinations in dropdowns

                    if (ObjDataset == null)
                    {
                        objManabusBAL = new ClsBAL();
                        ObjDataset = objManabusBAL.GetCities();
                    }
                    if (ObjDataset != null)
                    {
                        if (ObjDataset.Tables.Count > 0)
                        {
                            if (ObjDataset.Tables[0].Rows.Count > 0)
                            {
                                ddlSources.DataSource = ObjDataset.Tables[0];
                                ddlSources.DataTextField = "SourceName";
                                ddlSources.DataValueField = "ID";
                                ddlSources.DataBind();
                                ddlSources.Items.Insert(0, "----------");
                                //Session["sesDTDestinations"] = ObjDataset.Tables[0];
                            }
                        }
                    }

                    #endregion

                    DateTime dt = Convert.ToDateTime(baseCls.preLoadParams[2].ToString());
                    string sss = dt.ToString("dd-MMMM-yyyy");
                    lblJD.Text = sss;

                    ListItem lt = ddlSources.Items.FindByText(baseCls.preLoadParams[4].ToString());
                    ddlSources.SelectedValue = lt.Value;

//.........这里部分代码省略.........
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:101,代码来源:Show_Trips.aspx.cs


注:本文中的BAL.ClsBAL.GetCities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。