private string GetFilterCategory(int categoryID) { if (dicCateFilter.ContainsKey(categoryID)) { return(dicCateFilter[categoryID]); } else { String r = String.Format("c{0}_ ", categoryID.ToString("D3")); DB.ListClassificationDataTable dt = new DB.ListClassificationDataTable(); DBTableAdapters.ListClassificationTableAdapter adt = new DBTableAdapters.ListClassificationTableAdapter(); adt.Connection.ConnectionString = connectionString; adt.FillBy_ID(dt, categoryID); if (dt.Rows.Count > 0) { int idParent = int.Parse(dt.Rows[0]["ParentID"].ToString()); if (idParent != 0) { r += " " + GetFilterCategory(idParent); } } dt.Dispose(); adt.Dispose(); dicCateFilter[categoryID] = r; return(r); } }
public Category() { _adt = new DBTableAdapters.ListClassificationTableAdapter(); _dt = new DB.ListClassificationDataTable(); _adt.Connection.ConnectionString = Server.ConnectionString; }