public static Object GetFieldDataSource(string elId)
        {
            if (_emrDataSource == null)
            {
                return(null);
            }
            DSValue dsvalue = KnowledgeManage.DSValues.Find(x => x.id == elId);

            if (dsvalue != null)
            {
                if (dsvalue.inputtype == (int)InputType.List || dsvalue.inputtype == (int)InputType.MultiList)
                {
                    if (dsvalue.sourcetype == 0)
                    {
                        string[] ss = dsvalue.dofun.Split('@');
                        if (ss.Length > 2)
                        {
                            return(_emrDataSource.GetDataSource(ss[0], ss[1]));
                        }
                    }
                    else if (dsvalue.sourcetype == 1)
                    {
                        if (dsvalue.dosql != "")
                        {
                            return(_emrDataSource.GetDataSource(dsvalue.dosql));
                        }
                    }
                }
            }
            return(null);
        }
示例#2
0
        private static void getDSValue()
        {
            XmlNodeList xnlist = KnowledgeManage.DataSource_xd.DocumentElement.SelectNodes("DataClass");

            foreach (XmlNode xn in xnlist)
            {
                XmlNodeList txnlist = xn.SelectNodes("Value");
                if (txnlist != null)
                {
                    foreach (XmlNode txn in txnlist)
                    {
                        DSValue dsvalue = new DSValue();
                        dsvalue.id         = txn.Attributes["id"].Value;
                        dsvalue.name       = txn.Attributes["name"].Value;
                        dsvalue.value      = txn.Attributes["value"].Value;
                        dsvalue.inputtype  = Convert.ToInt32(txn.Attributes["inputtype"].Value);
                        dsvalue.sourcetype = Convert.ToInt32(txn.Attributes["sourcetype"].Value);
                        dsvalue.dofun      = txn.Attributes["dofun"].Value;
                        dsvalue.dosql      = txn.Attributes["dosql"].Value;

                        DSValues.Add(dsvalue);
                    }
                }
            }
        }