/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromNsinvhdrlookupresults(ref DataRow row, Nsinvhdrlookupresults entity) { row.SetField("cono", entity.cono); row.SetField("typecd", entity.typecd); row.SetField("typecddspl", entity.typecddspl); row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("prodcat", entity.prodcat); row.SetField("activefl", entity.activefl); row.SetField("descrip1", entity.descrip1); row.SetField("descrip2", entity.descrip2); row.SetField("quantity", entity.quantity); row.SetField("icswprod", entity.icswprod); row.SetField("icspprodcat", entity.icspprodcat); row.SetField("tiedqty", entity.tiedqty); row.SetField("availqty", entity.availqty); row.SetField("rowid-icenh", entity.rowidIcenh.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Nsinvhdrlookupresults BuildNsinvhdrlookupresultsFromRow(DataRow row) { Nsinvhdrlookupresults entity = new Nsinvhdrlookupresults(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.typecd = row.IsNull("typecd") ? string.Empty : row.Field <string>("typecd"); entity.typecddspl = row.IsNull("typecddspl") ? string.Empty : row.Field <string>("typecddspl"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.activefl = row.Field <bool>("activefl"); entity.descrip1 = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1"); entity.descrip2 = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.icswprod = row.IsNull("icswprod") ? string.Empty : row.Field <string>("icswprod"); entity.icspprodcat = row.IsNull("icspprodcat") ? string.Empty : row.Field <string>("icspprodcat"); entity.tiedqty = row.IsNull("tiedqty") ? string.Empty : row.Field <string>("tiedqty"); entity.availqty = row.IsNull("availqty") ? string.Empty : row.Field <string>("availqty"); entity.rowidIcenh = row.Field <byte[]>("rowid-icenh").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }