private void CustomerDropDownFill() { BussinessCustomer customerMdl = new BussinessCustomer(); List <Customer> customers = customerMdl.GetCustomers(); if (customers != null && customers.Count > 0) { grd.DataSource = customers; grd.DataBind(); } else { grd.DataSource = null; grd.DataBind(); } }
private void CustomerDDL() { BussinessCustomer cs = new BussinessCustomer(); List <Customer> customers = cs.GetCustomers(); if (customers != null && customers.Count > 0) { for (int i = 0; i < customers.Count; i++) { DropDownListCustomer.Items.Add(customers[i].ID.ToString()); } DropDownListCustomer.Items.Insert(0, new ListItem("Select Customers", " ")); } else { DropDownListCustomer.Items.Clear(); } }