public SideChoice AddSideChoice(int vSideChoiceID, int vProductID, string vTitle, DateTime vAddedDate, string vAddedBy, DateTime vUpdatedDate, string vUpdatedBy, bool vActive)
        {
            SideChoice lSideChoice = new SideChoice();

            using (FRShoppingEntities frctx = new FRShoppingEntities())
            {
                if (vSideChoiceID > 0)
                {
                    lSideChoice       = frctx.SideChoices.FirstOrDefault(u => u.SideChoiceId == vSideChoiceID);
                    lSideChoice.Title = vTitle;

                    lSideChoice.UpdatedDate = vUpdatedDate;
                    lSideChoice.UpdatedBy   = vUpdatedBy;
                    lSideChoice.Active      = vActive;
                    return(frctx.SaveChanges() > 0 ? lSideChoice : null);
                }
                else
                {
                    lSideChoice.Title = vTitle;

                    lSideChoice.ProductId   = vProductID;
                    lSideChoice.AddedDate   = vAddedDate;
                    lSideChoice.AddedBy     = vAddedBy;
                    lSideChoice.UpdatedDate = vUpdatedDate;
                    lSideChoice.UpdatedBy   = vUpdatedBy;
                    lSideChoice.Active      = vActive;
                    return(AddSideChoice(lSideChoice));
                }
            }
        }
 private bool ChangeLockState(SideChoice vSideChoice, bool vState)
 {
     using (FRShoppingEntities frenty = new FRShoppingEntities())
     {
         SideChoice up = frenty.SideChoices.FirstOrDefault(e => e.SideChoiceId == vSideChoice.SideChoiceId);
         up.UpdatedDate = DateTime.Now;
         up.Active      = vState;
         return(frenty.SaveChanges() > 0 ? true : false);
     }
 }
        public SideChoice AddSideChoice(SideChoice vSideChoice)
        {
            try
            {
                Shoppingctx.SideChoices.Add(vSideChoice);
                base.PurgeCacheItems(CacheKey);

                return(Shoppingctx.SaveChanges() > 0 ? vSideChoice : null);
            }
            catch
            {
                return(null);
            }
        }
 public SideChoice UpdateSideChoice(SideChoice vSideChoice)
 {
     throw new NotImplementedException();
 }
 public bool UnDeleteSideChoice(SideChoice vSideChoice)
 {
     throw new NotImplementedException();
 }
 public bool UnlockSideChoice(SideChoice vSideChoice)
 {
     return(ChangeLockState(vSideChoice, true));
 }
 public bool LockSideChoice(SideChoice vSideChoice)
 {
     return(ChangeLockState(vSideChoice, false));
 }