public bool UpdatePlug11Configure(string id, string platform, string dateFrom, string dateEnd, int priority, int carriage) { var platformList = platform.Split(new char[] { ',', ',' }); FreeShippingParam param = new FreeShippingParam { EndTime = dateEnd, StartTime = dateFrom, FullCarriage = carriage, Priority = priority, Platforms = platformList.ToList().Select(x => int.Parse(x)).ToList() }; var plug = AdminCarriageClient.Instance.GetPlugConfigure(11); JavaScriptSerializer jss = new JavaScriptSerializer(); var ret = jss.Deserialize <Myzj.OPC.UI.Model.AdminCarriage.FreeShipping>(plug); ret.FreeShippingParams[Convert.ToInt32(id)] = param; return(AdminCarriageClient.Instance.UpdatePlugConfigure(11, jss.Serialize(ret))); }
public ActionResult Detail11Operation(int rowindex = -1) { var plug = AdminCarriageClient.Instance.GetPlugConfigure(11); JavaScriptSerializer jss = new JavaScriptSerializer(); var ret = jss.Deserialize <FreeShipping>(plug); FreeShippingParam param = new FreeShippingParam(); if (rowindex >= 0) { param = ret.FreeShippingParams[rowindex]; } else { param.StartTime = string.Empty; param.EndTime = string.Empty; param.Priority = 1; param.Platforms = new List <int>(); } ViewBag.rowindex = rowindex; return(View(param)); }