/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWmtransaction(ref DataRow row, Wmtransaction entity) { row.SetField("whse", entity.whse); row.SetField("binloc", entity.binloc); row.SetField("adjtype", entity.adjtype); row.SetField("prodenabled", entity.prodenabled); row.SetField("useprodlist", entity.useprodlist); row.SetField("prod", entity.prod); row.SetField("tobinlocenabled", entity.tobinlocenabled); row.SetField("tobinloc", entity.tobinloc); row.SetField("quantityenabled", entity.quantityenabled); row.SetField("quantity", entity.quantity); row.SetField("qtyavail", entity.qtyavail); row.SetField("qtyonhand", entity.qtyonhand); row.SetField("qtycommitted", entity.qtycommitted); row.SetField("qtyreceived", entity.qtyreceived); row.SetField("recidwmsbp", entity.recidwmsbp); row.SetField("reciddestinationwmsbp", entity.reciddestinationwmsbp); row.SetField("icspnotesfl", entity.icspnotesfl); row.SetField("icsplookupnm", entity.icsplookupnm); row.SetField("icspunitstock", entity.icspunitstock); row.SetField("msdsfl", entity.msdsfl); row.SetField("spaceavail", entity.spaceavail); row.SetField("displayspaceavail", entity.displayspaceavail); row.SetField("userfield", entity.userfield); }
public static Wmtransaction BuildWmtransactionFromRow(DataRow row) { Wmtransaction entity = new Wmtransaction(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.binloc = row.IsNull("binloc") ? string.Empty : row.Field <string>("binloc"); entity.adjtype = row.IsNull("adjtype") ? string.Empty : row.Field <string>("adjtype"); entity.prodenabled = row.Field <bool>("prodenabled"); entity.useprodlist = row.Field <bool>("useprodlist"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.tobinlocenabled = row.Field <bool>("tobinlocenabled"); entity.tobinloc = row.IsNull("tobinloc") ? string.Empty : row.Field <string>("tobinloc"); entity.quantityenabled = row.Field <bool>("quantityenabled"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.qtyavail = row.IsNull("qtyavail") ? decimal.Zero : row.Field <decimal>("qtyavail"); entity.qtyonhand = row.IsNull("qtyonhand") ? decimal.Zero : row.Field <decimal>("qtyonhand"); entity.qtycommitted = row.IsNull("qtycommitted") ? decimal.Zero : row.Field <decimal>("qtycommitted"); entity.qtyreceived = row.IsNull("qtyreceived") ? decimal.Zero : row.Field <decimal>("qtyreceived"); entity.recidwmsbp = row.IsNull("recidwmsbp") ? 0 : row.Field <long>("recidwmsbp"); entity.reciddestinationwmsbp = row.IsNull("reciddestinationwmsbp") ? 0 : row.Field <long>("reciddestinationwmsbp"); entity.icspnotesfl = row.IsNull("icspnotesfl") ? string.Empty : row.Field <string>("icspnotesfl"); entity.icsplookupnm = row.IsNull("icsplookupnm") ? string.Empty : row.Field <string>("icsplookupnm"); entity.icspunitstock = row.IsNull("icspunitstock") ? string.Empty : row.Field <string>("icspunitstock"); entity.msdsfl = row.Field <bool>("msdsfl"); entity.spaceavail = row.IsNull("spaceavail") ? decimal.Zero : row.Field <decimal>("spaceavail"); entity.displayspaceavail = row.Field <bool>("displayspaceavail"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }