public static IPostgresTuple CreateExtendedRecordTupleFrom(global::UseCase1.Customer item, bool[] useColumn)
        {
            if (item == null)
            {
                return(null);
            }
            var items = new IPostgresTuple[ExtendedColumnCount];

            if (useColumn[ExtendedProperty_ID_Index])
            {
                items[ExtendedProperty_ID_Index] = _DatabaseCommon.Utility.GuidToTuple(item.ID);
            }
            if (useColumn[ExtendedProperty_Name_Index])
            {
                items[ExtendedProperty_Name_Index] = _DatabaseCommon.Utility.StringToTuple(item.Name);
            }
            if (useColumn[ExtendedProperty_RegistrationNumber_Index])
            {
                items[ExtendedProperty_RegistrationNumber_Index] = _DatabaseCommon.Utility.IntegerToTuple(item.RegistrationNumber);
            }
            if (item.SubmissionsURI != null)
            {
                if (useColumn[ExtendedProperty_SubmissionsURI_Index])
                {
                    items[ExtendedProperty_SubmissionsURI_Index] = ArrayTuple.Create(item.SubmissionsURI, it => new Revenj.DatabasePersistence.Postgres.Converters.ValueTuple(it));
                }
            }
            ;
            return(RecordTuple.From(items));
        }
예제 #2
0
        public static IPostgresTuple CreateRecordTupleFrom(global::UseCase1.FormGroup item, bool[] useColumn)
        {
            if (item == null)
            {
                return(null);
            }
            var items = new IPostgresTuple[ColumnCount];

            if (useColumn[Property_ID_Index])
            {
                items[Property_ID_Index] = _DatabaseCommon.Utility.GuidToTuple(item.ID);
            }
            if (useColumn[Property_Name_Index])
            {
                items[Property_Name_Index] = _DatabaseCommon.Utility.StringToTuple(item.Name);
            }
            if (item.FormsURI != null)
            {
                if (useColumn[Property_FormsURI_Index])
                {
                    items[Property_FormsURI_Index] = ArrayTuple.Create(item.FormsURI, it => new Revenj.DatabasePersistence.Postgres.Converters.ValueTuple(it));
                }
            }
            ;
            return(RecordTuple.From(items));
        }
        public static IPostgresTuple CreateExtendedTupleFrom(global::UseCase1.Form item)
        {
            if (item == null)
            {
                return(null);
            }
            var items = new IPostgresTuple[ExtendedColumnCount];

            items[ExtendedProperty_ID_Index]     = _DatabaseCommon.Utility.GuidToTuple(item.ID);
            items[ExtendedProperty_Name_Index]   = _DatabaseCommon.Utility.StringToTuple(item.Name);
            items[ExtendedProperty_Schema_Index] = _DatabaseCommon.Utility.StringToTuple(item.Schema);
            if (item.GroupURI != null)
            {
                items[ExtendedProperty_GroupURI_Index] = new Revenj.DatabasePersistence.Postgres.Converters.ValueTuple(item.GroupURI);
            }
            ;
            items[ExtendedProperty_GroupID_Index] = _DatabaseCommon.Utility.GuidToTuple(item.GroupID);
            items[ExtendedProperty_Status_Index]  = _DatabaseCommon.FactoryUseCase1_FormStatus.FormStatusConverter.CreateTupleFrom(item.Status);
            items[ExtendedProperty_Inputs_Index]  = ArrayTuple.Create(item.Inputs, _DatabaseCommon.FactoryUseCase1_Entry.EntryConverter.CreateExtendedTupleFrom);
            items[ExtendedProperty_Outputs_Index] = ArrayTuple.Create(item.Outputs, _DatabaseCommon.FactoryUseCase1_Entry.EntryConverter.CreateExtendedTupleFrom);
            if (item.SubmissionsURI != null)
            {
                items[ExtendedProperty_SubmissionsURI_Index] = ArrayTuple.Create(item.SubmissionsURI, it => new Revenj.DatabasePersistence.Postgres.Converters.ValueTuple(it));
            }
            ;
            return(RecordTuple.From(items));
        }
예제 #4
0
        public static IPostgresTuple CreateExtendedTupleFrom(global::UseCase1.SelectedSubmission item)
        {
            if (item == null)
            {
                return(null);
            }
            var items = new IPostgresTuple[ExtendedColumnCount];

            items[ExtendedProperty_URI_Index]        = new Revenj.DatabasePersistence.Postgres.Converters.ValueTuple(item.URI);
            items[ExtendedProperty_Customer_Index]   = _DatabaseCommon.Utility.StringToTuple(item.Customer);
            items[ExtendedProperty_Form_Index]       = _DatabaseCommon.Utility.StringToTuple(item.Form);
            items[ExtendedProperty_Schema_Index]     = _DatabaseCommon.Utility.StringToTuple(item.Schema);
            items[ExtendedProperty_FormInputs_Index] = ArrayTuple.Create(item.FormInputs, _DatabaseCommon.FactoryUseCase1_Entry.EntryConverter.CreateExtendedTupleFrom);
            items[ExtendedProperty_Group_Index]      = _DatabaseCommon.Utility.StringToTuple(item.Group);
            items[ExtendedProperty_Comments_Index]   = _DatabaseCommon.Utility.StringToTuple(item.Comments);
            items[ExtendedProperty_Date_Index]       = _DatabaseCommon.Utility.TimestampToTuple(item.Date);
            return(RecordTuple.From(items));
        }