public static BOPushNotificationList GetAllList(int startIndex, int length, string whereClause)
 {
     BOPushNotificationList itemObjs = null;
     tblPushNotification tblObj = new tblPushNotification();
     DataTable dt = tblObj.GetAllData(startIndex, length, whereClause, null);
     if (dt.Rows.Count > 0)
     {
         itemObjs = new BOPushNotificationList();
         foreach(DataRow dr in dt.Rows)
         {
             itemObjs.Add(FillDataRecord(dr));
         }
     }
     return itemObjs;
 }
 public static BOPushNotificationList GetAllList()
 {
     BOPushNotificationList itemObjs = null;
     tblPushNotification tblObj = new tblPushNotification();
     DataTable dt = tblObj.GetAllData();
     if (dt.Rows.Count > 0)
     {
         itemObjs = new BOPushNotificationList();
         foreach(DataRow dr in dt.Rows)
         {
             itemObjs.Add(FillDataRecord(dr));
         }
     }
     return itemObjs;
 }
      public static int Save(BOPushNotification entry, bool adding)
      {
          tblPushNotification tblObj = new tblPushNotification();
          DataRow newRow = tblObj.Table().NewRow();

              newRow[tblPushNotification.ID_FIELD] = entry.ID;
              newRow[tblPushNotification.TITLE_FIELD] = entry.Title;
              newRow[tblPushNotification.DESCRIPTION_FIELD] = entry.Description;
              if(entry.CretaedOn.Equals(new DateTime()))
                  newRow[tblPushNotification.CRETAEDON_FIELD] = DBNull.Value;
              else
                  newRow[tblPushNotification.CRETAEDON_FIELD] = entry.CretaedOn;
              newRow[tblPushNotification.CREATEDBYID_FIELD] = entry.CreatedByID;
              newRow[tblPushNotification.ISSENT_FIELD] = entry.IsSent;

          if(adding)
              return tblObj.AddToTable(newRow);
          else
              return tblObj.UpdateTable(newRow);
      }
 public static int GetCount(string whereClause)
 {
     tblPushNotification tblObj = new tblPushNotification();
     int count = tblObj.GetCount(whereClause);
     return count;
 }
 public static int GetCount()
 {
     tblPushNotification tblObj = new tblPushNotification();
     int count = tblObj.GetCount();
     return count;
 }
      public static int Save(BOPushNotificationList entryList, bool adding)
      {
          tblPushNotification tblObj = new tblPushNotification();
          DataTable dt = tblObj.Table();
          int i = 0;

          foreach(BOPushNotification entry in entryList)
          {
              DataRow newRow = tblObj.Table().NewRow();

                  newRow[tblPushNotification.ID_FIELD] = entry.ID;
                  newRow[tblPushNotification.TITLE_FIELD] = entry.Title;
                  newRow[tblPushNotification.DESCRIPTION_FIELD] = entry.Description;
          if(entry.CretaedOn.Equals(new DateTime()))
              newRow[tblPushNotification.CRETAEDON_FIELD] = DBNull.Value;
          else
              newRow[tblPushNotification.CRETAEDON_FIELD] = entry.CretaedOn;
                  newRow[tblPushNotification.CREATEDBYID_FIELD] = entry.CreatedByID;
                  newRow[tblPushNotification.ISSENT_FIELD] = entry.IsSent;

              dt.Rows.Add(newRow);
              i++;
          }

          //if(adding): Commented out at the moment. KS 28th Aug 2012
              return tblObj.AddToTable(dt);
          //else
              //return tblObj.UpdateTable(dt);
      }