Beispiel #1
0
        public ActionResult EditTimeProduct(int recordId = -1)
        {
            TimeProductInfo timeProductInfo = AdminProducts.GetTimeProductByRecordId(recordId);

            if (timeProductInfo == null)
            {
                return(PromptView("定时商品不存在"));
            }
            if (timeProductInfo.StoreId != WorkContext.StoreId)
            {
                return(PromptView("不能编辑其它店铺的定时商品"));
            }

            DateTime?nullTime = null;
            DateTime noTime   = new DateTime(1900, 1, 1);

            TimeProductModel model = new TimeProductModel();

            model.Pid         = timeProductInfo.Pid;
            model.ProductName = AdminProducts.GetPartProductById(timeProductInfo.Pid).Name;
            model.OnSaleTime  = timeProductInfo.OnSaleTime == noTime ? nullTime : timeProductInfo.OnSaleTime;
            model.OutSaleTime = timeProductInfo.OutSaleTime == noTime ? nullTime : timeProductInfo.OutSaleTime;

            ViewData["referer"] = MallUtils.GetStoreAdminRefererCookie();
            return(View(model));
        }