public static Oessresearchresults BuildOessresearchresultsFromRow(DataRow row) { Oessresearchresults entity = new Oessresearchresults(); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.begrecord = row.IsNull("begrecord") ? string.Empty : row.Field <string>("begrecord"); entity.endrecord = row.IsNull("endrecord") ? string.Empty : row.Field <string>("endrecord"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.slsrepin = row.IsNull("slsrepin") ? string.Empty : row.Field <string>("slsrepin"); entity.slsrepout = row.IsNull("slsrepout") ? string.Empty : row.Field <string>("slsrepout"); entity.srcrowpointer = row.IsNull("srcrowpointer") ? string.Empty : row.Field <string>("srcrowpointer"); entity.srcrowpointerend = row.IsNull("srcrowpointerend") ? string.Empty : row.Field <string>("srcrowpointerend"); entity.custrowpointer = row.IsNull("custrowpointer") ? string.Empty : row.Field <string>("custrowpointer"); 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"); entity.oessreRowID = row.Field <byte[]>("oessreRowID").ToStringEncoded(); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOessresearchresults(ref DataRow row, Oessresearchresults entity) { row.SetField("recordtype", entity.recordtype); row.SetField("begrecord", entity.begrecord); row.SetField("endrecord", entity.endrecord); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("slsrepin", entity.slsrepin); row.SetField("slsrepout", entity.slsrepout); row.SetField("srcrowpointer", entity.srcrowpointer); row.SetField("srcrowpointerend", entity.srcrowpointerend); row.SetField("custrowpointer", entity.custrowpointer); 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); row.SetField("oessreRowID", entity.oessreRowID.ToByteArray()); }