public static Poblanketupdbyrelupdresults BuildPoblanketupdbyrelupdresultsFromRow(DataRow row) { Poblanketupdbyrelupdresults entity = new Poblanketupdbyrelupdresults(); entity.pono = row.IsNull("pono") ? 0 : row.Field <int>("pono"); entity.posuf = row.IsNull("posuf") ? 0 : row.Field <int>("posuf"); entity.ponox = row.IsNull("ponox") ? string.Empty : row.Field <string>("ponox"); entity.ponotesfl = row.IsNull("ponotesfl") ? string.Empty : row.Field <string>("ponotesfl"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.stagecdx = row.IsNull("stagecdx") ? string.Empty : row.Field <string>("stagecdx"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendnotesfl = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl"); entity.shipfmno = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno"); entity.billtowhse = row.IsNull("billtowhse") ? string.Empty : row.Field <string>("billtowhse"); entity.shiptowhse = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse"); entity.orderdt = row.Field <DateTime?>("orderdt"); entity.shiptonm = row.IsNull("shiptonm") ? string.Empty : row.Field <string>("shiptonm"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.qtyordOrig = row.IsNull("qtyord-orig") ? decimal.Zero : row.Field <decimal>("qtyord-orig"); entity.commentfl = row.Field <bool>("commentfl"); entity.poelrecid = row.IsNull("poelrecid") ? 0 : row.Field <long>("poelrecid"); entity.poehrowid = row.Field <byte[]>("poehrowid").ToStringEncoded(); entity.apsvrowid = row.Field <byte[]>("apsvrowid").ToStringEncoded(); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPoblanketupdbyrelupdresults(ref DataRow row, Poblanketupdbyrelupdresults entity) { row.SetField("pono", entity.pono); row.SetField("posuf", entity.posuf); row.SetField("ponox", entity.ponox); row.SetField("ponotesfl", entity.ponotesfl); row.SetField("stagecd", entity.stagecd); row.SetField("stagecdx", entity.stagecdx); row.SetField("transtype", entity.transtype); row.SetField("vendno", entity.vendno); row.SetField("vendnotesfl", entity.vendnotesfl); row.SetField("shipfmno", entity.shipfmno); row.SetField("billtowhse", entity.billtowhse); row.SetField("shiptowhse", entity.shiptowhse); row.SetField("orderdt", entity.orderdt); row.SetField("shiptonm", entity.shiptonm); row.SetField("qtyord", entity.qtyord); row.SetField("qtyord-orig", entity.qtyordOrig); row.SetField("commentfl", entity.commentfl); row.SetField("poelrecid", entity.poelrecid); row.SetField("poehrowid", entity.poehrowid.ToByteArray()); row.SetField("apsvrowid", entity.apsvrowid.ToByteArray()); }