/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArececoddata(ref DataRow row, Arececoddata entity) { row.SetField("cono", entity.cono); row.SetField("oper", entity.oper); row.SetField("invno", entity.invno); row.SetField("invsuf", entity.invsuf); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("invdt", entity.invdt); row.SetField("amount", entity.amount); row.SetField("applyamt", entity.applyamt); row.SetField("origapplyamt", entity.origapplyamt); row.SetField("dispcd", entity.dispcd); row.SetField("dispcddesc", entity.dispcddesc); row.SetField("seqno", entity.seqno); row.SetField("recno", entity.recno); row.SetField("aret-rowid", entity.aretRowid.ToByteArray()); row.SetField("launchinvlookup", entity.launchinvlookup); row.SetField("exchrate", entity.exchrate); row.SetField("exchrateasked", entity.exchrateasked); row.SetField("launchexchrate", entity.launchexchrate); row.SetField("piffl", entity.piffl); row.SetField("disputefl", entity.disputefl); row.SetField("discdt", entity.discdt); row.SetField("userfield", entity.userfield); }
public static Arececoddata BuildArececoddataFromRow(DataRow row) { Arececoddata entity = new Arececoddata(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.oper = row.IsNull("oper") ? string.Empty : row.Field <string>("oper"); entity.invno = row.IsNull("invno") ? 0 : row.Field <int>("invno"); entity.invsuf = row.IsNull("invsuf") ? 0 : row.Field <int>("invsuf"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.invdt = row.Field <DateTime?>("invdt"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.applyamt = row.IsNull("applyamt") ? decimal.Zero : row.Field <decimal>("applyamt"); entity.origapplyamt = row.IsNull("origapplyamt") ? decimal.Zero : row.Field <decimal>("origapplyamt"); entity.dispcd = row.IsNull("dispcd") ? string.Empty : row.Field <string>("dispcd"); entity.dispcddesc = row.IsNull("dispcddesc") ? string.Empty : row.Field <string>("dispcddesc"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.recno = row.IsNull("recno") ? 0 : row.Field <long>("recno"); entity.aretRowid = row.Field <byte[]>("aret-rowid").ToStringEncoded(); entity.launchinvlookup = row.Field <bool>("launchinvlookup"); entity.exchrate = row.IsNull("exchrate") ? decimal.Zero : row.Field <decimal>("exchrate"); entity.exchrateasked = row.Field <bool>("exchrateasked"); entity.launchexchrate = row.Field <bool>("launchexchrate"); entity.piffl = row.Field <bool>("piffl"); entity.disputefl = row.Field <bool>("disputefl"); entity.discdt = row.Field <DateTime?>("discdt"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }