public virtual void Info(int productId, long productNum) { M.OneProduct product = M.OneProduct.GetById(DataSource, productId); if (product != null) { M.OneProductNumber number = M.OneProductNumber.GetAllById(DataSource, productNum); if (number != null) { this["Product"] = product; this["Number"] = number; OnInfo(product, number); Render("one.html"); return; } } NotFound(); }
public void Update() { if (CheckAjax()) { if (CheckRight()) { if (IsPost) { M.OneProduct value = DbTable.Load <M.OneProduct>(Request.Form); SetResult(value.UpdateApproved(DataSource), () => { WritePostLog("MOD"); }); } else { NotFound(); } } } }
public void Mod() { if (CheckAjax()) { if (CheckRight()) { if (IsPost) { M.OneProduct value = DbTable.Load <M.OneProduct>(Request.Form); value.Image = HttpUtility.UrlDecode(value.Image); value.Content = HttpUtility.UrlDecode(value.Content); SetResult(value.Update(DataSource, ColumnMode.Exclude, "Approved"), () => { WritePostLog("MOD"); }); } else { NotFound(); } } } }
protected override bool HasReferences(DataSource ds) { if (ExecuteCount <StoreCategory>(ds, P("ParentId", Id)) > 0) { return(true); } if (ProductBrand.GetCountByCategoryId(ds, Id) > 0) { return(true); } if (Product.GetCountByCategoryId(ds, Id) > 0) { return(true); } if (ProductAttribute.GetCountByCategoryId(ds, Id) > 0) { return(true); } if (OneProduct.GetCountByCategoryId(ds, Id) > 0) { return(true); } return(false); }
public void Add() { if (CheckAjax()) { if (CheckRight()) { if (IsPost) { M.OneProduct value = DbTable.Load <M.OneProduct>(Request.Form); value.Image = HttpUtility.UrlDecode(value.Image); value.Content = HttpUtility.UrlDecode(value.Content); value.Approved = false; SetResult(value.Insert(DataSource), () => { WritePostLog("ADD"); }); } else { NotFound(); } } } }
protected virtual void OnInfo(M.OneProduct product, M.OneProductNumber number) { }