示例#1
0
        public string StationsJson()
        {
            var    stationBLL     = new StationLogic();
            var    AllStations    = stationBLL.GetAllStationNames();
            var    jsonSerializer = new JavaScriptSerializer();
            string json           = jsonSerializer.Serialize(AllStations);

            return(json);
        }
示例#2
0
        public void loadStationList(DropDownList ddl_station)
        {
            StationLogic stationLogic = new StationLogic();
            DataTable    dt           = stationLogic.stationQuery();

            ddl_station.Items.Clear();
            ddl_station.Items.Add(new ListItem("请选择维修站", "0"));
            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    ddl_station.Items.Add(new ListItem(dr["StationCode"].ToString(), dr["Id"].ToString()));
                }
            }
        }