Skip to content

Instantly share code, notes, and snippets.

@smarenich smarenich/union.cs
Created Nov 12, 2015

Embed
What would you like to do?
public class SomeMaint : PXGraph<SomeMaint>
{
public PXSelect<UnionTable> UnionSelect;
protected IEnumerable unionSelect()
{
List<UnionTable> result = new List<UnionTable>();
foreach (SomeTable1 row in PXSelect<SomeTable1>.Select(this))
{
result.Add(new UnionTable() { UnionKey = row.SomeKey1, UnionValue = row.SomeValue1 };
}
foreach (SomeTable2 row in PXSelect<SomeTable2>.Select(this))
{
result.Add(new UnionTable() { UnionKey = row.SomeKey2, UnionValue = row.SomeValue2 };
}
return result;
}
}
[System.SerializableAttribute()]
public class SomeTable1 : IBqlTable
{
#region SomeKey1
public abstract class someKey1 : PX.Data.IBqlField { }
[PXString(IsUnicode = true, IsKey = true)]
[PXUIField(DisplayName = "Some Key 1")]
public virtual String SomeKey1 { get; set; }
#endregion
#region SomeValue1
public abstract class someValue1 : PX.Data.IBqlField { }
[PXUIField(DisplayName = "Some Value 1")]
[PXString(1024)]
public virtual String SomeValue1 { get; set; }
#endregion
}
[System.SerializableAttribute()]
public class SomeTable2 : IBqlTable
{
#region SomeKey2
public abstract class someKey2 : PX.Data.IBqlField { }
[PXString(IsUnicode = true, IsKey = true)]
[PXUIField(DisplayName = "Some Key 2")]
public virtual String SomeKey2 { get; set; }
#endregion
#region SomeValue2
public abstract class someValue2 : PX.Data.IBqlField { }
[PXUIField(DisplayName = "Some Value 2")]
[PXString(1024)]
public virtual String SomeValue2 { get; set; }
#endregion
}
[System.SerializableAttribute()]
public class UnionTable : IBqlTable
{
#region UnionKey
public abstract class unionKey : PX.Data.IBqlField { }
[PXString(IsUnicode = true, IsKey = true)]
[PXUIField(DisplayName = "Union Key")]
public virtual String UnionKey { get; set; }
#endregion
#region UnionValue
public abstract class unionValue : PX.Data.IBqlField {}
[PXUIField(DisplayName = "Union Value")]
[PXString(1024)]
public virtual String UnionValue { get; set; }
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.