当前位置: 首页>>代码示例>>C#>>正文


C# SQL.FindByid方法代码示例

本文整理汇总了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;
        }
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:54,代码来源:CompanionConverter.cs

示例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;

        }
开发者ID:Duke-Jones,项目名称:ED-IBE,代码行数:53,代码来源:CompanionConverter.cs


注:本文中的SQL.FindByid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。