/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdsprebatecopyresults(ref DataRow row, Pdsprebatecopyresults entity) { row.SetField("codeid", entity.codeid); row.SetField("levelkey", entity.levelkey); row.SetField("vendno", entity.vendno); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("rebtype", entity.rebtype); row.SetField("rebsubty", entity.rebsubty); row.SetField("rebcustty", entity.rebcustty); row.SetField("whse", entity.whse); row.SetField("startdt", entity.startdt); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Pdsprebatecopyresults BuildPdsprebatecopyresultsFromRow(DataRow row) { Pdsprebatecopyresults entity = new Pdsprebatecopyresults(); entity.codeid = row.IsNull("codeid") ? string.Empty : row.Field <string>("codeid"); entity.levelkey = row.IsNull("levelkey") ? string.Empty : row.Field <string>("levelkey"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.rebtype = row.IsNull("rebtype") ? string.Empty : row.Field <string>("rebtype"); entity.rebsubty = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty"); entity.rebcustty = row.IsNull("rebcustty") ? string.Empty : row.Field <string>("rebcustty"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.startdt = row.Field <DateTime?>("startdt"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }