public ActionResult SetDrillStrataInfo() { //将json字符串转化为DrillStrata类型的模型 List <DrillStrata> stratas = new List <DrillStrata>(); var sr = new StreamReader(Request.InputStream); string stream = sr.ReadToEnd(); //获得json数据流 var js = new System.Web.Script.Serialization.JavaScriptSerializer(); var jarr = js.Deserialize <Dictionary <string, DrillStrata> >(stream); foreach (var j in jarr) { var strata = j.Value; DrillStrata getinfo = new DrillStrata(); getinfo.strataAge = strata.strataAge; getinfo.startDepth = strata.startDepth; getinfo.endDepth = strata.endDepth; getinfo.thinckness = strata.thinckness; getinfo.bottonElevation = strata.bottonElevation; getinfo.strataDescribe = strata.strataDescribe; getinfo.legendName = strata.legendName; getinfo.legendExplation = strata.legendExplation; getinfo.contactRelation = strata.contactRelation; getinfo.coreTake = strata.coreTake; getinfo.density = strata.density; getinfo.waterInclude = strata.waterInclude; getinfo.remarks = strata.remarks; stratas.Add(getinfo); //Console.WriteLine(string.Format("{0}:{1}", j.Key, j.Value)); } CommonTest.drillStrataList = stratas; //this.drillStrataList = stratas; return(null); }
//地层信息传值 public ActionResult GetDrillStrataModel(DrillStrata info) { List <DrillStrata> strata = new List <DrillStrata>(); strata.Add(info); //this.drillStrata = info; return(Content(info.strataDescribe)); }