private static BOMailSummary FillDataRecord(DataRow dr) { BOMailSummary itemObj = new BOMailSummary(); if(dr["MailID"] != DBNull.Value) itemObj.MailID = Int32.Parse(dr["MailID"].ToString()); if(dr["ToEmployeeID"] != DBNull.Value) itemObj.ToEmployeeID = Int32.Parse(dr["ToEmployeeID"].ToString()); if(dr["CCEmployeeID"] != DBNull.Value) itemObj.CCEmployeeID = Int32.Parse(dr["CCEmployeeID"].ToString()); if(dr["FromEmployeeID"] != DBNull.Value) itemObj.FromEmployeeID = Int32.Parse(dr["FromEmployeeID"].ToString()); if(dr["MessageBody"] != DBNull.Value) itemObj.MessageBody = dr["MessageBody"].ToString(); if(dr["MailSubject"] != DBNull.Value) itemObj.MailSubject = dr["MailSubject"].ToString(); if(dr["CreatedOn"] != DBNull.Value) itemObj.CreatedOn = DateTime.Parse(dr["CreatedOn"].ToString()); if(dr["CreatedByID"] != DBNull.Value) itemObj.CreatedByID = Int32.Parse(dr["CreatedByID"].ToString()); if(dr["ModifiedOn"] != DBNull.Value) itemObj.ModifiedOn = DateTime.Parse(dr["ModifiedOn"].ToString()); if(dr["ModifiedByID"] != DBNull.Value) itemObj.ModifiedByID = Int32.Parse(dr["ModifiedByID"].ToString()); return itemObj; }
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(BOMailSummary entry) { return tblMailSummaryDBManager.Save(entry, true); }
public static int Update(BOMailSummary entry) { return tblMailSummaryDBManager.Save(entry, false); }
public static int Save(BOMailSummary entry, bool adding) { return tblMailSummaryDBManager.Save(entry, adding); }