using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace Chop.Game.Catalogue { public class CataloguePage { #region Fields private int _pageID; private int _orderID; private byte _minimumRank; private string _layoutCode; private string _indexName; private string _displayName; private List _images; private List _texts; private string mImg_Header; private string mImg_Side; private string mLabel_Description; private string mLabel_Misc; private string mLabel_Moredetails; #endregion #region Properties public int IndexID { get { return _pageID; } } public int OrderID { get { return _orderID; } } public byte MinRank { get { return _minimumRank; } } public string IndexName { get { return _indexName; } } public string DisplayName { get { return _displayName; } } public string Style_Layout { get { return _layoutCode; } } public string Img_Header { get { return mImg_Header; } } public string Img_Side { get { return mImg_Side; } } public string Label_Description { get { return mLabel_Description; } } public string Label_Misc { get { return mLabel_Misc; } } public string Label_Moredetails { get { return mLabel_Moredetails; } } #endregion #region Methods public static CataloguePage Parse(DataRow row) { CataloguePage page = new CataloguePage { _pageID = Convert.ToInt32(row["indexid"]), _orderID = Convert.ToInt32(row["orderid"]), _minimumRank = Convert.ToByte(row["minrank"]), _indexName = row["indexname"].ToString(), _displayName = row["displayname"].ToString(), _layoutCode = row["style_layout"].ToString(), mImg_Header = row["img_header"].ToString(), mImg_Side = row["img_side"].ToString(), mLabel_Description = row["label_description"].ToString(), mLabel_Misc = row["label_misc"].ToString(), mLabel_Moredetails = row["label_moredetails"].ToString() }; return page; } //public string ToFuseString() //{ // List Products = Core.CatalogueManager.GetProducts(_pageID); // ResponseBuilder fBuilder = new ResponseBuilder(); // fBuilder.Append("i:"); // fBuilder.AppendString(_indexName, 13); // fBuilder.Append("n:"); // fBuilder.AppendString(_displayName, 13); // fBuilder.Append("l:"); // fBuilder.AppendString(_layoutCode, 13); // if (mImg_Header != "") // If there's a headline image set, add it // { // fBuilder.Append("g:"); // fBuilder.AppendString(mImg_Header, 13); // } // if (mImg_Side != "") // If there is/are side image(s) set, add it/them // { // fBuilder.Append("e:"); // fBuilder.AppendString(mImg_Side, 13); // } // if (mLabel_Description != "") // If there's a description set, add it // { // fBuilder.Append("h:"); // fBuilder.AppendString(mLabel_Description, 13); // } // if (mLabel_Moredetails != "") // If there's a 'Click here for more details' label set, add it // { // fBuilder.Append("w:"); // fBuilder.AppendString(mLabel_Moredetails, 13); // } // if (mLabel_Misc != "") // If the misc additions field is not blank // { // string[] miscDetail = mLabel_Misc.Split(Convert.ToChar(13)); // foreach (string t in miscDetail) // fBuilder.AppendString(t, 13); // } // foreach (CatalogueProduct product in Products) // { // fBuilder.Append(product.ToFuseString()); // } // return fBuilder.ToString(); //} #endregion } }