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 Update(BOPushNotification entry) { return tblPushNotificationDBManager.Save(entry, false); }
public static int Save(BOPushNotification entry) { return tblPushNotificationDBManager.Save(entry, true); }
public static int Save(BOPushNotification entry, bool adding) { return tblPushNotificationDBManager.Save(entry, adding); }
private static BOPushNotification FillDataRecord(DataRow dr) { BOPushNotification itemObj = new BOPushNotification(); if(dr["ID"] != DBNull.Value) itemObj.ID = Int32.Parse(dr["ID"].ToString()); if(dr["Title"] != DBNull.Value) itemObj.Title = dr["Title"].ToString(); if(dr["Description"] != DBNull.Value) itemObj.Description = dr["Description"].ToString(); if(dr["CretaedOn"] != DBNull.Value) itemObj.CretaedOn = DateTime.Parse(dr["CretaedOn"].ToString()); if(dr["CreatedByID"] != DBNull.Value) itemObj.CreatedByID = Int32.Parse(dr["CreatedByID"].ToString()); if(dr["IsSent"] != DBNull.Value) itemObj.IsSent = Boolean.Parse(dr["IsSent"].ToString()); return itemObj; }