/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromKpewavail(ref DataRow row, Kpewavail entity) { row.SetField("wono", entity.wono); row.SetField("wosuf", entity.wosuf); row.SetField("availtobuild", entity.availtobuild); row.SetField("netavail", entity.netavail); row.SetField("qtyshipk", entity.qtyshipk); row.SetField("qtyonorder", entity.qtyonorder); row.SetField("qtybo", entity.qtybo); row.SetField("userfield", entity.userfield); }
public static Kpewavail BuildKpewavailFromRow(DataRow row) { Kpewavail entity = new Kpewavail(); entity.wono = row.IsNull("wono") ? 0 : row.Field <int>("wono"); entity.wosuf = row.IsNull("wosuf") ? 0 : row.Field <int>("wosuf"); entity.availtobuild = row.IsNull("availtobuild") ? decimal.Zero : row.Field <decimal>("availtobuild"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail"); entity.qtyshipk = row.IsNull("qtyshipk") ? decimal.Zero : row.Field <decimal>("qtyshipk"); entity.qtyonorder = row.IsNull("qtyonorder") ? decimal.Zero : row.Field <decimal>("qtyonorder"); entity.qtybo = row.IsNull("qtybo") ? decimal.Zero : row.Field <decimal>("qtybo"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }