Example #1
0
        public IList<IBShopScript> GetScript(int scriptId)
        {
            IBlazeDatabase db = null;
            IList<IBShopScript> resultList = new List<IBShopScript>();
            try
            {
                db = DbFactory.GetDatabase();
                DataSet dataSet = new DataSet();

                IBlazeTable ibShopTable = db.GetTable(TableString.IbShopTableName);
                ibShopTable.Get(dataSet, FilterFactory.CreateEqualFilter(TableString.IbShopFieldId, scriptId));
                
                DataRowCollection rows = dataSet.Tables[TableString.IbShopTableName].Rows;
                foreach (DataRow row in rows)
                {
                    IBShopScript ibShopScript = new IBShopScript();
                    ibShopScript.ID = (int)row[TableString.IbShopFieldId];
                    ibShopScript.TimeStamp = (DateTime)row[TableString.IbShopFieldTimeStamp];
                    ibShopScript.Script = Encoding.Default.GetString(row[TableString.IbShopFieldScript] as byte[]);
                    resultList.Add(ibShopScript);
                }
                return resultList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                    db.Close();
            }
        }
Example #2
0
        public IList <IBShopScript> GetScript()
        {
            IBlazeDatabase       db         = null;
            IList <IBShopScript> resultList = new List <IBShopScript>();

            try
            {
                db = DbFactory.GetDatabase();
                DataSet dataSet = new DataSet();

                IBlazeTable ibShopTable = db.GetTable(TableString.IbShopTableName);
                ibShopTable.Get(dataSet);

                DataRowCollection rows = dataSet.Tables[TableString.IbShopTableName].Rows;
                foreach (DataRow row in rows)
                {
                    IBShopScript ibShopScript = new IBShopScript();
                    ibShopScript.ID        = (int)row[TableString.IbShopFieldId];
                    ibShopScript.TimeStamp = (DateTime)row[TableString.IbShopFieldTimeStamp];
                    ibShopScript.Script    = Encoding.Default.GetString(row[TableString.IbShopFieldScript] as byte[]);
                    resultList.Add(ibShopScript);
                }
                return(resultList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (db != null)
                {
                    db.Close();
                }
            }
        }