/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSasgesearchresults(ref DataRow row, Sasgesearchresults entity) { row.SetField("custno", entity.custno); row.SetField("notesfl", entity.notesfl); row.SetField("name", entity.name); row.SetField("shipto", entity.shipto); row.SetField("state", entity.state); row.SetField("taxtype", entity.taxtype); row.SetField("comment", entity.comment); row.SetField("certno", entity.certno); row.SetField("taxdt", entity.taxdt); row.SetField("sasgerowid", entity.sasgerowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Sasgesearchresults BuildSasgesearchresultsFromRow(DataRow row) { Sasgesearchresults entity = new Sasgesearchresults(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.state = row.IsNull("state") ? string.Empty : row.Field <string>("state"); entity.taxtype = row.IsNull("taxtype") ? string.Empty : row.Field <string>("taxtype"); entity.comment = row.IsNull("comment") ? string.Empty : row.Field <string>("comment"); entity.certno = row.IsNull("certno") ? string.Empty : row.Field <string>("certno"); entity.taxdt = row.Field <DateTime?>("taxdt"); entity.sasgerowid = row.Field <byte[]>("sasgerowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }