public static Iceavresults BuildIceavresultsFromRow(DataRow row) { Iceavresults entity = new Iceavresults(); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.origprod = row.IsNull("origprod") ? string.Empty : row.Field <string>("origprod"); entity.coreprod = row.IsNull("coreprod") ? string.Empty : row.Field <string>("coreprod"); entity.qtyimply = row.IsNull("qtyimply") ? decimal.Zero : row.Field <decimal>("qtyimply"); entity.qtyoh = row.IsNull("qtyoh") ? decimal.Zero : row.Field <decimal>("qtyoh"); entity.qtywarr = row.IsNull("qtywarr") ? decimal.Zero : row.Field <decimal>("qtywarr"); entity.manadjfl = row.Field <bool>("manadjfl"); entity.manoper = row.IsNull("manoper") ? string.Empty : row.Field <string>("manoper"); entity.mandt = row.Field <DateTime?>("mandt"); entity.mantm = row.IsNull("mantm") ? string.Empty : row.Field <string>("mantm"); entity.orignotesfl = row.IsNull("orignotesfl") ? string.Empty : row.Field <string>("orignotesfl"); entity.origprodrowid = row.Field <byte[]>("origprodrowid").ToStringEncoded(); entity.corenotesfl = row.IsNull("corenotesfl") ? string.Empty : row.Field <string>("corenotesfl"); entity.coreprodrowid = row.Field <byte[]>("coreprodrowid").ToStringEncoded(); entity.vendnotesfl = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl"); entity.vendnorowid = row.Field <byte[]>("vendnorowid").ToStringEncoded(); entity.iceavRowid = row.Field <byte[]>("iceav-rowid").ToStringEncoded(); 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 UpdateRowFromIceavresults(ref DataRow row, Iceavresults entity) { row.SetField("vendno", entity.vendno); row.SetField("whse", entity.whse); row.SetField("origprod", entity.origprod); row.SetField("coreprod", entity.coreprod); row.SetField("qtyimply", entity.qtyimply); row.SetField("qtyoh", entity.qtyoh); row.SetField("qtywarr", entity.qtywarr); row.SetField("manadjfl", entity.manadjfl); row.SetField("manoper", entity.manoper); row.SetField("mandt", entity.mandt); row.SetField("mantm", entity.mantm); row.SetField("orignotesfl", entity.orignotesfl); row.SetField("origprodrowid", entity.origprodrowid.ToByteArray()); row.SetField("corenotesfl", entity.corenotesfl); row.SetField("coreprodrowid", entity.coreprodrowid.ToByteArray()); row.SetField("vendnotesfl", entity.vendnotesfl); row.SetField("vendnorowid", entity.vendnorowid.ToByteArray()); row.SetField("iceav-rowid", entity.iceavRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }