Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            return;
        }
        rptSupplier.DataSource = GgDbProvider.GetSupplierList();
        rptSupplier.DataBind();

        lstDistrict.DataSource = GgDbProvider.GetDistrictList();
        lstDistrict.DataBind();
        lstDistrict.Items.Add(new ListItem()
        {
            Text = "Seçiniz"
        });
    }
Exemplo n.º 2
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        List <Supplier> result = GgDbProvider.GetSupplierList();

        List <Supplier> result2 = new List <Supplier>();

        foreach (int item in lstDistrict.GetSelectedIndices())
        {
            result2.AddRange(result.Where(i => i.DistrictID == Convert.ToInt32(lstDistrict.Items[item].Value)).ToList());
        }

        rptSupplier.DataSource = result2;
        rptSupplier.DataBind();
        if (rptSupplier.Items.Count == 0)
        {
            //pnlUrunler.Visible = false;
            pnlBilgi.Visible = true;
        }
        else
        {
            //pnlUrunler.Visible = true;
            pnlBilgi.Visible = false;
        }
    }