public ActionResult Update(StoreCheckDTO dto, params string[] checkItem) { var items = checkItem.Select(s => new CheckDetail() { IsCheck = false, OptionName = s }).ToArray(); dto.Items = JsonHelper.ToJson(items); dto.ItemsCount = checkItem.Length; dto.OperatorId = AuthorityHelper.OperatorId; var result = _storeTypeContract.Update(dto); return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(StoreCheckDTO dto, params string[] checkItem) { // items 序列化 [{optionName:<name>,IsCheck:false},...] var items = checkItem.Select(s => new CheckDetail() { IsCheck = false, OptionName = s }).ToArray(); dto.Items = JsonHelper.ToJson(items); dto.ItemsCount = checkItem.Length; var result = _storeTypeContract.Insert(dto); return(Json(result, JsonRequestBehavior.AllowGet)); }