/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromProspectcopy(ref DataRow row, Prospectcopy entity) { row.SetField("fromprosno", entity.fromprosno); row.SetField("toprosno", entity.toprosno); row.SetField("name", entity.name); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Prospectcopy BuildProspectcopyFromRow(DataRow row) { Prospectcopy entity = new Prospectcopy(); entity.fromprosno = row.IsNull("fromprosno") ? decimal.Zero : row.Field <decimal>("fromprosno"); entity.toprosno = row.IsNull("toprosno") ? decimal.Zero : row.Field <decimal>("toprosno"); 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); }