Example #1
0
        public static void New(PartModel Part)
        {
            Part.PartID   = _parts.Count + 1;
            Part.Category = PartCategoryService.GetAll().First(a => a.CategoryID == Part.CategoryID)?.Title;

            _parts.Add(Part);
        }
Example #2
0
        public static void Update(PartModel Part)
        {
            var savedPart = GetById(Part.PartID);

            savedPart.Title      = Part.Title;
            savedPart.CategoryID = Part.CategoryID;
            savedPart.Category   = PartCategoryService.GetAll().First(a => a.CategoryID == Part.CategoryID)?.Title;
        }