Exemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromGlsdtrans(ref DataRow row, Glsdtrans entity)
 {
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("groupnm", entity.groupnm);
     row.SetField("setno", entity.setno);
     row.SetField("transno", entity.transno);
     row.SetField("reversefl", entity.reversefl);
     row.SetField("glno", entity.glno);
     row.SetField("glnm", entity.glnm);
     row.SetField("gllookupnm", entity.gllookupnm);
     row.SetField("glnotesfl", entity.glnotesfl);
     row.SetField("baltype", entity.baltype);
     row.SetField("oppositefl", entity.oppositefl);
     row.SetField("percent", entity.percent);
     row.SetField("refer", entity.refer);
     row.SetField("maxamount", entity.maxamount);
     row.SetField("changedfl", entity.changedfl);
     row.SetField("newfl", entity.newfl);
     row.SetField("deletedfl", entity.deletedfl);
     row.SetField("o-oppositefl", entity.oOppositefl);
     row.SetField("o-percent", entity.oPercent);
     row.SetField("proofdr", entity.proofdr);
     row.SetField("proofcr", entity.proofcr);
     row.SetField("glyr", entity.glyr);
     row.SetField("userfield", entity.userfield);
 }
Exemplo n.º 2
0
        public static Glsdtrans BuildGlsdtransFromRow(DataRow row)
        {
            Glsdtrans entity = new Glsdtrans();

            entity.rowid       = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.groupnm     = row.IsNull("groupnm") ? string.Empty : row.Field <string>("groupnm");
            entity.setno       = row.IsNull("setno") ? 0 : row.Field <int>("setno");
            entity.transno     = row.IsNull("transno") ? 0 : row.Field <int>("transno");
            entity.reversefl   = row.Field <bool>("reversefl");
            entity.glno        = row.IsNull("glno") ? string.Empty : row.Field <string>("glno");
            entity.glnm        = row.IsNull("glnm") ? string.Empty : row.Field <string>("glnm");
            entity.gllookupnm  = row.IsNull("gllookupnm") ? string.Empty : row.Field <string>("gllookupnm");
            entity.glnotesfl   = row.IsNull("glnotesfl") ? string.Empty : row.Field <string>("glnotesfl");
            entity.baltype     = row.IsNull("baltype") ? string.Empty : row.Field <string>("baltype");
            entity.oppositefl  = row.Field <bool>("oppositefl");
            entity.percent     = row.IsNull("percent") ? decimal.Zero : row.Field <decimal>("percent");
            entity.refer       = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.maxamount   = row.IsNull("maxamount") ? decimal.Zero : row.Field <decimal>("maxamount");
            entity.changedfl   = row.Field <bool>("changedfl");
            entity.newfl       = row.Field <bool>("newfl");
            entity.deletedfl   = row.Field <bool>("deletedfl");
            entity.oOppositefl = row.Field <bool>("o-oppositefl");
            entity.oPercent    = row.IsNull("o-percent") ? decimal.Zero : row.Field <decimal>("o-percent");
            entity.proofdr     = row.IsNull("proofdr") ? decimal.Zero : row.Field <decimal>("proofdr");
            entity.proofcr     = row.IsNull("proofcr") ? decimal.Zero : row.Field <decimal>("proofcr");
            entity.glyr        = row.IsNull("glyr") ? 0 : row.Field <int>("glyr");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }