コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromCrectrans(ref DataRow row, Crectrans entity)
 {
     row.SetField("checkno", entity.checkno);
     row.SetField("statustype", entity.statustype);
     row.SetField("cType", entity.cType);
     row.SetField("cSource", entity.cSource);
     row.SetField("modulenm", entity.modulenm);
     row.SetField("enterdt", entity.enterdt);
     row.SetField("amount", entity.amount);
     row.SetField("refer", entity.refer);
     row.SetField("clearfl", entity.clearfl);
     row.SetField("cleardt", entity.cleardt);
     row.SetField("balancedfl", entity.balancedfl);
     row.SetField("voidfl", entity.voidfl);
     row.SetField("jrnlno", entity.jrnlno);
     row.SetField("setno", entity.setno);
     row.SetField("bacsref", entity.bacsref);
     row.SetField("pospaydttm", entity.pospaydttm);
     row.SetField("cretrowid", entity.cretrowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Crectrans BuildCrectransFromRow(DataRow row)
        {
            Crectrans entity = new Crectrans();

            entity.checkno    = row.IsNull("checkno") ? decimal.Zero : row.Field <decimal>("checkno");
            entity.statustype = row.Field <bool>("statustype");
            entity.cType      = row.IsNull("cType") ? string.Empty : row.Field <string>("cType");
            entity.cSource    = row.IsNull("cSource") ? string.Empty : row.Field <string>("cSource");
            entity.modulenm   = row.IsNull("modulenm") ? string.Empty : row.Field <string>("modulenm");
            entity.enterdt    = row.Field <DateTime?>("enterdt");
            entity.amount     = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.refer      = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.clearfl    = row.Field <bool>("clearfl");
            entity.cleardt    = row.Field <DateTime?>("cleardt");
            entity.balancedfl = row.Field <bool>("balancedfl");
            entity.voidfl     = row.Field <bool>("voidfl");
            entity.jrnlno     = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno");
            entity.setno      = row.IsNull("setno") ? 0 : row.Field <int>("setno");
            entity.bacsref    = row.IsNull("bacsref") ? string.Empty : row.Field <string>("bacsref");
            entity.pospaydttm = row.IsNull("pospaydttm") ? string.Empty : row.Field <string>("pospaydttm");
            entity.cretrowid  = row.Field <byte[]>("cretrowid").ToStringEncoded();
            entity.userfield  = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }