public ActionResult RemoveNail(DummyRequestModel request) { var model = GetDummy(); model.NailDesigns[request.Index ?? 0] = null; SetDummy(model); return(PartialView("Nails", model)); }
public ActionResult ChangeNail(DummyRequestModel request) { var model = GetDummy(); var cItem = model.NailDesigns[request.SwapIndex]; model.NailDesigns[request.SwapIndex] = model.NailDesigns[request.Index ?? 0]; model.NailDesigns[request.Index ?? 0] = cItem; SetDummy(model); return(PartialView("Nails", model)); }
public ActionResult AddNail(DummyRequestModel request) { var model = GetDummy(); if (request.Index == null) { for (var i = 0; i < model.NailDesigns.Length; i++) { if (model.NailDesigns[i] == null) { model.NailDesigns[i] = db.NailDesigns.Find(request.Id); break; } } } else { model.NailDesigns[request.Index ?? 0] = db.NailDesigns.Find(request.Id); } SetDummy(model); return(PartialView("Nails", model)); }