Exemplo n.º 1
0
    public ViewResult GetAllSuppliers(string searchS, string sortBy)
    {
        SuppliersRepo supp = new SuppliersRepo();

        if (sortBy == null)
        {
            sortBy = "supplierID";
        }
        ;
        ViewData["sortBy"] = sortBy;


        ViewData["suppliers"] = supp.GetAllSuppliers(searchS, sortBy);

        return(View());
    }
Exemplo n.º 2
0
    public ViewResult AddProduct()
    {
        SuppliersRepo suppliers = new SuppliersRepo();

        List <SelectListItem> supplai = new List <SelectListItem>();
        List <Suppliers>      a       = suppliers.GetAllSuppliers();

        foreach (Suppliers i in a)
        {
            supplai.Add(new SelectListItem {
                Text = i.companyName, Value = i.supplierID.ToString()
            });
        }


        ViewData["supplier"] = supplai;
        //ViewData["category"]=categoY;



        return(View());
    }