コード例 #1
0
        /* Field versions */
        public List <FieldVersion> GetFieldVersions(string selectedPlatform)
        {
            FileColumns fc = FORIS.Interbilling.NTS.Mediation.Configurations.Configuration.GetNotCashedConfiguration <FileColumns>();

            string selectedFileType  = selectedPlatform;
            List <FieldVersion> list = new List <FieldVersion>();

            if (fc.Files.Exists(p => p.fileType == selectedFileType))
            {
                var versionsList = fc.Files.Find(p => p.fileType == selectedFileType).Versions;
                var version      = versionsList.FindAll(p => p.VersionName != "");

                foreach (var v in versionsList)
                {
                    FieldVersion obj = new FieldVersion(); //
                    obj.Version  = v.VersionName;
                    obj.Format   = v.VersionFileNameFormat;
                    obj.DateFrom = v.VersionStartDate;
                    obj.DateTo   = v.VersionEndDate;

                    list.Add(obj);
                }
            }
            return(list);
        }
コード例 #2
0
        public void Test()
        {
            // Setup

            // Create Form
            Form        form        = EntityFactory.GetForm();
            FormVersion formVersion = EntityFactory.GetFormVersion();

            formVersion.Version = 1;
            formVersion.Form    = form;

            // Create Field
            Field firstNameField = EntityFactory.GetField();

            firstNameField.Type = FieldType.Text;
            FieldVersion firstNameFieldVersion = EntityFactory.GetFieldVersion();

            firstNameFieldVersion.Version = 1;
            firstNameFieldVersion.Name    = "FirstName";
            firstNameFieldVersion.Field   = firstNameField;

            Field lastNameField = EntityFactory.GetField();

            lastNameField.Type = FieldType.Text;
            FieldVersion lastNameFieldVersion = EntityFactory.GetFieldVersion();

            lastNameFieldVersion.Version = 1;
            lastNameFieldVersion.Name    = "LastName";
            lastNameFieldVersion.Field   = lastNameField;

            formVersion.Fields = new List <FieldVersion>();
            formVersion.Fields.Add(firstNameFieldVersion);
            formVersion.Fields.Add(lastNameFieldVersion);

            // Test
            Form result = _crudRepository.Create(form);

            // Assert
            Assert.NotNull(result);
        }