private void EditProcessorForm_Load(object sender, EventArgs e)
        {
            this.cboType.Items.AddRange(Enum.GetNames(typeof(PreprocessType)));

            Preprocess source = _row.Tag as Preprocess;
            if (source != null)
            {
                _preprocess = source;
                this.txtName.Text = _preprocess.Name;
                this.txtSQL.Text = _preprocess.SQL;
                this.txtInvalidMessage.Text = _preprocess.InvalidMessage;
                this.cboType.Text = _preprocess.Type.ToString();
            }
        }
Ejemplo n.º 2
0
        private ServiceEntity(XmlElement definition)
        {
            XmlHelper h = new XmlHelper(definition);

            this.SQLTemplate      = h.GetText("SQLTemplate");
            ResponseRecordElement = h.GetText("ResponseRecordElement");
            RequestRecordElement  = h.GetText("RequestRecordElement");
            FieldList             = new FieldList(h.GetElement("FieldList"));
            ConditionList         = new ConditionList(h.GetElement("Conditions"));
            Orders     = new OrderList(h.GetElement("Orders"));
            Pagination = new Pagination(h.GetElement("Pagination"));

            ServiceAction action = ServiceAction.Select;

            if (!Enum.TryParse <ServiceAction>(h.GetText("Action"), true, out action))
            {
                action = ServiceAction.Select;
            }
            Action = action;

            this.Variables = new List <IVariable>();
            foreach (XmlElement varElement in h.GetElements("InternalVariable/Variable"))
            {
                IVariable v = VariableFactory.Parse(varElement);
                if (v != null)
                {
                    Variables.Add(v);
                }
            }

            this.Converters = new List <IConverter>();
            foreach (XmlElement cvElement in h.GetElements("Converters/Converter"))
            {
                string     type = cvElement.GetAttribute("Type");
                IConverter c    = ConverterProvider.CreateConverter(type);
                c.Load(cvElement);

                this.Converters.Add(c);
            }

            this.Preprocesses = new List <Preprocess>();
            foreach (XmlElement preElement in h.GetElements("Preprocesses/Preprocess"))
            {
                Preprocess p = Preprocess.Parse(preElement);
                this.Preprocesses.Add(p);
            }
        }