public MealSection AddMealSection(int vMealSectionID, string vTitle, string vDescription, DateTime vAddedDate, string vAddedBy, DateTime vUpdatedDate, string vUpdatedBy, bool vActive) { MealSection lMealSection = new MealSection(); using (FRShoppingEntities frctx = new FRShoppingEntities()) { if (vMealSectionID > 0) { lMealSection = frctx.MealSections.FirstOrDefault(u => u.MealSectionId == vMealSectionID); lMealSection.Title = vTitle; lMealSection.Description = vDescription; lMealSection.UpdatedDate = vUpdatedDate; lMealSection.UpdatedBy = vUpdatedBy; lMealSection.Active = vActive; return(frctx.SaveChanges() > 0 ? lMealSection : null); } else { lMealSection.Title = vTitle; lMealSection.Description = vDescription; lMealSection.AddedDate = vAddedDate; lMealSection.AddedBy = vAddedBy; lMealSection.UpdatedDate = vUpdatedDate; lMealSection.UpdatedBy = vUpdatedBy; lMealSection.Active = vActive; return(AddMealSection(lMealSection)); } } }
public MealSection AddMealSection(MealSection vMealSection) { try { Shoppingctx.MealSections.Add(vMealSection); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vMealSection : null); } catch { return(null); } }
public bool DeleteMealSection(MealSection vMealSection) { throw new NotImplementedException(); }
public MealSection UpdateMealSection(MealSection vMealSection) { throw new NotImplementedException(); }