public static Otettrackdata BuildOtettrackdataFromRow(DataRow row) { Otettrackdata entity = new Otettrackdata(); 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.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.contno = row.IsNull("contno") ? string.Empty : row.Field <string>("contno"); entity.shipco = row.IsNull("shipco") ? string.Empty : row.Field <string>("shipco"); entity.prodstdt = row.Field <DateTime?>("prodstdt"); entity.prodcompdt = row.Field <DateTime?>("prodcompdt"); entity.deptdt = row.Field <DateTime?>("deptdt"); entity.dockarrdt = row.Field <DateTime?>("dockarrdt"); entity.dockreddt = row.Field <DateTime?>("dockreddt"); entity.dockdemurdt = row.Field <DateTime?>("dockdemurdt"); entity.atwhsedt = row.Field <DateTime?>("atwhsedt"); entity.lastfreedt = row.Field <DateTime?>("lastfreedt"); entity.whseunldt = row.Field <DateTime?>("whseunldt"); entity.empdt = row.Field <DateTime?>("empdt"); entity.retdt = row.Field <DateTime?>("retdt"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOtettrackdata(ref DataRow row, Otettrackdata entity) { row.SetField("trackno", entity.trackno); row.SetField("notesfl", entity.notesfl); row.SetField("vendno", entity.vendno); row.SetField("vendnotes", entity.vendnotes); row.SetField("stagecd", entity.stagecd); row.SetField("contno", entity.contno); row.SetField("shipco", entity.shipco); row.SetField("prodstdt", entity.prodstdt); row.SetField("prodcompdt", entity.prodcompdt); row.SetField("deptdt", entity.deptdt); row.SetField("dockarrdt", entity.dockarrdt); row.SetField("dockreddt", entity.dockreddt); row.SetField("dockdemurdt", entity.dockdemurdt); row.SetField("atwhsedt", entity.atwhsedt); row.SetField("lastfreedt", entity.lastfreedt); row.SetField("whseunldt", entity.whseunldt); row.SetField("empdt", entity.empdt); row.SetField("retdt", entity.retdt); row.SetField("whse", entity.whse); row.SetField("userfield", entity.userfield); }