public static Etccdetdata855iline BuildEtccdetdata855ilineFromRow(DataRow row) { Etccdetdata855iline entity = new Etccdetdata855iline(); entity.sxxmldocRowid = row.Field <byte[]>("sxxmldoc-rowid").ToStringEncoded(); entity.section = row.IsNull("section") ? string.Empty : row.Field <string>("section"); entity.approvty = row.IsNull("approvty") ? string.Empty : row.Field <string>("approvty"); entity.datasource = row.IsNull("datasource") ? string.Empty : row.Field <string>("datasource"); entity.sectionD = row.IsNull("section-d") ? string.Empty : row.Field <string>("section-d"); entity.secseq = row.IsNull("secseq") ? 0 : row.Field <int>("secseq"); entity.errcnt = row.IsNull("errcnt") ? 0 : row.Field <int>("errcnt"); entity.exccnt = row.IsNull("exccnt") ? 0 : row.Field <int>("exccnt"); entity.infocnt = row.IsNull("infocnt") ? 0 : row.Field <int>("infocnt"); entity.stageword = row.IsNull("stageword") ? string.Empty : row.Field <string>("stageword"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.processedfl = row.Field <bool>("processedfl"); entity.ackdt = row.Field <DateTime?>("ackdt"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.commtype = row.IsNull("commtype") ? string.Empty : row.Field <string>("commtype"); entity.duedt = row.Field <DateTime?>("duedt"); entity.vendlineno = row.IsNull("vendlineno") ? 0 : row.Field <int>("vendlineno"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.vendprod = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.barcode = row.IsNull("barcode") ? string.Empty : row.Field <string>("barcode"); entity.subfl = row.Field <bool>("subfl"); entity.superfl = row.Field <bool>("superfl"); entity.qty = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.priceunit = row.IsNull("priceunit") ? string.Empty : row.Field <string>("priceunit"); entity.transetcd = row.IsNull("transetcd") ? string.Empty : row.Field <string>("transetcd"); entity.expshipdt = row.Field <DateTime?>("expshipdt"); entity.dlvrydatecd = row.IsNull("dlvrydatecd") ? string.Empty : row.Field <string>("dlvrydatecd"); entity.createdt = row.Field <DateTime?>("createdt"); entity.createtm = row.IsNull("createtm") ? string.Empty : row.Field <string>("createtm"); entity.transdt = row.Field <DateTime?>("transdt"); entity.transtm = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm"); entity.transproc = row.IsNull("transproc") ? string.Empty : row.Field <string>("transproc"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.docid = row.IsNull("docid") ? 0 : row.Field <int>("docid"); entity.origdata = row.IsNull("origdata") ? string.Empty : row.Field <string>("origdata"); entity.ovrddata = row.IsNull("ovrddata") ? string.Empty : row.Field <string>("ovrddata"); entity.transdata = row.IsNull("transdata") ? string.Empty : row.Field <string>("transdata"); entity.sortseq = row.IsNull("sortseq") ? 0 : row.Field <int>("sortseq"); entity.docidD = row.IsNull("docid-d") ? string.Empty : row.Field <string>("docid-d"); 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 UpdateRowFromEtccdetdata855iline(ref DataRow row, Etccdetdata855iline entity) { row.SetField("sxxmldoc-rowid", entity.sxxmldocRowid.ToByteArray()); row.SetField("section", entity.section); row.SetField("approvty", entity.approvty); row.SetField("datasource", entity.datasource); row.SetField("section-d", entity.sectionD); row.SetField("secseq", entity.secseq); row.SetField("errcnt", entity.errcnt); row.SetField("exccnt", entity.exccnt); row.SetField("infocnt", entity.infocnt); row.SetField("stageword", entity.stageword); row.SetField("stagecd", entity.stagecd); row.SetField("processedfl", entity.processedfl); row.SetField("ackdt", entity.ackdt); row.SetField("statuscd", entity.statuscd); row.SetField("commtype", entity.commtype); row.SetField("duedt", entity.duedt); row.SetField("vendlineno", entity.vendlineno); row.SetField("lineno", entity.lineno); row.SetField("vendprod", entity.vendprod); row.SetField("shipprod", entity.shipprod); row.SetField("barcode", entity.barcode); row.SetField("subfl", entity.subfl); row.SetField("superfl", entity.superfl); row.SetField("qty", entity.qty); row.SetField("unit", entity.unit); row.SetField("price", entity.price); row.SetField("priceunit", entity.priceunit); row.SetField("transetcd", entity.transetcd); row.SetField("expshipdt", entity.expshipdt); row.SetField("dlvrydatecd", entity.dlvrydatecd); row.SetField("createdt", entity.createdt); row.SetField("createtm", entity.createtm); row.SetField("transdt", entity.transdt); row.SetField("transtm", entity.transtm); row.SetField("transproc", entity.transproc); row.SetField("operinit", entity.operinit); row.SetField("docid", entity.docid); row.SetField("origdata", entity.origdata); row.SetField("ovrddata", entity.ovrddata); row.SetField("transdata", entity.transdata); row.SetField("sortseq", entity.sortseq); row.SetField("docid-d", entity.docidD); row.SetField("userfield", entity.userfield); }