/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApeiinvdetpolnaddonslct(ref DataRow row, Apeiinvdetpolnaddonslct entity) { row.SetField("selectfl", entity.selectfl); row.SetField("pono", entity.pono); row.SetField("posuf", entity.posuf); row.SetField("lineno", entity.lineno); row.SetField("shipprod", entity.shipprod); row.SetField("proddesc", entity.proddesc); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("price", entity.price); row.SetField("netamt", entity.netamt); row.SetField("qtyrcv", entity.qtyrcv); row.SetField("rcvcost", entity.rcvcost); row.SetField("buyer", entity.buyer); row.SetField("whse", entity.whse); row.SetField("vendno", entity.vendno); row.SetField("poel-rowid", entity.poelRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Apeiinvdetpolnaddonslct BuildApeiinvdetpolnaddonslctFromRow(DataRow row) { Apeiinvdetpolnaddonslct entity = new Apeiinvdetpolnaddonslct(); entity.selectfl = row.Field <bool>("selectfl"); entity.pono = row.IsNull("pono") ? 0 : row.Field <int>("pono"); entity.posuf = row.IsNull("posuf") ? 0 : row.Field <int>("posuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.netamt = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt"); entity.qtyrcv = row.IsNull("qtyrcv") ? decimal.Zero : row.Field <decimal>("qtyrcv"); entity.rcvcost = row.IsNull("rcvcost") ? decimal.Zero : row.Field <decimal>("rcvcost"); entity.buyer = row.IsNull("buyer") ? string.Empty : row.Field <string>("buyer"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.poelRowid = row.Field <byte[]>("poel-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }