Esempio n. 1
0
        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));
                }
            }
        }
Esempio n. 2
0
        public MealSection AddMealSection(MealSection vMealSection)
        {
            try
            {
                Shoppingctx.MealSections.Add(vMealSection);

                base.PurgeCacheItems(CacheKey);

                return(Shoppingctx.SaveChanges() > 0 ? vMealSection : null);
            }
            catch
            {
                return(null);
            }
        }
Esempio n. 3
0
 public bool DeleteMealSection(MealSection vMealSection)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public MealSection UpdateMealSection(MealSection vMealSection)
 {
     throw new NotImplementedException();
 }