Exemplo n.º 1
0
        public string GetOBTNS()
        {
            string data = "";
            ObjTypePropertyManager manager = new ObjTypePropertyManager();
            string BOID = Request["BOID"];

            IList <ObjTypePropertyModel> list = manager.GetObjTypePropertyBoid(BOID);

            foreach (ObjTypePropertyModel rtm in list)
            {
                if (data == "")
                {
                    data = "{id:'" + rtm.Ns + "',text:'" + rtm.Ns + "'}";
                }
                else
                {
                    data = data + "," + "{id:'" + rtm.Ns + "',text:'" + rtm.Ns + "'}";
                }
            }
            if (data != "")
            {
                data = "[" + data + "]";
            }
            return(data);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public ActionResult GetObjTypeProperty(string ObjTypeId)
        {
            List <ObjTypePropertyModel> optl = new ObjTypePropertyManager().GetObjTypePropertyBoid(ObjTypeId).ToList();

            return(Json(optl, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        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);
        }