示例#1
0
        public static List <Inventory> ShowItems(string description, string category)
        {
            List <Inventory> itemList = new List <Inventory>();

            if (category == "")
            {
                itemList = CatalogueDAO.GetAllCatalogue();
            }
            else
            {
                itemList = CatalogueDAO.GetCatalogueByCategory(category);
            }
            if (description == "")
            {
                return(itemList);
            }
            else
            {
                List <Inventory> searchList = new List <Inventory>();
                foreach (Inventory item in itemList)
                {
                    if (item.Description.ToUpper().Contains(description.ToUpper()))
                    {
                        searchList.Add(item);
                    }
                }
                return(searchList);
            }
        }
示例#2
0
 public ActionResult GetAllCatelogue()
 {
     try
     {
         List <CatalogueDTO> catalogues = CatalogueDAO.GetAllCatalogue();
         return(Ok(catalogues));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
        //public static bool VerifyExist(string itemCode)
        //{
        //    List<string> catalogueCodes = CatalogueDAO.GetAllItemCodes();
        //    foreach(string code in catalogueCodes)
        //    {
        //        if(itemCode == code)
        //        {
        //            return true;
        //        }
        //    }
        //    return false;
        //}

        public static List <Inventory> GetAllCatalogue()
        {
            return(CatalogueDAO.GetAllCatalogue());
        }