本文整理汇总了C#中SQL.FindByid方法的典型用法代码示例。如果您正苦于以下问题:C# SQL.FindByid方法的具体用法?C# SQL.FindByid怎么用?C# SQL.FindByid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL.FindByid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetShipFromFDevIDs
public EDDN.ShipyardObject GetShipFromFDevIDs(SQL.Datasets.dsEliteDB.tbshipyardbaseDataTable basedata, Newtonsoft.Json.Linq.JToken shipyardItem, bool param1)
{
EDDN.ShipyardObject shipyardObject = null;
String skuString = null;
try
{
if(shipyardItem != null)
{
if (shipyardItem.SelectToken("id", false) == null)
throw new NotSupportedException(String.Format("Missing id : {0}", shipyardItem));
SQL.Datasets.dsEliteDB.tbshipyardbaseRow itemData = basedata.FindByid((Int32)shipyardItem.SelectToken("id", false));
if(itemData != null)
{
shipyardObject = new EDDN.ShipyardObject();
shipyardObject.Id = itemData.id;
shipyardObject.Name = itemData.name;
shipyardObject.BaseValue = shipyardItem.SelectToken("basevalue").ToString();
shipyardObject.Sku = skuString = (shipyardItem.SelectToken("sku", false) ?? "").ToString();
if(shipyardItem.SelectToken("unavailableReason", false) != null)
shipyardObject.UnavailableReason = shipyardItem.SelectToken("unavailableReason", false).ToString();
if(shipyardItem.SelectToken("factionId", false) != null)
shipyardObject.FactionID = shipyardItem.SelectToken("factionId", false).ToString();
if(shipyardItem.SelectToken("requiredRank", false) != null)
shipyardObject.RequiredRank = shipyardItem.SelectToken("requiredRank", false).ToString();
}
else
throw new NotSupportedException(String.Format("{0}: Unknown ship", shipyardItem));
}
else
Debug.Print("!");
return shipyardObject;
}
catch (NotSupportedException ex)
{
Program.MainLog.Log(String.Format("Converting error: {0}", ex.Message));
}
catch (Exception ex)
{
throw new Exception("Error while converting companion data to shipyard object", ex);
}
return null;
}
示例2: GetOutfittingFromFDevIDs
public EDDN.OutfittingObject GetOutfittingFromFDevIDs(SQL.Datasets.dsEliteDB.tboutfittingbaseDataTable basedata, Newtonsoft.Json.Linq.JToken outfittingItem, bool param1)
{
EDDN.OutfittingObject outfitting = null;
List<String> nameParts;
String nameFull;
try
{
if(outfittingItem != null)
{
if(outfittingItem.SelectToken("id", false) == null)
throw new NotSupportedException(String.Format("Missing id : {0}", outfittingItem.ToString()));
nameFull = outfittingItem.SelectToken("name", false).ToString().ToLower();
nameParts = nameFull.Split(new char[] {'_'}).ToList();
if (!ignoreStuff.Contains(nameParts[0]))
{
SQL.Datasets.dsEliteDB.tboutfittingbaseRow itemData = basedata.FindByid((Int32)outfittingItem.SelectToken("id", false));
if(itemData != null)
{
outfitting = new EDDN.OutfittingObject();
outfitting.Id = itemData.id;
outfitting.Category = itemData.category;
outfitting.Name = itemData.name;
outfitting.Mount = itemData.mount;
outfitting.Guidance = itemData.guidance.ToNString();
outfitting.Ship = itemData.ship.ToNString();
outfitting.Class = itemData._class;
outfitting.Rating = itemData.rating;
outfitting.Entitlement = itemData.entitlement;
}
else
throw new NotSupportedException(String.Format("Unknown id : {0}", outfittingItem.ToString()));
}
}
}
catch (NotSupportedException ex)
{
Program.MainLog.Log(String.Format("Converting error: {0}", ex.Message));
}
catch (Exception ex)
{
throw new Exception("Error while converting companion data to shipyard object", ex);
}
return outfitting;
}