/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArececodlookup(ref DataRow row, Arececodlookup entity) { row.SetField("custno", entity.custno); row.SetField("invdt", entity.invdt); row.SetField("amount", entity.amount); row.SetField("refer", entity.refer); row.SetField("userfield", entity.userfield); }
public static Arececodlookup BuildArececodlookupFromRow(DataRow row) { Arececodlookup entity = new Arececodlookup(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.invdt = row.Field <DateTime?>("invdt"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }