/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromItembucketdetail(ref DataRow row, Itembucketdetail entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("abs_num", entity.absNum); row.SetField("qtyAvail", entity.qtyAvail); row.SetField("qtyUnavail", entity.qtyUnavail); row.SetField("qtyReserved", entity.qtyReserved); row.SetField("qtyInTransit", entity.qtyInTransit); row.SetField("qtyOnHand", entity.qtyOnHand); row.SetField("qtyDemand", entity.qtyDemand); row.SetField("itemRowID", entity.itemRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Itembucketdetail BuildItembucketdetailFromRow(DataRow row) { Itembucketdetail entity = new Itembucketdetail(); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.qtyAvail = row.IsNull("qtyAvail") ? decimal.Zero : row.Field <decimal>("qtyAvail"); entity.qtyUnavail = row.IsNull("qtyUnavail") ? decimal.Zero : row.Field <decimal>("qtyUnavail"); entity.qtyReserved = row.IsNull("qtyReserved") ? decimal.Zero : row.Field <decimal>("qtyReserved"); entity.qtyInTransit = row.IsNull("qtyInTransit") ? decimal.Zero : row.Field <decimal>("qtyInTransit"); entity.qtyOnHand = row.IsNull("qtyOnHand") ? decimal.Zero : row.Field <decimal>("qtyOnHand"); entity.qtyDemand = row.IsNull("qtyDemand") ? decimal.Zero : row.Field <decimal>("qtyDemand"); entity.itemRowID = row.Field <byte[]>("itemRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }