Exemplo n.º 1
0
        public XOPField(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _name = reader.ReadAttribute("name", true);

            _type = new XOPFieldType(XElement);

            _isPk = reader.ReadAttributeBool("pk", false);

            _isPkAutoGenertaed = reader.ReadAttributeBool("isPkAutoGenertaed", true);

            if (!_isPk && _isPkAutoGenertaed)
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Field {0} is not primary key but isPKAutoGenerated is set to true, it will be ignored.", _name), false);

            _defaultValue = reader.ReadAttributeValue("defaultValue", _type.Type);

            _nullable = reader.ReadAttributeBool("nullable", true);

            _isMapped = reader.ReadAttributeBool("isMapped", true);

            _mappedParamName = reader.ReadAttribute("mappedParamName");

            if (!_isMapped && !string.IsNullOrEmpty(_mappedParamName))
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Field {0} is not mapped but it contains mappedParamName, it will be ignored.", _name), false);

            _isMappedTypeConverted = reader.ReadAttributeBool("isMappedTypeConverted", false);

            _calculator = reader.ReadAttribute("calculator");
        }
        public XOPFunctionParam(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _name = reader.ReadAttribute("name");

            _paramType = new XOPFieldType(XElement, false);

            _mappedColumn = reader.ReadAttribute("mappedColumn");

            _direction = reader.ReadAttributeEnum("direction", System.Data.ParameterDirection.Input);

            _value = reader.ReadAttributeValue("value", _paramType.Type);
        }