Ejemplo n.º 1
0
    protected void qdz_SelectedIndexChanged(object sender, EventArgs e)
    {
        IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret);
        CoachStartStationsListRequest  req      = new CoachStartStationsListRequest();
        CoachStartStationsListResponse response = client.Execute(req, BMEshenghuo.accessToken);

        if (!response.IsError)
        {
            List <Qianmi.Api.Domain.Elife.CoachStartStation> alist = response.Stations;
            int i = 0;
            foreach (Qianmi.Api.Domain.Elife.CoachStartStation item in alist)
            {
                if (qdz.SelectedValue == alist[i].Province.ToString())
                {
                    //cfcs.DataSource = item.Cities;
                    cfcs.Items.Clear();
                    for (int j = 0; j < item.Cities.Count; j++)
                    {
                        cfcs.Items.Add(item.Cities[j].City.Name);
                    }
                    //cfcs.DataValueField = item.Cities[0].City.Name;
                    //cfcs.DataBind();
                    if (item.Cities[0].Counties != null)
                    {
                        xz.DataSource     = item.Cities[0].Counties;
                        xz.DataTextField  = "Name";
                        xz.DataValueField = "Code";
                        xz.DataBind();
                    }
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#yc1').show();</script>", false);
                }
                i++;
            }
        }
    }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Permissions.MemRedirect(Page, Permissions.redirUrl);
     AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
     if (!IsPostBack)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('暂未开放.');window.location.href='index.aspx';</script>", false);
         var aa = Cxhyqx.GetCxhyqx(Session["member"].ToString(), 1);
         if (!aa)
         {
             //Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('设置成功!');window.location.href='AuthoritySet.aspx'</script>");
             ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000847", "对不起,您没有权限!") + "');window.location.href='index.aspx';</script>", false);
         }
         IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret);
         CoachStartStationsListRequest  req      = new CoachStartStationsListRequest();
         CoachStartStationsListResponse response = client.Execute(req, BMEshenghuo.accessToken);
         if (!response.IsError)
         {
             qdz.DataSource     = response.Stations;
             qdz.DataTextField  = "Province";
             qdz.DataValueField = "Province";
             qdz.DataBind();
             qrsf.Visible = true;
         }
     }
     Translations();
 }