public ActionResult Edit(string value, int id)
        {
            var model  = JsonConvert.DeserializeObject <List <OrderOptionReferProductModel> >(value);
            var result = OrderOptionManager.UpdateOrderOptionReferProducts(model, id, HttpContext.User.Identity.Name);

            return(Json(new
            {
                state = result ? 1 : 0
            }));
        }
        public ActionResult SelectById(int id)
        {
            if (id == 0)
            {
                return(View("Edit", new TireCreateOrderOptionsConfigModel()));
            }
            var models = OrderOptionManager.SelectOrderOptions();
            var model  = models.FirstOrDefault(r => r.Id == id);

            return(View("Edit", model));
        }
        public ActionResult SelectPids(int id)
        {
            var result = OrderOptionManager.SelectOrderOptionReferProducts(id);

            if (result.Any())
            {
                // var json = JsonConvert.SerializeObject(result);
                return(Json(new
                {
                    status = 1,
                    data = result.ToList()
                }));
            }
            else
            {
                return(Json(new
                {
                    status = 0
                }));
            }
        }
 public JsonResult Save(TireCreateOrderOptionsConfigModel model)
 {
     if (model.Id > 0)
     {
         var origin = OrderOptionManager.SelectOrderOptionsById(model.Id);
         if (OrderOptionManager.UpdateOrderOption(model))
         {
             LoggerManager.InsertLog("OrderOpertionOprLog", new FlashSaleProductOprLog()
             {
                 OperateUser    = HttpContext.User.Identity.Name,
                 BeforeValue    = JsonConvert.SerializeObject(origin),
                 AfterValue     = JsonConvert.SerializeObject(model),
                 CreateDateTime = DateTime.Now,
                 LogId          = model.Id.ToString(),
                 LogType        = "OOption",
                 Operation      = "修改下单可选项配置",
             });
             return(Json(new { Status = 1 }));
         }
         return(Json(new { Status = -1 }));
     }
     else
     {
         if (OrderOptionManager.InsertOrderOption(model))
         {
             LoggerManager.InsertLog("OrderOpertionOprLog", new FlashSaleProductOprLog()
             {
                 OperateUser    = HttpContext.User.Identity.Name,
                 BeforeValue    = "",
                 AfterValue     = JsonConvert.SerializeObject(model),
                 CreateDateTime = DateTime.Now,
                 LogId          = model.Id.ToString(),
                 LogType        = "OOption",
                 Operation      = "新增下单可选项配置",
             });
             return(Json(new { Status = 1 }));
         }
         return(Json(new { Status = -1 }));
     }
 }
        // GET: CreateOrderOption
        public ActionResult Index()
        {
            var model = OrderOptionManager.SelectOrderOptions();

            return(View(model));
        }