/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApvendorcopy(ref DataRow row, Apvendorcopy entity) { row.SetField("fromvendno", entity.fromvendno); row.SetField("tovendno", entity.tovendno); row.SetField("name", entity.name); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Apvendorcopy BuildApvendorcopyFromRow(DataRow row) { Apvendorcopy entity = new Apvendorcopy(); entity.fromvendno = row.IsNull("fromvendno") ? decimal.Zero : row.Field <decimal>("fromvendno"); entity.tovendno = row.IsNull("tovendno") ? decimal.Zero : row.Field <decimal>("tovendno"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }