Ejemplo n.º 1
0
        public static Collection<FishTackleInfo> GetFishTacklesInShop()
        {
            try
            {
                XmlDocument objXmlDoc = GetMasterDataFile(Constants.FILE_FISHTACKLESMASTERDATA);
                if (objXmlDoc == null)
                    return null;

                DataView dv = GetData(objXmlDoc, "data/fishtackles");

                Collection<FishTackleInfo> fishtackles = new Collection<FishTackleInfo>();

                for (int ix = 0; ix < dv.Table.Rows.Count; ix++)
                {
                    FishTackleInfo fishtackle = new FishTackleInfo();
                    fishtackle.TId = DataConvert.GetInt32(dv.Table.Rows[ix]["tid"]);
                    fishtackle.Name = DataConvert.GetString(dv.Table.Rows[ix]["name"]);
                    fishtackle.Price = DataConvert.GetInt32(dv.Table.Rows[ix]["price"]);
                    fishtackle.Rank = DataConvert.GetInt32(dv.Table.Rows[ix]["rank"]);
                    fishtackle.FMWeight = DataConvert.GetInt32(dv.Table.Rows[ix]["fmweight"]);                    
                    fishtackles.Add(fishtackle);
                }
                return fishtackles;
            }
            catch (Exception ex)
            {
                LogHelper.Write("ConfigCtrl.GetFishTacklesInShop", ex);
                return null;
            }
        }
Ejemplo n.º 2
0
        public static Collection<FishTackleInfo> GetMyTackles(string content)
        {
            try
            {
                if (String.IsNullOrEmpty(content))
                    return new Collection<FishTackleInfo>();

                XmlDocument objXmlDoc = new XmlDocument();
                objXmlDoc.LoadXml(content);

                DataView dv = GetData(objXmlDoc, "data/tackle");

                Collection<FishTackleInfo> fishtackles = new Collection<FishTackleInfo>();

                for (int ix = 0; ix < dv.Table.Rows.Count; ix++)
                {
                    FishTackleInfo fishtackle = new FishTackleInfo();
                    fishtackle.Status = DataConvert.GetInt32(dv.Table.Rows[ix]["status"]);
                    if (fishtackle.Status == 1)
                    {
                        fishtackle.BUse = DataConvert.GetInt32(dv.Table.Rows[ix]["buse"]);
                        fishtackle.TackleId = DataConvert.GetInt32(dv.Table.Rows[ix]["tackleid"]);
                        fishtackle.TId = DataConvert.GetInt32(dv.Table.Rows[ix]["tid"]);
                        fishtackle.Title = JsonHelper.FiltrateHtmlTags(DataConvert.GetString(dv.Table.Rows[ix]["title"]));
                    }
                    fishtackles.Add(fishtackle);
                }

                return fishtackles;
            }
            catch (Exception ex)
            {
                LogHelper.Write("ConfigCtrl.GetMyTackles", content, ex, LogSeverity.Error);
                return null;
            }
        }
Ejemplo n.º 3
0
        public static Collection<FishTackleInfo> GetOriginalFishTackles(string content)
        {
            try
            {
                if (String.IsNullOrEmpty(content))
                    return new Collection<FishTackleInfo>();

                XmlDocument objXmlDoc = new XmlDocument();
                objXmlDoc.LoadXml(content);

                DataView dv = GetData(objXmlDoc, "data/tackle");

                Collection<FishTackleInfo> fishtackles = new Collection<FishTackleInfo>();

                for (int ix = 0; ix < dv.Table.Rows.Count; ix++)
                {
                    FishTackleInfo fishtackle = new FishTackleInfo();
                    fishtackle.TId = DataConvert.GetInt32(dv.Table.Rows[ix]["tid"]);
                    fishtackle.Name = DataConvert.GetString(dv.Table.Rows[ix]["name"]);
                    fishtackle.Price = DataConvert.GetInt32(dv.Table.Rows[ix]["price"]);
                    fishtackle.Rank = DataConvert.GetInt32(dv.Table.Rows[ix]["rank"]);
                    fishtackle.FMWeight = DataConvert.GetInt32(dv.Table.Rows[ix]["fmweight"]) / 10;
                    fishtackles.Add(fishtackle);
                }

                return fishtackles;
            }
            catch (Exception ex)
            {
                LogHelper.Write("ConfigCtrl.GetOriginalFishTackles", content, ex, LogSeverity.Error);
                return null;
            }
        }