/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOtivvesselcriteria(ref DataRow row, Otivvesselcriteria entity) { row.SetField("vesselno", entity.vesselno); row.SetField("trackno", entity.trackno); row.SetField("whse", entity.whse); row.SetField("shipid", entity.shipid); row.SetField("shipco", entity.shipco); row.SetField("vessnm", entity.vessnm); row.SetField("voyageno", entity.voyageno); row.SetField("contno", entity.contno); row.SetField("stagecd", entity.stagecd); row.SetField("deptdtfr", entity.deptdtfr); row.SetField("deptdtto", entity.deptdtto); row.SetField("arrdtfr", entity.arrdtfr); row.SetField("arrdtto", entity.arrdtto); row.SetField("unlddtfr", entity.unlddtfr); row.SetField("unlddtto", entity.unlddtto); row.SetField("userfield", entity.userfield); }
public static Otivvesselcriteria BuildOtivvesselcriteriaFromRow(DataRow row) { Otivvesselcriteria entity = new Otivvesselcriteria(); entity.vesselno = row.IsNull("vesselno") ? 0 : row.Field <int>("vesselno"); entity.trackno = row.IsNull("trackno") ? 0 : row.Field <int>("trackno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.shipid = row.IsNull("shipid") ? string.Empty : row.Field <string>("shipid"); entity.shipco = row.IsNull("shipco") ? string.Empty : row.Field <string>("shipco"); entity.vessnm = row.IsNull("vessnm") ? string.Empty : row.Field <string>("vessnm"); entity.voyageno = row.IsNull("voyageno") ? string.Empty : row.Field <string>("voyageno"); entity.contno = row.IsNull("contno") ? string.Empty : row.Field <string>("contno"); entity.stagecd = row.IsNull("stagecd") ? string.Empty : row.Field <string>("stagecd"); entity.deptdtfr = row.Field <DateTime?>("deptdtfr"); entity.deptdtto = row.Field <DateTime?>("deptdtto"); entity.arrdtfr = row.Field <DateTime?>("arrdtfr"); entity.arrdtto = row.Field <DateTime?>("arrdtto"); entity.unlddtfr = row.Field <DateTime?>("unlddtfr"); entity.unlddtto = row.Field <DateTime?>("unlddtto"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }