示例#1
0
        // GET: CarProductFlagshipStoreConfig
        public ActionResult Index()
        {
            CarProductFlagshipStoreConfigManager manager = new CarProductFlagshipStoreConfigManager();
            var list = manager.GetList();

            if (list == null)
            {
                return(View());
            }
            return(View(list));
        }
示例#2
0
        public ActionResult Delete(string brand)
        {
            if (string.IsNullOrWhiteSpace(brand))
            {
                return(Json(0));
            }

            CarProductFlagshipStoreConfigManager manager = new CarProductFlagshipStoreConfigManager();

            if (manager.DeleteConfig(brand))
            {
                return(Json(1));
            }
            else
            {
                return(Json(0));
            }
        }
示例#3
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));
            }
        }
示例#4
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));
        }