Example #1
0
        public static void DeleteProduct(string name)
        {
            var searchData = data.Find((i) => i.product_Name == name);

            data.Remove(searchData);
            List <string> list = new List <string>();

            data.ForEach(x => list.Add($"{x.Product_ID},{x.product_Name},{x.Manufacturer},{x.ProductShortCode},{x.ProductCategory},{x.ProductDescription},{x.Selling_Price}"));
            ProductFileManager.WriteAllDataIntoFile(list);
        }
        public static void DeleteCategory(string name)
        {
            var searchData = data.Find((i) => i.Category_Name == name);

            data.Remove(searchData);
            List <string> list = new List <string>();

            data.ForEach(x => list.Add($"{x.Category_ID},{x.Category_Name},{x.CategoryShortCode},{x.CategoryDescription}"));
            ProductFileManager.WriteAllDataIntoFile(list);
        }