/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdsppricebrowseresults(ref DataRow row, Pdsppricebrowseresults entity) { row.SetField("seqno", entity.seqno); row.SetField("price", entity.price); row.SetField("prcbreak", entity.prcbreak); row.SetField("disc", entity.disc); row.SetField("userfield", entity.userfield); }
public static Pdsppricebrowseresults BuildPdsppricebrowseresultsFromRow(DataRow row) { Pdsppricebrowseresults entity = new Pdsppricebrowseresults(); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.prcbreak = row.IsNull("prcbreak") ? 0 : row.Field <int>("prcbreak"); entity.disc = row.IsNull("disc") ? decimal.Zero : row.Field <decimal>("disc"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }