/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOtivvesselresults(ref DataRow row, Otivvesselresults entity) { row.SetField("vesselno", entity.vesselno); row.SetField("vessnm", entity.vessnm); row.SetField("voyageno", entity.voyageno); row.SetField("stagecd", entity.stagecd); row.SetField("departuredt", entity.departuredt); row.SetField("arrivaldt", entity.arrivaldt); row.SetField("unloaddt", entity.unloaddt); row.SetField("trackno", entity.trackno); row.SetField("notesfl", entity.notesfl); row.SetField("vendno", entity.vendno); row.SetField("vendnotes", entity.vendnotes); row.SetField("whse", entity.whse); row.SetField("contno", entity.contno); row.SetField("rowid-otevh", entity.rowidOtevh.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Otivvesselresults BuildOtivvesselresultsFromRow(DataRow row) { Otivvesselresults entity = new Otivvesselresults(); entity.vesselno = row.IsNull("vesselno") ? 0 : row.Field <int>("vesselno"); entity.vessnm = row.IsNull("vessnm") ? string.Empty : row.Field <string>("vessnm"); entity.voyageno = row.IsNull("voyageno") ? string.Empty : row.Field <string>("voyageno"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.departuredt = row.Field <DateTime?>("departuredt"); entity.arrivaldt = row.Field <DateTime?>("arrivaldt"); entity.unloaddt = row.Field <DateTime?>("unloaddt"); entity.trackno = row.IsNull("trackno") ? 0 : row.Field <int>("trackno"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendnotes = row.IsNull("vendnotes") ? string.Empty : row.Field <string>("vendnotes"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.contno = row.IsNull("contno") ? string.Empty : row.Field <string>("contno"); entity.rowidOtevh = row.Field <byte[]>("rowid-otevh").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }