/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCrectransar(ref DataRow row, Crectransar entity) { row.SetField("custno", entity.custno); row.SetField("cCustNotes", entity.cCustNotes); row.SetField("cInvNo", entity.cInvNo); row.SetField("cSeqNo", entity.cSeqNo); row.SetField("notesfl", entity.notesfl); row.SetField("cDisputeFl", entity.cDisputeFl); row.SetField("cStatus", entity.cStatus); row.SetField("checkno", entity.checkno); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("dtInvDt", entity.dtInvDt); row.SetField("cTransCd", entity.cTransCd); row.SetField("cRefCd", entity.cRefCd); row.SetField("cRef", entity.cRef); row.SetField("dAmount", entity.dAmount); row.SetField("dAmtDue", entity.dAmtDue); row.SetField("aretrowid", entity.aretrowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Crectransar BuildCrectransarFromRow(DataRow row) { Crectransar entity = new Crectransar(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.cCustNotes = row.IsNull("cCustNotes") ? string.Empty : row.Field <string>("cCustNotes"); entity.cInvNo = row.IsNull("cInvNo") ? string.Empty : row.Field <string>("cInvNo"); entity.cSeqNo = row.IsNull("cSeqNo") ? string.Empty : row.Field <string>("cSeqNo"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.cDisputeFl = row.IsNull("cDisputeFl") ? string.Empty : row.Field <string>("cDisputeFl"); entity.cStatus = row.IsNull("cStatus") ? string.Empty : row.Field <string>("cStatus"); entity.checkno = row.IsNull("checkno") ? decimal.Zero : row.Field <decimal>("checkno"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.dtInvDt = row.Field <DateTime?>("dtInvDt"); entity.cTransCd = row.IsNull("cTransCd") ? string.Empty : row.Field <string>("cTransCd"); entity.cRefCd = row.IsNull("cRefCd") ? string.Empty : row.Field <string>("cRefCd"); entity.cRef = row.IsNull("cRef") ? string.Empty : row.Field <string>("cRef"); entity.dAmount = row.IsNull("dAmount") ? decimal.Zero : row.Field <decimal>("dAmount"); entity.dAmtDue = row.IsNull("dAmtDue") ? decimal.Zero : row.Field <decimal>("dAmtDue"); entity.aretrowid = row.Field <byte[]>("aretrowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }