//绑定外包医院下拉框
 private void BindDropSendCustomer(System.Web.UI.WebControls.DropDownList ddlcustomer)
 {
     if (ViewState["SendCustomer"] == null)
     {
         ViewState["SendCustomer"] = dictCustomerService.GetDictCustomerListByType("1").Where <Dictcustomer>(c => c.Dictlabid == Convert.ToDouble(tbxDictLab.Label)).ToList <Dictcustomer>();
     }
     ddlcustomer.DataTextField  = "Customername";
     ddlcustomer.DataValueField = "Dictcustomerid";
     ddlcustomer.DataSource     = ViewState["SendCustomer"] as IList <Dictcustomer>;
     ddlcustomer.DataBind();
     ddlcustomer.Items.Insert(0, new System.Web.UI.WebControls.ListItem("请选择", "-1"));
 }
Exemple #2
0
        private void BindDrop()
        {
            DictCustomerService        dictcustomerService = new DictCustomerService();
            IEnumerator <Dictcustomer> enumerator          = dictcustomerService.GetDictCustomerListByType(this.CustomerType).GetEnumerator();

            ddlcustomer.Items.Add(new ExtAspNet.ListItem("请选择", "-1"));

            while (enumerator.MoveNext())
            {
                ddlcustomer.Items.Add(new ExtAspNet.ListItem(enumerator.Current.Customername, enumerator.Current.Dictcustomerid.ToString()));
            }
            ddlcustomer.Items.Remove(new ExtAspNet.ListItem("请选择", "-1"));
            // ddlcustomer.Items.RemoveAt(0);
            ddlcustomer.Items[0].EnableSelect = true;
        }