Beispiel #1
0
        private void ele_Click(object sender, HtmlElementEventArgs e)
        {
            HtmlElement ele = sender as HtmlElement;

            if (ele == null)
            {
                return;
            }
            SetOutCityItem item = _startCityDic[ele.Id];

            if (item == null)
            {
                return;
            }
            if (item.Children == null || item.Children.Count == 0)
            {
                // GetElementById("city1").InnerText = item.CityName;
                InvokeScript("SelectSuccess", new object[] { item.CityId, item.CityName, "city1", "startSel" });
                InvokeScript("SelectSuccess", new object[] { "", "", "city2", "endSel" });
                _carEntity.SelectStartCity = item;
            }
            else
            {
                InitStartSel(item.Children);
            }
        }
Beispiel #2
0
        void Confirm_Click(object sender, HtmlElementEventArgs e)
        {
            try
            {
                //string startCity = GetElementById("city1").GetAttribute("value");
                string startCityId = GetElementById("city1").GetAttribute("alt");
                string endCity     = GetElementById("city2").GetAttribute("value");

                string date = GetElementById("departTime").GetAttribute("value");

                if (string.IsNullOrEmpty(startCityId) || string.IsNullOrEmpty(endCity) || string.IsNullOrEmpty(date))
                {
                    GetElementById("message").InnerText = "数据不能为空!";
                    return;
                }
                SetOutCityItem startCityItem = _startCityDic[startCityId];
                _carEntity._BstTicketByCityRequest            = new BstTicketByCityRequest();
                _carEntity._BstTicketByCityRequest.CityId     = startCityItem.CityId;
                _carEntity._BstTicketByCityRequest.CityName   = startCityItem.CityName;
                _carEntity._BstTicketByCityRequest.StopName   = endCity;
                _carEntity._BstTicketByCityRequest.RidingDate = date;
                _carEntity._BstTicketByCityRequest.CarryStaId = _carEntity.CarryStaId;
                StartActivity("正在查询车票信息");
            }
            catch (Exception)
            {
            }
        }
Beispiel #3
0
        private void InitStartSel(List <SetOutCityItem> items)
        {
            //string value = "<table style="width:100%;"><tr ><td id="0" class="landi_selectTr">aaaaaaaa</td><td id="1" class="landi_selectTr">aaaaaaaa</td><td id="2" class="landi_selectTr">aaaaaaaa</td><td id="2"lass="landi_selectTr">aaaaaaaa</d></tr></table>";

            string        starStr = "<td id=\"{0}\" class=\"landi_selectTr\">{1}</td>";
            StringBuilder allSb   = new StringBuilder();
            StringBuilder sb      = new StringBuilder();

            for (int i = 0; i < items.Count; i++)
            {
                SetOutCityItem item = items[i];
                sb.Append(string.Format(starStr, item.CityId, item.CityName));

                //if ((i+1)%4 == 0)
                //{
                string temp = string.Format("<tr>" + sb.ToString() + "</tr>");
                sb = new StringBuilder();
                allSb.Append(temp);
                // }
            }
            string res = sb.ToString();

            if (!string.IsNullOrEmpty(res))
            {
                allSb.Append(string.Format("<tr>" + res + "</tr>"));
            }
            starStr = "<div style=\" position:absolute;width:50px;height:407px; left: 814px; top: 1px;\">	<div class=\"img_pre\" onclick=\"Scorll('start',-50)\"></div><div  class=\"img_next\" class=\"img_next\" onclick=\"Scorll('start',50)\"/>></div></div><div id=\"Ret\" style=\"height:40px; background-color:#2275BA; width:100%\" >	<img src=\"../images/car/left.png\" alt=\"\" style=\"height:30px; width:30px; padding-left:10px; padding-top:5px;\"/></div><div id=\"start\" style=\"overflow-y:hidden; overflow-x:hidden;height: 367px;\"><table style=\"width:100%;  \">"+ allSb.ToString() + "</table><div style=\"float:right; padding-top:30px; padding-right:30px;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td onclick=\" var arr=new Array('endSel','startSel','cover'); hideElement(arr);\"></td></tr></table></div></div>";
            GetElementById("startSel").InnerHtml = starStr;

            HtmlElementCollection eles = GetElementById("startSel").GetElementsByTagName("td");

            foreach (HtmlElement ele in eles)
            {
                ele.Click += ele_Click;
            }
            GetElementById("Ret").Click += CarQueryInputDeal_Click;
        }