コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RoomComponent roomServ = new RoomComponent();

                ddlRoom.DataSource = roomServ.GetEnabledList();
                ddlRoom.DataTextField = "Name";
                ddlRoom.DataValueField = "ID";
                ddlRoom.DataBind();

                ddlRoom.Items.Insert(0,new ListItem("- Please Select -", "", true));

                AssetComponent assetServ = new AssetComponent();

                List<Asset> assetLst = assetServ.GetEnabledList();
                Session["AllAsset"] = assetLst;

                lstAssetList.DataSource = assetLst;
                lstAssetList.DataTextField = "Name";
                lstAssetList.DataValueField = "ID";
                lstAssetList.DataBind();

            }
        }
コード例 #2
0
        public IEnumerable<Entity.Model.Asset> GetList(bool Enabled)
        {
            IAssetComponent component = new AssetComponent();
            IEnumerable<Asset> result = null;

            if (Enabled)
            {
                result = component.GetEnabledList();
            }
            else
            {
                result = component.GetList();
            }
            return result;

         //   throw new NotImplementedException();
        }