public string GetParaValue() { string BOTID = Request["BOTID"]; string NS = Request["NS"].Trim(); string ParaName = Request["ParaName"].Trim(); XmlDocument document = new XmlDocument(); string name = ""; string Value = ""; string data = ""; ObjTypePropertyManager manager = new ObjTypePropertyManager(); List <ObjTypePropertyModel> list = manager.GetOBJTypePropByName(BOTID, NS); document.LoadXml(list[0].Md); XmlNodeList datastore = document.SelectNodes("PropertySet"); foreach (XmlNode node in datastore) { XmlNodeList column = node.ChildNodes; foreach (XmlNode nd in column) { name = nd.Attributes["n"].Value; if (name == ParaName) { if (nd.InnerText.Length != 0) { string[] TmpPara = nd.InnerText.Replace(",", ",").Split(','); foreach (string para in TmpPara) { if (data == "") { data = "{id:'" + para + "',text:'" + para + "'}"; } else { data = data + "," + "{id:'" + para + "',text:'" + para + "'}"; } } } break; } } if (data != "") { data = "[" + data + "]"; } } return(data); }
public string GetParaInfo() { string data = ""; string DataType = ""; string editor = ""; string Value = ""; string BOTID = Request["BOTID"]; string NS = Request["NS"].Trim(); ObjTypePropertyManager manager = new ObjTypePropertyManager(); XmlDocument document = new XmlDocument(); List <ObjTypePropertyModel> list = manager.GetOBJTypePropByName(BOTID, NS); document.LoadXml(list[0].Md); XmlNodeList datastore = document.SelectNodes("PropertySet"); foreach (XmlNode node in datastore) { XmlNodeList column = node.ChildNodes; foreach (XmlNode nd in column) { DataType = nd.Attributes["t"].Value; if (DataType == "String") { editor = "textbox"; } else if (DataType == "Decimal") { editor = "spinner"; } else { editor = "datepicker', format: 'yyyy-MM-dd "; } if (nd.InnerText.Length != 0) { editor = "selectvalue"; } else { Value = ""; } if (data == "") { data = "{id:'1', name: '" + nd.Attributes["n"].Value + "', value: '" + Value + "', editor: '" + editor + "'}"; } else { data = data + "," + "{id:'1', name: '" + nd.Attributes["n"].Value + "', value: '" + Value + "', editor: '" + editor + "'}"; } } if (data != "") { data = @"[" + data + "]"; } } return(data); }