/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsabcloadttresults(ref DataRow row, Icsabcloadttresults entity) { row.SetField("icsabcrowid", entity.icsabcrowid.ToByteArray()); row.SetField("whse", entity.whse); row.SetField("stkoan", entity.stkoan); row.SetField("relwtsales", entity.relwtsales); row.SetField("relwtgmroi", entity.relwtgmroi); row.SetField("relwthits", entity.relwthits); row.SetField("relimpa", entity.relimpa); row.SetField("relimpb", entity.relimpb); row.SetField("relimpc", entity.relimpc); row.SetField("relimpd", entity.relimpd); row.SetField("userfield", entity.userfield); }
public static Icsabcloadttresults BuildIcsabcloadttresultsFromRow(DataRow row) { Icsabcloadttresults entity = new Icsabcloadttresults(); entity.icsabcrowid = row.Field <byte[]>("icsabcrowid").ToStringEncoded(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.stkoan = row.IsNull("stkoan") ? string.Empty : row.Field <string>("stkoan"); entity.relwtsales = row.IsNull("relwtsales") ? decimal.Zero : row.Field <decimal>("relwtsales"); entity.relwtgmroi = row.IsNull("relwtgmroi") ? decimal.Zero : row.Field <decimal>("relwtgmroi"); entity.relwthits = row.IsNull("relwthits") ? decimal.Zero : row.Field <decimal>("relwthits"); entity.relimpa = row.IsNull("relimpa") ? decimal.Zero : row.Field <decimal>("relimpa"); entity.relimpb = row.IsNull("relimpb") ? decimal.Zero : row.Field <decimal>("relimpb"); entity.relimpc = row.IsNull("relimpc") ? decimal.Zero : row.Field <decimal>("relimpc"); entity.relimpd = row.IsNull("relimpd") ? decimal.Zero : row.Field <decimal>("relimpd"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }