コード例 #1
0
    private void FillDropDown()
    {
        ddlBranch.DataSource     = userProvider.GetCurrentActiveBranches(User.Identity.Name);
        ddlBranch.DataTextField  = "Name";
        ddlBranch.DataValueField = "ID";
        ddlBranch.DataBind();
        ddlBranch.Enabled = ddlBranch.Items.Count > 0;


        ddlSales.DataSource     = employeeProvider.GetSales();
        ddlSales.DataTextField  = "FirstName";
        ddlSales.DataValueField = "ID";
        ddlSales.DataBind();
        ddlSales.Items.Insert(0, String.Empty);

        ddlItemType.DataSource     = itemTypeProvider.GetAll();
        ddlItemType.DataTextField  = "Description";
        ddlItemType.DataValueField = "ID";
        ddlItemType.DataBind();

        ddlPaymentType.DataSource     = paymentTypeProvider.GetAll();
        ddlPaymentType.DataTextField  = "Description";
        ddlPaymentType.DataValueField = "ID";
        ddlPaymentType.DataBind();
    }
コード例 #2
0
    public CascadingDropDownNameValue[] GetPaymentTypes
        (string knownCategoryValues,
        string category)
    {
        List <CascadingDropDownNameValue> list  = new List <CascadingDropDownNameValue>();
        PaymentTypeProvider paymentTypeProvider = UnityContainerHelper.Container.Resolve <PaymentTypeProvider>();

        foreach (var paymentType in paymentTypeProvider.GetAll())
        {
            list.Add(
                new CascadingDropDownNameValue(
                    paymentType.Description,
                    paymentType.ID.ToString()));
        }
        return(list.ToArray());
    }