/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCompanycopy(ref DataRow row, Companycopy entity) { row.SetField("newcono", entity.newcono); row.SetField("newname", entity.newname); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Companycopy BuildCompanycopyFromRow(DataRow row) { Companycopy entity = new Companycopy(); entity.newcono = row.IsNull("newcono") ? 0 : row.Field <int>("newcono"); entity.newname = row.IsNull("newname") ? string.Empty : row.Field <string>("newname"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }