Exemple #1
0
        private string ConstructErrorInfo()
        {
            int            layerid = -1;
            StandardHelper pStand  = new StandardHelper(SysDbHelper.GetSysDbConnection());

            pStand.GetLayerIDByTableName(ref layerid, this.m_SchemaID, m_structPara.strFtName);

            string strSql1 = "Select FieldCode,FieldName From LR_DicField Where LayerID = " + layerid;

            List <FIELDMAP> arrFieldMap = new List <FIELDMAP>();
            DataTable       dt          = new DataTable();

            AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSql1);
            if (dt.Rows.Count == 0)
            {
                return(null);
            }
            foreach (DataRow dr in dt.Rows)
            {
                string FName  = dr["FieldCode"].ToString(); //字段名
                string FAlias = dr["FieldName"].ToString(); //字段别名

                FIELDMAP fMap = new FIELDMAP();
                fMap.strAlias = FAlias;
                fMap.strName  = FName;
                arrFieldMap.Add(fMap);
            }

            /*string Alias = "", Alias2 = "";
             * pStand.GetAliasByLayerName(ref Alias, m_structPara.strFtName, m_strStdName);
             * pStand.GetAliasByLayerName(ref Alias2, m_structPara.strFtName2, m_strStdName);*/
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            if (!string.IsNullOrEmpty(FtName1))
            {
                FtName1 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            if (!string.IsNullOrEmpty(FtName2))
            {
                FtName2 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            string strErrInfo = m_structPara.strClause;

            for (int i = 0; i < arrFieldMap.Count; i++)
            {
                string strR = arrFieldMap[i].strAlias;
                string strS = arrFieldMap[i].strName;
                strErrInfo.Replace(strS, strR);
            }
            strErrInfo.Replace(m_structPara.strFtName, FtName1);
            strErrInfo.Replace(m_structPara.strFtName2, FtName2);
            strErrInfo = "字段值符合表达式 (" + strErrInfo + ")";

            return(strErrInfo);
        }
Exemple #2
0
        public void Init()
        {
            tlCatalog.Nodes.Clear();
            IList <StandardItem> rootList = StandardHelper.GetAllStandard();
            TreeListNode         nodeRoot = tlCatalog.AppendNode(new object[] { "所有标准", null }, null);

            nodeRoot.SelectImageIndex = 18;
            foreach (StandardItem sItem in rootList)
            {
                Environment.NhibernateHelper.RefreshObject(sItem, Define.enumLockMode.None);
                StandardHelper.InitItemDetial(sItem);
                BoundItem(sItem, nodeRoot);
            }

            nodeRoot.Expanded = true;
        }
Exemple #3
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (m_WsSource != null && !string.IsNullOrWhiteSpace(txtName.Text))
            {
                Importer importer = new Importer();
                importer.Source       = this.m_WsSource;
                importer.StandardName = txtName.Text.Trim();
                importer.OnMessage   += ShowMessage;

                StandardItem sItem = importer.Import();
                StandardHelper.SaveStandard(sItem);

                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show("请正确填写参数!");
            }
        }
Exemple #4
0
        private void BoundItem(StandardItem sItem, TreeListNode nodeParent)
        {
            if (sItem == null)
            {
                return;
            }

            StandardHelper.InitItemDetial(sItem);
            TreeListNode nodeItem = tlCatalog.AppendNode(new object[] { sItem.Name, sItem.Type }, nodeParent, sItem);

            nodeItem.ImageIndex       = GetImageIndex(sItem);
            nodeItem.SelectImageIndex = 18;
            if (sItem.SubItems != null)
            {
                foreach (StandardItem diSub in sItem.SubItems)
                {
                    BoundItem(diSub, nodeItem);
                }
            }
        }