/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArsosearchresults(ref DataRow row, Arsosearchresults entity) { row.SetField("custno", entity.custno); row.SetField("custtype", entity.custtype); row.SetField("prodcat", entity.prodcat); row.SetField("catdesc", entity.catdesc); row.SetField("arso-rowid", entity.arsoRowid.ToByteArray()); row.SetField("userfield", entity.userfield); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); }
public static Arsosearchresults BuildArsosearchresultsFromRow(DataRow row) { Arsosearchresults entity = new Arsosearchresults(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.custtype = row.IsNull("custtype") ? string.Empty : row.Field <string>("custtype"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.catdesc = row.IsNull("catdesc") ? string.Empty : row.Field <string>("catdesc"); entity.arsoRowid = row.Field <byte[]>("arso-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field <string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field <string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field <string>("user5"); entity.user6 = row.Field <decimal?>("user6"); entity.user7 = row.Field <decimal?>("user7"); entity.user8 = row.Field <DateTime?>("user8"); entity.user9 = row.Field <DateTime?>("user9"); return(entity); }