/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromStationresults(ref DataRow row, Stationresults entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("stn_num", entity.stnNum); row.SetField("stn_type", entity.stnType); row.SetField("row_status", entity.rowStatus); row.SetField("stntblRowid", entity.stntblRowid.ToByteArray()); row.SetField("stationresultsuserfield", entity.stationresultsuserfield); row.SetField("userfield", entity.userfield); }
public static Stationresults BuildStationresultsFromRow(DataRow row) { Stationresults entity = new Stationresults(); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.stnNum = row.IsNull("stn_num") ? string.Empty : row.Field <string>("stn_num"); entity.stnType = row.IsNull("stn_type") ? string.Empty : row.Field <string>("stn_type"); entity.rowStatus = row.Field <bool>("row_status"); entity.stntblRowid = row.Field <byte[]>("stntblRowid").ToStringEncoded(); entity.stationresultsuserfield = row.IsNull("stationresultsuserfield") ? string.Empty : row.Field <string>("stationresultsuserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }