public static int Save(BOMailSummaryList entryList, bool adding)
        {
            tblMailSummary tblObj = new tblMailSummary();
            DataTable      dt     = tblObj.Table();
            int            i      = 0;

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

                newRow[tblMailSummary.TOEMPLOYEEID_FIELD]   = entry.ToEmployeeID;
                newRow[tblMailSummary.CCEMPLOYEEID_FIELD]   = entry.CCEmployeeID;
                newRow[tblMailSummary.FROMEMPLOYEEID_FIELD] = entry.FromEmployeeID;
                newRow[tblMailSummary.MESSAGEBODY_FIELD]    = entry.MessageBody;
                newRow[tblMailSummary.MAILSUBJECT_FIELD]    = entry.MailSubject;
                if (entry.CreatedOn.Equals(new DateTime()))
                {
                    newRow[tblMailSummary.CREATEDON_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblMailSummary.CREATEDON_FIELD] = entry.CreatedOn;
                }
                newRow[tblMailSummary.CREATEDBYID_FIELD] = entry.CreatedByID;
                if (entry.ModifiedOn.Equals(new DateTime()))
                {
                    newRow[tblMailSummary.MODIFIEDON_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblMailSummary.MODIFIEDON_FIELD] = entry.ModifiedOn;
                }
                newRow[tblMailSummary.MODIFIEDBYID_FIELD] = entry.ModifiedByID;

                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);
        }
        public static int Save(BOMailSummary entry, bool adding)
        {
            tblMailSummary tblObj = new tblMailSummary();
            DataRow        newRow = tblObj.Table().NewRow();

            newRow[tblMailSummary.MAILID_FIELD]         = entry.MailID;
            newRow[tblMailSummary.TOEMPLOYEEID_FIELD]   = entry.ToEmployeeID;
            newRow[tblMailSummary.CCEMPLOYEEID_FIELD]   = entry.CCEmployeeID;
            newRow[tblMailSummary.FROMEMPLOYEEID_FIELD] = entry.FromEmployeeID;
            newRow[tblMailSummary.MESSAGEBODY_FIELD]    = entry.MessageBody;
            newRow[tblMailSummary.MAILSUBJECT_FIELD]    = entry.MailSubject;
            if (entry.CreatedOn.Equals(new DateTime()))
            {
                newRow[tblMailSummary.CREATEDON_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblMailSummary.CREATEDON_FIELD] = entry.CreatedOn;
            }
            newRow[tblMailSummary.CREATEDBYID_FIELD] = entry.CreatedByID;
            if (entry.ModifiedOn.Equals(new DateTime()))
            {
                newRow[tblMailSummary.MODIFIEDON_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblMailSummary.MODIFIEDON_FIELD] = entry.ModifiedOn;
            }
            newRow[tblMailSummary.MODIFIEDBYID_FIELD] = entry.ModifiedByID;

            if (adding)
            {
                return(tblObj.AddToTable(newRow));
            }
            else
            {
                return(tblObj.UpdateTable(newRow));
            }
        }
        public static int Save(BOMailSummaryList entryList, bool adding)
        {
            tblMailSummary tblObj = new tblMailSummary();
              DataTable dt = tblObj.Table();
              int i = 0;

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

              newRow[tblMailSummary.TOEMPLOYEEID_FIELD] = entry.ToEmployeeID;
              newRow[tblMailSummary.CCEMPLOYEEID_FIELD] = entry.CCEmployeeID;
              newRow[tblMailSummary.FROMEMPLOYEEID_FIELD] = entry.FromEmployeeID;
              newRow[tblMailSummary.MESSAGEBODY_FIELD] = entry.MessageBody;
              newRow[tblMailSummary.MAILSUBJECT_FIELD] = entry.MailSubject;
              if(entry.CreatedOn.Equals(new DateTime()))
              newRow[tblMailSummary.CREATEDON_FIELD] = DBNull.Value;
              else
              newRow[tblMailSummary.CREATEDON_FIELD] = entry.CreatedOn;
              newRow[tblMailSummary.CREATEDBYID_FIELD] = entry.CreatedByID;
              if(entry.ModifiedOn.Equals(new DateTime()))
              newRow[tblMailSummary.MODIFIEDON_FIELD] = DBNull.Value;
              else
              newRow[tblMailSummary.MODIFIEDON_FIELD] = entry.ModifiedOn;
              newRow[tblMailSummary.MODIFIEDBYID_FIELD] = entry.ModifiedByID;

              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);
        }
        public static int Save(BOMailSummary entry, bool adding)
        {
            tblMailSummary tblObj = new tblMailSummary();
              DataRow newRow = tblObj.Table().NewRow();

              newRow[tblMailSummary.MAILID_FIELD] = entry.MailID;
              newRow[tblMailSummary.TOEMPLOYEEID_FIELD] = entry.ToEmployeeID;
              newRow[tblMailSummary.CCEMPLOYEEID_FIELD] = entry.CCEmployeeID;
              newRow[tblMailSummary.FROMEMPLOYEEID_FIELD] = entry.FromEmployeeID;
              newRow[tblMailSummary.MESSAGEBODY_FIELD] = entry.MessageBody;
              newRow[tblMailSummary.MAILSUBJECT_FIELD] = entry.MailSubject;
              if(entry.CreatedOn.Equals(new DateTime()))
                  newRow[tblMailSummary.CREATEDON_FIELD] = DBNull.Value;
              else
                  newRow[tblMailSummary.CREATEDON_FIELD] = entry.CreatedOn;
              newRow[tblMailSummary.CREATEDBYID_FIELD] = entry.CreatedByID;
              if(entry.ModifiedOn.Equals(new DateTime()))
                  newRow[tblMailSummary.MODIFIEDON_FIELD] = DBNull.Value;
              else
                  newRow[tblMailSummary.MODIFIEDON_FIELD] = entry.ModifiedOn;
              newRow[tblMailSummary.MODIFIEDBYID_FIELD] = entry.ModifiedByID;

              if(adding)
              return tblObj.AddToTable(newRow);
              else
              return tblObj.UpdateTable(newRow);
        }