public static void RemoveSauce(SauceModel model) { UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository(); var sauce = SauceFactory.ConvertSauce(model); unitOfWork.SauceRepository.RemoveSauce(sauce.Id); }
public static void AddSauce(SauceModel model) { UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository(); model.Id = Guid.NewGuid(); var sauce = SauceFactory.ConvertSauce(model); unitOfWork.SauceRepository.AddSauce(sauce); }
public static BottomModel ApplySauce(BottomModel model, SauceModel smodel) { UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository(); model.Sauce = smodel; var bottom = BottomFactory.ConvertBottom(model); unitOfWork.BottomRepository.AddOrUpdate(bottom); return(model); }
public static SauceModel ConvertSauce(Sauce sauce) { if (sauce == null) { return(null); } SauceModel model = new SauceModel() { Id = sauce.Id, IsSpicy = sauce.IsSpicy, Name = sauce.Name, Price = sauce.Price, }; return(model); }
public static Sauce ConvertSauce(SauceModel model) { if (model == null) { return(null); } Sauce sauce = new Sauce() { Id = model.Id, IsSpicy = model.IsSpicy, Name = model.Name, Price = model.Price, }; return(sauce); }
public ActionResult SauceDelete(SauceModel model) { SauceManager.RemoveSauce(model); return(RedirectToAction("ManageSauces")); }
public ActionResult SauceDetails(SauceModel model) { return(View(model)); }
public ActionResult AddSauce(SauceModel model) { SauceManager.AddSauce(model); return(RedirectToAction("ManageSauces")); }
public static PizzaModel AssignBottomToPizza(PizzaModel model, BottomModel bottom, SauceModel sauce) { if (model == null || bottom == null || sauce == null) { return(null); } UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository(); bottom.Sauce = sauce; model.Bottom = bottom; unitOfWork.PizzaRepository.UpdatePizza(PizzaFactory.ConvertPizzaModel(model)); return(model); }