/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsprccriteria(ref DataRow row, Icsprccriteria entity) { row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("restrictcd", entity.restrictcd); row.SetField("certcode", entity.certcode); row.SetField("begstartdt", entity.begstartdt); row.SetField("endstartdt", entity.endstartdt); row.SetField("begexpiredt", entity.begexpiredt); row.SetField("endexpiredt", entity.endexpiredt); row.SetField("statuscd", entity.statuscd); row.SetField("recordlimit", entity.recordlimit); row.SetField("userfield", entity.userfield); }
public static Icsprccriteria BuildIcsprccriteriaFromRow(DataRow row) { Icsprccriteria entity = new Icsprccriteria(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.restrictcd = row.IsNull("restrictcd") ? string.Empty : row.Field <string>("restrictcd"); entity.certcode = row.IsNull("certcode") ? string.Empty : row.Field <string>("certcode"); entity.begstartdt = row.Field <DateTime?>("begstartdt"); entity.endstartdt = row.Field <DateTime?>("endstartdt"); entity.begexpiredt = row.Field <DateTime?>("begexpiredt"); entity.endexpiredt = row.Field <DateTime?>("endexpiredt"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.recordlimit = row.IsNull("recordlimit") ? 0 : row.Field <int>("recordlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }