public void AttachParent(ProductCategory productCategory, string parentId) { if (string.IsNullOrWhiteSpace(parentId)) return; int id = int.Parse(parentId); productCategory.ParentProductCategory = _context.ProductCategories.Find(id); }
public int SaveProductCategory(ProductCategory productCategory) { productCategory.ModifedDate = DateTime.Now; if (productCategory.ProductCategoryId == default(int)) _context.CreateRecord(productCategory); else _context.EditRecord(productCategory); return productCategory.ProductCategoryId; }