示例#1
0
 private void BindStore()
 {
     DropDownListStore.DataSource     = Store.GetStoreList();
     DropDownListStore.DataTextField  = "Description";
     DropDownListStore.DataValueField = "StoreId";
     DropDownListStore.DataBind();
     DropDownListStore.Items.Insert(0, new ListItem("Please select", "0"));
 }
示例#2
0
        private void BindStoreList()
        {
            DropDownListStore.DataSource     = Store.GetStoreList();
            DropDownListStore.DataTextField  = "FormattedDescriptionLocation";
            DropDownListStore.DataValueField = "StoreId";
            DropDownListStore.DataBind();

            DropDownListStore.Items.Insert(0, new ListItem("All", "0"));
        }
        private void BindStoreList()
        {
            Account account = Account.GetAccountByUserName(Page.User.Identity.Name.ToString());

            DropDownListStore.DataSource     = Store.GetStoreListByAccountId(account.AccountId);
            DropDownListStore.DataTextField  = "Description";
            DropDownListStore.DataValueField = "StoreId";
            DropDownListStore.DataBind();
        }
        //private void BindLocationList()
        //{
        //    DropDownListLocation.DataSource = Location.GetLocationListByAccountId(Account.GetAccountByUserName(Page.User.Identity.Name.ToString()).AccountId);
        //    DropDownListLocation.DataTextField = "Description";
        //    DropDownListLocation.DataValueField = "LocationId";
        //    DropDownListLocation.DataBind();

        //    if (DropDownListLocation.Items.Count > 1)
        //    {
        //        DropDownListLocation.Items.Insert(0, new ListItem("Please select", "0"));
        //    }
        //    else
        //    {
        //        BindStore();
        //    }
        //}

        //protected void DropDownListLocation_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    BindStore();
        //}

        private void BindRepStore()
        {
            DropDownListStore.ClearSelection();
            DropDownListStore.DataSource     = Store.GetStoreListByUserName(Page.User.Identity.Name.ToString());
            DropDownListStore.DataTextField  = "Description";
            DropDownListStore.DataValueField = "StoreId";
            DropDownListStore.DataBind();

            if (DropDownListStore.Items.Count > 1)
            {
                DropDownListStore.Items.Insert(0, new ListItem("Please select", "0"));
            }
        }
        private void BindStore()
        {
            if (Roles.IsUserInRole("RepClaim"))
            {
                BindRepStore();
                return;
            }

            //DropDownListStore.DataSource = Store.GetStoreListByLocationId(Convert.ToInt32(DropDownListLocation.SelectedValue));
            DropDownListStore.DataSource     = Store.GetStoreListByAccountId(Account.GetAccountByUserName(Page.User.Identity.Name.ToString()).AccountId);
            DropDownListStore.DataTextField  = "Description";
            DropDownListStore.DataValueField = "StoreId";
            DropDownListStore.DataBind();
            DropDownListStore.Items.Insert(0, new ListItem("Please select", "0"));
        }