Пример #1
0
        protected void addSpecificPropertiesToEdt(AxEdt edt)
        {
            FieldType fieldType;

            if (!edtExist)
            {
                Enum.TryParse <FieldType>(this.controller.comboBoxFieldType.SelectedValue.ToString(), out fieldType);

                switch (fieldType)
                {
                case FieldType.String:
                    Metadata.MetaModel.AxEdtString edtString = edt as Metadata.MetaModel.AxEdtString;
                    break;

                case FieldType.Enum:
                    Metadata.MetaModel.AxEdtEnum edtEnum = edt as Metadata.MetaModel.AxEdtEnum;
                    edtEnum.EnumType = this.controller.comboBoxFieldType.Text;
                    break;

                case FieldType.Memo:
                    edt.Extends = "FreTxt";
                    break;

                default:
                    break;
                }
            }
        }
Пример #2
0
        protected void addSpecificPropertiesToEdt(AxEdt edt)
        {
            FieldType fieldType;

            if (!edtExist)
            {
                Enum.TryParse <FieldType>(this.controller.comboBoxFieldType.SelectedValue.ToString(), out fieldType);

                switch (fieldType)
                {
                case FieldType.String:
                    Metadata.MetaModel.AxEdtString edtString = edt as Metadata.MetaModel.AxEdtString;
                    if (newStrEDTLen > 0 && edtString.Extends == String.Empty)
                    {
                        edtString.StringSize = newStrEDTLen;
                    }
                    break;

                case FieldType.Enum:
                    Metadata.MetaModel.AxEdtEnum edtEnum  = edt as Metadata.MetaModel.AxEdtEnum;
                    Metadata.MetaModel.AxEdtEnum edtLocal = this.MetadataProvider.Edts.Read(this.extendsText) as Metadata.MetaModel.AxEdtEnum;

                    if (edtEnum != null && edtLocal != null)
                    {
                        edtEnum.EnumType = edtLocal.EnumType;
                    }
                    break;

                case FieldType.Memo:
                    if (edt.Extends == String.Empty)
                    {
                        edt.Extends = "FreeTxt";
                    }
                    break;

                default:
                    break;
                }
            }
        }
Пример #3
0
        public Metadata.MetaModel.AxEdt buildEdt()
        {
            Metadata.MetaModel.AxEdt edt;

            edt = this.MetadataProvider.Edts.Read(this.edtText);

            if (edt != null)
            {
                edtExist = true;
            }
            else
            {
                switch (this.fieldType)
                {
                case FieldType.String:
                    edt = new Metadata.MetaModel.AxEdtString();
                    break;

                case FieldType.Integer:
                    edt = new Metadata.MetaModel.AxEdtInt();
                    break;

                case FieldType.Real:
                    edt = new Metadata.MetaModel.AxEdtReal();
                    break;

                case FieldType.DateTime:
                    edt = new Metadata.MetaModel.AxEdtUtcDateTime();
                    break;

                case FieldType.Guid:
                    edt = new Metadata.MetaModel.AxEdtGuid();
                    break;

                case FieldType.Int64:
                    edt = new Metadata.MetaModel.AxEdtInt64();
                    break;

                case FieldType.Enum:
                    edt = new Metadata.MetaModel.AxEdtEnum();
                    break;

                case FieldType.Time:
                    edt = new Metadata.MetaModel.AxEdtTime();
                    break;

                case FieldType.Container:
                    edt = new Metadata.MetaModel.AxEdtContainer();
                    break;

                case FieldType.Memo:
                    edt = new Metadata.MetaModel.AxEdtString();
                    break;

                case FieldType.Date:
                    edt = new Metadata.MetaModel.AxEdtDate();
                    break;

                default:
                    throw new NotImplementedException($"Field type {this.controller.comboBoxFieldType.ToString()} is not supported");
                }

                edt.Name = this.edtText;
            }

            return(edt);
        }