/// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApeiinvdetmanpyappinv(ref DataRow row, Apeiinvdetmanpyappinv entity)
 {
     row.SetField("groupnm", entity.groupnm);
     row.SetField("createddt", entity.createddt);
     row.SetField("groupseqno", entity.groupseqno);
     row.SetField("apei-rowid", entity.apeiRowid.ToByteArray());
     row.SetField("apinvno", entity.apinvno);
     row.SetField("apinvnoenabledfl", entity.apinvnoenabledfl);
     row.SetField("invseqno", entity.invseqno);
     row.SetField("paidseqno", entity.paidseqno);
     row.SetField("paidseqnoenabledfl", entity.paidseqnoenabledfl);
     row.SetField("amount", entity.amount);
     row.SetField("amountenabledfl", entity.amountenabledfl);
     row.SetField("origdisc", entity.origdisc);
     row.SetField("origdiscenabledfl", entity.origdiscenabledfl);
     row.SetField("paidinvamt", entity.paidinvamt);
     row.SetField("paiddisc", entity.paiddisc);
     row.SetField("userfield", entity.userfield);
 }
        public static Apeiinvdetmanpyappinv BuildApeiinvdetmanpyappinvFromRow(DataRow row)
        {
            Apeiinvdetmanpyappinv entity = new Apeiinvdetmanpyappinv();

            entity.groupnm            = row.IsNull("groupnm") ? string.Empty : row.Field <string>("groupnm");
            entity.createddt          = row.Field <DateTime?>("createddt");
            entity.groupseqno         = row.IsNull("groupseqno") ? 0 : row.Field <int>("groupseqno");
            entity.apeiRowid          = row.Field <byte[]>("apei-rowid").ToStringEncoded();
            entity.apinvno            = row.IsNull("apinvno") ? string.Empty : row.Field <string>("apinvno");
            entity.apinvnoenabledfl   = row.Field <bool>("apinvnoenabledfl");
            entity.invseqno           = row.IsNull("invseqno") ? 0 : row.Field <int>("invseqno");
            entity.paidseqno          = row.IsNull("paidseqno") ? 0 : row.Field <int>("paidseqno");
            entity.paidseqnoenabledfl = row.Field <bool>("paidseqnoenabledfl");
            entity.amount             = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.amountenabledfl    = row.Field <bool>("amountenabledfl");
            entity.origdisc           = row.IsNull("origdisc") ? decimal.Zero : row.Field <decimal>("origdisc");
            entity.origdiscenabledfl  = row.Field <bool>("origdiscenabledfl");
            entity.paidinvamt         = row.IsNull("paidinvamt") ? decimal.Zero : row.Field <decimal>("paidinvamt");
            entity.paiddisc           = row.IsNull("paiddisc") ? decimal.Zero : row.Field <decimal>("paiddisc");
            entity.userfield          = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }