public ActionResult DeleteConfirmed(int id) { Label label = LabelRepository.GetSingle(id); try { LabelRepository.Delete(label); LabelRepository.Save(); if (IsSuperAdmin) { return(RedirectToAction("Index", new { storeId = label.StoreId })); } else { return(RedirectToAction("Index")); } } catch (Exception ex) { Logger.Error(ex, "Unable to delete it:" + ex.StackTrace, label); ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator."); } return(View(label)); }
public ActionResult CreatingNewLabel(String labelName) { Label label = new Label(); label.Name = labelName; label.ParentId = 1; LabelRepository.Add(label); int labelId = LabelRepository.Save(); label = LabelRepository.GetSingle(labelId); return(Json(label, JsonRequestBehavior.AllowGet)); }
public ActionResult SaveOrEdit(int id = 0, int selectedStoreId = 0) { var label = new Label(); label.StoreId = GetStoreId(selectedStoreId); if (id != 0) { label = LabelRepository.GetSingle(id); label.UpdatedDate = DateTime.Now; } else { label.UpdatedDate = DateTime.Now; label.CreatedDate = DateTime.Now; label.State = true; } return(View(label)); }
public ActionResult Delete(int id) { Label label = LabelRepository.GetSingle(id); return(View(label)); }
// // GET: /Labels/Details/5 public ViewResult Details(int id) { Label label = LabelRepository.GetSingle(id); return(View(label)); }