public SauceChoice AddSauceChoice(int vSauceChoiceID, int vProductID, string vTitle, DateTime vAddedDate, string vAddedBy, DateTime vUpdatedDate, string vUpdatedBy, bool vActive) { SauceChoice lSauceChoice = new SauceChoice(); using (FRShoppingEntities frctx = new FRShoppingEntities()) { if (vSauceChoiceID > 0) { lSauceChoice = frctx.SauceChoices.FirstOrDefault(u => u.SauceChoiceId == vSauceChoiceID); lSauceChoice.Title = vTitle; lSauceChoice.UpdatedDate = vUpdatedDate; lSauceChoice.UpdatedBy = vUpdatedBy; lSauceChoice.Active = vActive; return(frctx.SaveChanges() > 0 ? lSauceChoice : null); } else { lSauceChoice.Title = vTitle; lSauceChoice.ProductId = vProductID; lSauceChoice.AddedDate = vAddedDate; lSauceChoice.AddedBy = vAddedBy; lSauceChoice.UpdatedDate = vUpdatedDate; lSauceChoice.UpdatedBy = vUpdatedBy; lSauceChoice.Active = vActive; return(AddSauceChoice(lSauceChoice)); } } }
private bool ChangeLockState(SauceChoice vSauceChoice, bool vState) { using (FRShoppingEntities frenty = new FRShoppingEntities()) { SauceChoice up = frenty.SauceChoices.FirstOrDefault(e => e.SauceChoiceId == vSauceChoice.SauceChoiceId); up.UpdatedDate = DateTime.Now; up.Active = vState; return(frenty.SaveChanges() > 0 ? true : false); } }
public SauceChoice AddSauceChoice(SauceChoice vSauceChoice) { try { Shoppingctx.SauceChoices.Add(vSauceChoice); base.PurgeCacheItems(CacheKey); return(Shoppingctx.SaveChanges() > 0 ? vSauceChoice : null); } catch { return(null); } }
public SauceChoice UpdateSauceChoice(SauceChoice vSauceChoice) { throw new NotImplementedException(); }
public bool UnDeleteSauceChoice(SauceChoice vSauceChoice) { throw new NotImplementedException(); }
public bool UnlockSauceChoice(SauceChoice vSauceChoice) { return(ChangeLockState(vSauceChoice, true)); }
public bool LockSauceChoice(SauceChoice vSauceChoice) { return(ChangeLockState(vSauceChoice, false)); }