/// <summary> /// /// </summary> private void BindDuringWater() { DataTable dwtbl = DuringWaterDBI.GetDuringDataTable(); NameIDPairCollection nameids = NameIDPairFactory.Create(dwtbl, YongShuiGuanLiDBI.DBNames.tblDuringWater.Name, YongShuiGuanLiDBI.DBNames.tblDuringWater.DuringWaterID); nameids.Insert(0, NameIDPair.ALL); this.ddlDuringWaterName.DataSource = nameids; this.ddlDuringWaterName.DataTextField = "Name"; this.ddlDuringWaterName.DataValueField = "ID"; this.ddlDuringWaterName.DataBind(); }
/// <summary> /// /// </summary> /// <returns></returns> static private object GetStationDataSource(int orgaizationID, bool isAddAll) { //int waterUserID = GetSelectedOrganizationID(); int waterUserID = orgaizationID; DataTable tbl = StationDeviceDBI.GetStationDeviceDataTable(waterUserID); // 2011-06-03 stationname -> stationID // NameIDPairCollection c = NameIDPairFactory.Create(tbl, "StationName", "StationID"); if (isAddAll) { c.Insert(0, NameIDPair.ALL); } return(c); }