Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOtevvesseldata(ref DataRow row, Otevvesseldata 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("rowid-otevh", entity.rowidOtevh.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Example #2
0
        public static Otevvesseldata BuildOtevvesseldataFromRow(DataRow row)
        {
            Otevvesseldata entity = new Otevvesseldata();

            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.rowidOtevh  = row.Field <byte[]>("rowid-otevh").ToStringEncoded();
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }