本文整理汇总了C#中Entities.List.Add方法的典型用法代码示例。如果您正苦于以下问题:C# List.Add方法的具体用法?C# List.Add怎么用?C# List.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities.List
的用法示例。
在下文中一共展示了List.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from NodeRoute a where ");
NodeRoute noderoute = (NodeRoute)data;
if (noderoute != null)
{
Parms = new List<Object[]>();
if (noderoute.RowID != 0)
{
sql.Append(" a.RowID = :id and ");
Parms.Add(new Object[] { "id", noderoute.RowID });
}
if (noderoute.NextNode != null && noderoute.NextNode.NodeID != 0)
{
sql.Append(" a.NextNode.NodeID = :id1 and ");
Parms.Add(new Object[] { "id1", noderoute.NextNode.NodeID });
}
if (noderoute.CurNode != null && noderoute.CurNode.NodeID != 0)
{
sql.Append(" a.CurNode.NodeID = :id2 and ");
Parms.Add(new Object[] { "id2", noderoute.CurNode.NodeID });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append("1=1 order by a.RowID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例2: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from ConnectionType a where ");
ConnectionType ConnectionType = (ConnectionType)data;
if (ConnectionType != null)
{
Parms = new List<Object[]>();
if (ConnectionType.RowID != 0)
{
sql.Append(" a.RowID = :id and ");
Parms.Add(new Object[] { "id", ConnectionType.RowID });
}
if (ConnectionType.IsEditable != null)
{
sql.Append(" a.IsEditable = :edt and ");
Parms.Add(new Object[] { "edt", ConnectionType.IsEditable });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.RowID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例3: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from UnitProductEquivalence a where ");
UnitProductEquivalence unitproductequivalence = (UnitProductEquivalence)data;
if (unitproductequivalence != null)
{
Parms = new List<Object[]>();
if (unitproductequivalence.RowID != 0)
{
sql.Append(" a.RowID = :id and ");
Parms.Add(new Object[] { "id", unitproductequivalence.RowID });
}
if (unitproductequivalence.UnitProductRelation != null && unitproductequivalence.UnitProductRelation.RowID != 0)
{
sql.Append(" a.UnitProductRelation.RowID = :id1 and ");
Parms.Add(new Object[] { "id1", unitproductequivalence.UnitProductRelation.RowID });
}
if (unitproductequivalence.EquivMeasureUnit != null && unitproductequivalence.EquivMeasureUnit.MeasureUnitID != 0)
{
sql.Append(" a.EquivMeasureUnit.MeasureUnitID = :id2 and ");
Parms.Add(new Object[] { "id2", unitproductequivalence.EquivMeasureUnit.MeasureUnitID });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.RowID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例4: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from DocumentConcept a where ");
DocumentConcept docconcept = (DocumentConcept)data;
if (docconcept != null)
{
Parms = new List<Object[]>();
if (docconcept.DocConceptID != 0)
{
sql.Append(" a.DocConceptID = :id and ");
Parms.Add(new Object[] { "id", docconcept.DocConceptID });
}
if (docconcept.DocClass != null && docconcept.DocClass.DocClassID != 0)
{
sql.Append(" a.DocClass.DocClassID = :id1 and ");
Parms.Add(new Object[] { "id1", docconcept.DocClass.DocClassID });
}
if (!String.IsNullOrEmpty(docconcept.Name))
{
sql.Append(" a.Name = :nom and ");
Parms.Add(new Object[] { "nom", docconcept.Name });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.DocConceptID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例5: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from IqTable a where ");
IqTable iqtable = (IqTable)data;
if (iqtable != null)
{
Parms = new List<Object[]>();
if (iqtable.TableId != 0)
{
sql.Append(" a.TableId = :id and ");
Parms.Add(new Object[] { "id", iqtable.TableId });
}
if (!String.IsNullOrEmpty(iqtable.Name))
{
sql.Append(" a.Name = :nom2 and ");
Parms.Add(new Object[] { "nom2", iqtable.Name });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append("1=1 order by a.TableId asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例6: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from C_CasNumber a where ");
C_CasNumber C_CasNumber = (C_CasNumber)data;
if (C_CasNumber != null)
{
Parms = new List<Object[]>();
if (C_CasNumber.CasNumberID != 0)
{
sql.Append(" a.CasNumberID = :id and ");
Parms.Add(new Object[] { "id", C_CasNumber.CasNumberID });
}
if (!String.IsNullOrEmpty(C_CasNumber.Name))
{
sql.Append(" (a.Name like :nom OR a.Code like :nomz) and ");
Parms.Add(new Object[] { "nom", "%" + C_CasNumber.Name + "%" });
Parms.Add(new Object[] { "nomz", C_CasNumber.Name + "%" });
}
if (!String.IsNullOrEmpty(C_CasNumber.Code))
{
sql.Append(" a.Code = :nom1 and ");
Parms.Add(new Object[] { "nom1", C_CasNumber.Code });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.CasNumberID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例7: GetHsql
public override IQuery GetHsql(object data)
{
StringBuilder sql = new StringBuilder("select a from MenuOptionExtension a where ");
MenuOptionExtension MenuOptionExtension = (MenuOptionExtension)data;
if (MenuOptionExtension != null)
{
Parms = new List<Object[]>();
if (MenuOptionExtension.RowID != 0)
{
sql.Append(" a.RowID = :id and ");
Parms.Add(new Object[] { "id", MenuOptionExtension.RowID });
}
if (MenuOptionExtension.MenuOption != null && MenuOptionExtension.MenuOption.MenuOptionID != 0)
{
sql.Append(" a.MenuOption.MenuOptionID = :id1 and ");
Parms.Add(new Object[] { "id1", MenuOptionExtension.MenuOption.MenuOptionID });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append("1=1 order by a.RowID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例8: GetHsql
public override IQuery GetHsql(object data)
{
StringBuilder sql = new StringBuilder("select a from MenuOption a where ");
MenuOption menuoption = (MenuOption)data;
if (menuoption != null)
{
Parms = new List<Object[]>();
if (menuoption.MenuOptionID != 0)
{
sql.Append(" a.MenuOptionID = :id and ");
Parms.Add(new Object[] { "id", menuoption.MenuOptionID });
}
if (!String.IsNullOrEmpty(menuoption.Name))
{
sql.Append(" a.Name = :nom and ");
Parms.Add(new Object[] { "nom", menuoption.Name });
}
if (!String.IsNullOrEmpty(menuoption.Url))
{
sql.Append(" a.Url = :nom1 and ");
Parms.Add(new Object[] { "nom1", menuoption.Url });
}
if (menuoption.MenuOptionType != null && menuoption.MenuOptionType.MenuOptionTypeID != 0)
{
sql.Append(" a.MenuOptionType.MenuOptionTypeID = :id1 and ");
Parms.Add(new Object[] { "id1", menuoption.MenuOptionType.MenuOptionTypeID });
}
if (menuoption.NumOrder != 0)
{
sql.Append(" a.NumOrder = :id2 and ");
Parms.Add(new Object[] { "id2", menuoption.NumOrder });
}
if (menuoption.Active != null)
{
sql.Append(" a.Active = :ia2 and ");
Parms.Add(new Object[] { "ia2", menuoption.Active });
}
if (menuoption.OptionType != null && menuoption.OptionType.OpTypeID != 0)
{
sql.Append(" a.OptionType.OpTypeID = :io2 and ");
Parms.Add(new Object[] { "io2", menuoption.OptionType.OpTypeID });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append("1=1 order by a.MenuOptionID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例9: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from Rol a where ");
Rol rol = (Rol)data;
if (rol != null)
{
Parms = new List<Object[]>();
if (rol.RolID != 0)
{
sql.Append(" a.RolID = :id and ");
Parms.Add(new Object[] { "id", rol.RolID });
}
if (!String.IsNullOrEmpty(rol.RolCode))
{
sql.Append(" a.RolCode = :nom and ");
Parms.Add(new Object[] { "nom", rol.RolCode });
}
if (!String.IsNullOrEmpty(rol.Name))
{
sql.Append(" a.Name = :nom1 and ");
Parms.Add(new Object[] { "nom1", rol.Name });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append("1=1 order by a.RolID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例10: FillTeams
public List<Team> FillTeams(Team homeTeam, Team awayTeam)
{
List<Team> teams = new List<Team>();
teams.Add(homeTeam);
teams.Add(awayTeam);
return teams;
}
示例11: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from C_CasNumberRule a where ");
C_CasNumberRule C_CasNumberRule = (C_CasNumberRule)data;
if (C_CasNumberRule != null)
{
Parms = new List<Object[]>();
if (C_CasNumberRule.RowID != 0)
{
sql.Append(" a.RowID = :id and ");
Parms.Add(new Object[] { "id", C_CasNumberRule.RowID });
}
if (C_CasNumberRule.CasNumber != null && C_CasNumberRule.CasNumber.CasNumberID != 0)
{
sql.Append(" a.CasNumber.CasNumberID = :idp1 and ");
Parms.Add(new Object[] { "idp1", C_CasNumberRule.CasNumber.CasNumberID });
}
if (C_CasNumberRule.Rule != null )
{
if (C_CasNumberRule.Rule.MetaMasterID != 0)
{
sql.Append(" a.Rule.MetaMasterID = :idc1 and ");
Parms.Add(new Object[] { "idc1", C_CasNumberRule.Rule.MetaMasterID });
}
if (C_CasNumberRule.Rule.MetaType != null)
{
if (C_CasNumberRule.Rule.MetaType.MetaTypeID != 0)
{
sql.Append(" a.Rule.MetaType.MetaTypeID = :itt1 and ");
Parms.Add(new Object[] { "itt1", C_CasNumberRule.Rule.MetaType.MetaTypeID });
}
if (!string.IsNullOrEmpty(C_CasNumberRule.Rule.MetaType.Code))
{
sql.Append(" a.Rule.MetaType.Code= :itc1 and ");
Parms.Add(new Object[] { "itc1", C_CasNumberRule.Rule.MetaType.Code });
}
}
}
if (! string.IsNullOrEmpty(C_CasNumberRule.RuleValue))
{
sql.Append(" a.RuleValue = :idz1 and ");
Parms.Add(new Object[] { "idz1", C_CasNumberRule.RuleValue });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.RowID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例12: CreateInteractiveEntities
/// <summary>
/// Creates the bonuses, obstacles and power ups contained in a level.
/// </summary>
/// <param name="interactiveEntityDescriptions">A list of interactive entity descriptions.</param>
/// <param name="physicsWorld">The physics world to create the entities in.</param>
/// <param name="interactiveEntities">An empty list to store the interactive entities in.</param>
/// <param name="mineCart">The mine cart entity.</param>
/// <param name="cartSwitch">The switch entity.</param>
/// <param name="spriteBatch">The sprite batch to use for rendering.</param>
/// <param name="contentManager">The game's content manager.</param>
public static void CreateInteractiveEntities(List<InteractiveEntityDescription> interactiveEntityDescriptions, ref World physicsWorld, ref List<InteractiveEntity> interactiveEntities, ref MineCart mineCart, ref Switch cartSwitch, SpriteBatch spriteBatch, ContentManager contentManager)
{
if (interactiveEntities.Count == 0)
{
foreach (InteractiveEntityDescription description in interactiveEntityDescriptions)
{
if (EntityConstants.PowerUpNames.Contains(description.Name))
{
interactiveEntities.Add(new PowerUp(ref physicsWorld, spriteBatch, contentManager, description, EntitySettingsLoader.GetPowerUpSettings(description.Name)));
}
else if (EntityConstants.BonusNames.Contains(description.Name) || EntityConstants.ObstacleNames.Contains(description.Name))
{
interactiveEntities.Add(new BonusOrObstacle(ref physicsWorld, spriteBatch, contentManager, description, EntitySettingsLoader.GetObstacleOrBonusSetting(description.Name)));
}
else if (description.Name == EntityConstants.CartBody)
{
mineCart = new MineCart(spriteBatch, contentManager, ref physicsWorld, description.Position, 100.0f, 240.0f, 350.0f, 80.0f, -80.0f);
}
else if (description.Name == EntityConstants.Switch)
{
cartSwitch = new Switch(spriteBatch, contentManager, ref physicsWorld, description.Position, mineCart);
}
}
}
}
示例13: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from Contract a where ");
Contract Contract = (Contract)data;
if (Contract != null)
{
Parms = new List<Object[]>();
if (Contract.ContractID != 0)
{
sql.Append(" a.ContractID = :id and ");
Parms.Add(new Object[] { "id", Contract.ContractID });
}
if (Contract.Account != null && Contract.Account.AccountID != 0)
{
sql.Append(" a.Account.AccountID = :id1 and ");
Parms.Add(new Object[] { "id1", Contract.Account.AccountID });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.ContractID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例14: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from ContactPosition a where ");
ContactPosition contactposition = (ContactPosition)data;
if (contactposition != null)
{
Parms = new List<Object[]>();
if (contactposition.ContactPositionID != 0)
{
sql.Append(" a.ContactPositionID = :id and ");
Parms.Add(new Object[] { "id", contactposition.ContactPositionID });
}
if (!String.IsNullOrEmpty(contactposition.Name))
{
sql.Append(" a.Name = :nom and ");
Parms.Add(new Object[] { "nom", contactposition.Name });
}
//if (contactposition.Status != null && contactposition.Status.StatusID != 0)
//{
// sql.Append(" a.Status.StatusID= :id1 and ");
// Parms.Add(new Object[] { "id1", contactposition.Status.StatusID });
//}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.contactPositionID asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}
示例15: GetHsql
public override IQuery GetHsql(Object data)
{
StringBuilder sql = new StringBuilder("select a from ZoneBinRelation a where ");
ZoneBinRelation zoneRel = (ZoneBinRelation)data;
if ( zoneRel != null)
{
Parms = new List<Object[]>();
if ( zoneRel.Zone != null && zoneRel.Zone.ZoneID != 0 )
{
sql.Append(" a.Zone.ZoneID = :id and ");
Parms.Add(new Object[] { "id", zoneRel.Zone.ZoneID });
}
if (zoneRel.Bin != null && zoneRel.Bin.BinID != 0)
{
sql.Append(" a.Bin.BinID = :id1 and ");
Parms.Add(new Object[] { "id1", zoneRel.Bin.BinID });
}
if (zoneRel.BinType != 0)
{
sql.Append(" a.BinType = :id2 and ");
Parms.Add(new Object[] { "id2", zoneRel.BinType });
}
}
sql = new StringBuilder(sql.ToString());
sql.Append(" 1=1 order by a.Rank asc ");
IQuery query = Factory.Session.CreateQuery(sql.ToString());
SetParameters(query);
return query;
}