public ActionResult Save(int?id) { ViewBag.customers = EnumToSelect(typeof(CustomerType), selectValue: 0); ViewBag.shops = ListToSelect(WarehouseService.GetList().Select(o => new SelectListItem() { Value = o.StoreId, Text = o.Title }), emptyTitle: "全部", emptyValue: "-1"); ViewBag.times = CommonRules.TimeLines; var obj = new PromotionBundling(); if (id.HasValue) { var detail = BaseService <BundlingList> .FindById(id); obj = CommodityPromotionService.FindKuBangById(detail.CommodityId); if (obj.Timeliness == 1) { ViewBag.times = new List <string>() { obj.StartAging1, obj.EndAging1, obj.StartAging2, obj.EndAging2, obj.StartAging3, obj.EndAging3 } } ; } return(View(obj.IsNullThrow())); }
public ActionResult Save(PromotionBundling obj) { obj.StoreId = Request["StoreId"]; obj.GenerateCode = true;//自动生成新捆绑条码 var re = CommodityPromotionService.KubangSaveOrUpdate(obj, Request["Times"]); return(Content(re.ToJson())); }