Esempio n. 1
0
        public ContentResult Product_API()
        {
            string action = GetParam("action");
            string ids    = GetParam("ids");

            switch (action)
            {
            //case "upmove":
            //    {
            //        M_Product product = proBll.GetproductByid(Mid);
            //        M_Product productPre = proBll.GetNearID(NodeID, product.OrderID, 1);           //int NodeID, int CurrentID, int UporDown
            //        if (productPre.OrderID != 0)
            //        {
            //            int CurrOrder = product.OrderID;
            //            product.OrderID = productPre.OrderID;
            //            productPre.OrderID = CurrOrder;
            //            proBll.UpdateOrder(product);
            //            proBll.UpdateOrder(productPre);
            //        }
            //    }
            //    break;
            //case "downmove":
            //    {
            //        M_Product product = proBll.GetproductByid(Mid);
            //        M_Product productPre = proBll.GetNearID(NodeID, product.OrderID, 0);
            //        if (productPre.ID != 0)
            //        {
            //            int CurrOrder = product.OrderID;
            //            product.OrderID = productPre.OrderID;
            //            productPre.OrderID = CurrOrder;
            //            proBll.UpdateOrder(product);
            //            proBll.UpdateOrder(productPre);
            //        }
            //    }
            //    break;
            case "refresh":    //刷新/重发布,将商品ctreatime和updatatime改为当前值
                SafeSC.CheckIDSEx(ids);
                string date = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                DBCenter.UpdateSQL(proBll.TbName, "AddTime='" + date + "',UpdateTime='" + date + "'", "ID IN (" + ids + ")");
                break;

            case "del":
                SafeSC.CheckIDSEx(ids);
                proBll.RealDelByIDS(ids);
                break;

            case "clear":
                proBll.ClearRecycle();
                break;

            default:
                proBll.setproduct(action, ids);
                break;
            }
            return(Content(Success.ToString()));
        }