public void Mod() { if (CheckAjax()) { if (CheckRight()) { if (IsPost) { M.ProductCategory category = new M.ProductCategory() { Id = int.Parse(Request["Id"]), Name = Request["Name"], Image = Request["Image"], ShowLogo = Types.GetBooleanFromString(Request["ShowLogo"]), SortNum = int.Parse(Request["SortNum"]) }; SetResult(category.Update(DataSource), () => { WritePostLog("MOD"); }); } else { NotFound(); } } } }
public void Parents(int id) { if (CheckAjax()) { if (CheckRight()) { List <int> list = new List <int>(); M.ProductCategory ac = M.ProductCategory.GetById(DataSource, id); list.Add(ac.Id); while (ac.ParentId != 0) { ac = M.ProductCategory.GetById(DataSource, ac.ParentId); list.Insert(0, ac.Id); } SetResult(list.ToArray()); } } }
public void Del() { if (CheckAjax()) { if (CheckRight()) { if (IsPost) { M.ProductCategory category = new M.ProductCategory() { Id = int.Parse(Request["Id"]) }; SetResult(category.Delete(DataSource), () => { WritePostLog("DEL"); }); } else { NotFound(); } } } }