Exemple #1
0
 public static DigitalPicnik.ItemCollection PageLoadByList(int pageIndex, int pageSize, System.Guid listId)
 {
     DigitalPicnik.List list = DigitalPicnik.List.Load(listId);
     if ((list == null))
     {
         return(new DigitalPicnik.ItemCollection());
     }
     return(DigitalPicnik.ItemCollection.PageLoadByList(pageIndex, pageSize, null, list));
 }
Exemple #2
0
        private void LoadByList(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, DigitalPicnik.List list)
        {
            if ((reader == null))
            {
                throw new System.ArgumentNullException("reader");
            }
            if ((pageIndex < 0))
            {
                pageIndex = 0;
            }
            if ((pageSize < 0))
            {
                if ((pageOptions != null))
                {
                    pageSize = pageOptions.DefaultPageSize;
                }
                else
                {
                    pageSize = int.MaxValue;
                }
            }
            CodeFluent.Runtime.CodeFluentEntityState listState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
            if ((list != null))
            {
                listState = list.EntityState;
            }
            this._itemsListList = list;
            this.BaseList.Clear();
            this.BaseTable.Clear();
            int  count     = 0;
            int  readCount = 0;
            bool readerRead;

            for (readerRead = reader.Read(); ((readerRead == true) &&
                                              ((count < this.MaxCount) &&
                                               (count < pageSize))); readerRead = reader.Read())
            {
                readCount = (readCount + 1);
                if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true))
                {
                    DigitalPicnik.Item item = new DigitalPicnik.Item();
                    ((CodeFluent.Runtime.ICodeFluentEntity)(item)).ReadRecord(reader);
                    if ((this.BaseContains(item) == false))
                    {
                        this.BaseAdd(item);
                        count = (count + 1);
                    }
                    item.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
                }
            }
            if ((list != null))
            {
                list.EntityState = listState;
            }
        }
Exemple #3
0
 public static System.Data.IDataReader DataLoadByList(DigitalPicnik.List list)
 {
     System.Data.IDataReader reader = DigitalPicnik.ItemCollection.PageDataLoadByList(null, list);
     return(reader);
 }
Exemple #4
0
 public static System.Data.IDataReader PageDataLoadByList(CodeFluent.Runtime.PageOptions pageOptions, DigitalPicnik.List list)
 {
     if ((list == null))
     {
         return(null);
     }
     if ((list.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "list", "DigitalPicnik.List");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(DigitalPicnik.Constants.DigitalPicnikStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Item", "LoadByList");
     persistence.AddParameter("@ListId", list.Id, CodeFluentPersistence.DefaultGuidValue);
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(DigitalPicnik.Constants.DigitalPicnikStoreName).Persistence.ExecuteReader();
     return(reader);
 }
Exemple #5
0
 public static DigitalPicnik.ItemCollection LoadByList(DigitalPicnik.List list)
 {
     DigitalPicnik.ItemCollection ret = DigitalPicnik.ItemCollection.PageLoadByList(int.MinValue, int.MaxValue, null, list);
     return(ret);
 }
Exemple #6
0
 public static DigitalPicnik.ItemCollection PageLoadByList(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, DigitalPicnik.List list)
 {
     if ((pageIndex < 0))
     {
         pageIndex = 0;
     }
     if ((pageSize < 0))
     {
         if ((pageOptions != null))
         {
             pageSize = pageOptions.DefaultPageSize;
         }
         else
         {
             pageSize = int.MaxValue;
         }
     }
     DigitalPicnik.ItemCollection ret    = new DigitalPicnik.ItemCollection();
     System.Data.IDataReader      reader = null;
     try
     {
         reader = DigitalPicnik.ItemCollection.PageDataLoadByList(pageOptions, list);
         if ((reader == null))
         {
             return(ret);
         }
         ret.LoadByList(pageIndex, pageSize, pageOptions, reader, list);
     }
     finally
     {
         if ((reader != null))
         {
             reader.Dispose();
         }
         CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(DigitalPicnik.Constants.DigitalPicnikStoreName);
     }
     return(ret);
 }
Exemple #7
0
 public ItemCollection(DigitalPicnik.List itemsListList)
 {
     this._blm1060740988 = new CodeFluent.Runtime.Utilities.BindingListManager <DigitalPicnik.Item>(this);
     this._itemsListList = itemsListList;
 }