Example #1
0
        public static PopupObjectCollection DataTableToCollection(DataTable popups)
        {
            PopupObjectCollection objectsTotal;
            PopupObjectCollection objects = new PopupObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = popups.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(PopupRowToObject(current));
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                objectsTotal = objects;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(objectsTotal);
        }
Example #2
0
 public static PopupObjectCollection DataTableToCollection(DataTable popups)
 {
     PopupObjectCollection objectsTotal;
     PopupObjectCollection objects = new PopupObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = popups.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(PopupRowToObject(current));
             }
         }
         finally
         {
             if (enumerator is IDisposable)
             {
                 (enumerator as IDisposable).Dispose();
             }
         }
         objectsTotal = objects;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return objectsTotal;
 }
 public PopupObjectCollection GetActive()
 {
     try
     {
         PopupObjectCollection Popups = new PopupObjectCollection();
         foreach (PopupObject Popup in this)
         {
             if (Popup.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
             {
                 Popups.Add(Popup);
             }
         }
         return(Popups);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public PopupObjectCollection GetAllActiveByEmployee(UserObject user)
 {
     PopupObjectCollection popups = new PopupObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(PopupUserObject.USER_ID, user.UsrID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + PopupUserObject.USER_ID + " is not null ");
         builder.Append("AND " + PopupUserObject.POPUP_ID + " is not null ");
         builder.AppendWhereBoolean(PopupObject.ACTIVE, true, QueryBuilder.ParameterLocation.LAST);
         popups = PopupConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return popups;
 }
 public PopupObjectCollection GetActive()
 {
     try
     {
         PopupObjectCollection Popups = new PopupObjectCollection();
         foreach (PopupObject Popup in this)
         {
             if (Popup.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
                 Popups.Add(Popup);
         }
         return Popups;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }