Exemplo n.º 1
0
        public ActionResult Edit(string brand)
        {
            CarProductFlagshipStoreConfigManager manager = new CarProductFlagshipStoreConfigManager();

            ViewBag.BrandList = manager.GetBrand();

            Tuhu.Service.Product.Models.ProductConfig.CarProductFlagshipStoreConfig model = manager.GetConfigByBrand(brand);
            if (string.IsNullOrWhiteSpace(brand) || model == null || string.IsNullOrWhiteSpace(model.Name))
            {
                return(View(new Tuhu.Service.Product.Models.ProductConfig.CarProductFlagshipStoreConfig()
                {
                    LogoUrl = string.Empty,
                    BackGroundUrl = string.Empty
                }));
            }
            else
            {
                return(View(model));
            }
        }
Exemplo n.º 2
0
        public JsonResult Save(Tuhu.Service.Product.Models.ProductConfig.CarProductFlagshipStoreConfig modelConfig, string actionString)
        {
            bool flag = false;
            CarProductFlagshipStoreConfigManager manager = new CarProductFlagshipStoreConfigManager();

            if (string.IsNullOrWhiteSpace(actionString))
            {
                return(Json(flag));
            }
            if (actionString == "add")
            {
                modelConfig.CreateTime         = DateTime.Now;
                modelConfig.LastUpdateDataTime = DateTime.Now;
                flag = manager.InsertConfig(modelConfig);
            }
            else if (actionString == "edit")
            {
                modelConfig.CreateTime         = DateTime.Now;
                modelConfig.LastUpdateDataTime = DateTime.Now;
                flag = manager.UpdateConfig(modelConfig);
            }

            return(Json(flag));
        }