コード例 #1
0
 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();
 }
コード例 #2
0
 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();
             }
         }
     }
 }
コード例 #3
0
 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();
             }
         }
     }
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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();
             }
         }
     }
 }
コード例 #6
0
 protected virtual void OnInfo(M.OneProduct product, M.OneProductNumber number)
 {
 }