public static Sapjjobresults BuildSapjjobresultsFromRow(DataRow row) { Sapjjobresults entity = new Sapjjobresults(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.reportnm = row.IsNull("reportnm") ? string.Empty : row.Field <string>("reportnm"); entity.inusecd = row.IsNull("inusecd") ? string.Empty : row.Field <string>("inusecd"); entity.delfl = row.Field <bool>("delfl"); entity.currproc = row.IsNull("currproc") ? string.Empty : row.Field <string>("currproc"); entity.rpttitle = row.IsNull("rpttitle") ? string.Empty : row.Field <string>("rpttitle"); entity.demandfl = row.Field <bool>("demandfl"); entity.batchnm = row.IsNull("batchnm") ? string.Empty : row.Field <string>("batchnm"); entity.priority = row.IsNull("priority") ? 0 : row.Field <int>("priority"); entity.printernm = row.IsNull("printernm") ? string.Empty : row.Field <string>("printernm"); entity.startdt = row.Field <DateTime?>("startdt"); entity.starttm = row.IsNull("starttm") ? 0 : row.Field <int>("starttm"); entity.starttmdisp = row.IsNull("starttmdisp") ? string.Empty : row.Field <string>("starttmdisp"); entity.starttype = row.IsNull("starttype") ? string.Empty : row.Field <string>("starttype"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.sapbrowid = row.Field <byte[]>("sapbrowid").ToStringEncoded(); entity.startdtclient = row.Field <DateTime?>("startdtclient"); entity.starttmclient = row.IsNull("starttmclient") ? 0 : row.Field <int>("starttmclient"); entity.cstarttmclient = row.IsNull("cstarttmclient") ? string.Empty : row.Field <string>("cstarttmclient"); 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 UpdateRowFromSapjjobresults(ref DataRow row, Sapjjobresults entity) { row.SetField("cono", entity.cono); row.SetField("reportnm", entity.reportnm); row.SetField("inusecd", entity.inusecd); row.SetField("delfl", entity.delfl); row.SetField("currproc", entity.currproc); row.SetField("rpttitle", entity.rpttitle); row.SetField("demandfl", entity.demandfl); row.SetField("batchnm", entity.batchnm); row.SetField("priority", entity.priority); row.SetField("printernm", entity.printernm); row.SetField("startdt", entity.startdt); row.SetField("starttm", entity.starttm); row.SetField("starttmdisp", entity.starttmdisp); row.SetField("starttype", entity.starttype); row.SetField("operinit", entity.operinit); row.SetField("sapbrowid", entity.sapbrowid.ToByteArray()); row.SetField("startdtclient", entity.startdtclient); row.SetField("starttmclient", entity.starttmclient); row.SetField("cstarttmclient", entity.cstarttmclient); row.SetField("userfield", entity.userfield); }