예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsprsrcrestrict(ref DataRow row, Icsprsrcrestrict entity)
 {
     row.SetField("restricttype", entity.restricttype);
     row.SetField("product", entity.product);
     row.SetField("prodline", entity.prodline);
     row.SetField("prodlinevendno", entity.prodlinevendno);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("startdt", entity.startdt);
     row.SetField("expiredt", entity.expiredt);
     row.SetField("whse", entity.whse);
     row.SetField("vendno", entity.vendno);
     row.SetField("shiptowhse", entity.shiptowhse);
     row.SetField("activefl", entity.activefl);
     row.SetField("restrictovrfl", entity.restrictovrfl);
     row.SetField("descrip", entity.descrip);
     row.SetField("module", entity.module);
     row.SetField("icspr-rowid", entity.icsprRowid.ToByteArray());
     row.SetField("icspr-rowpointer", entity.icsprRowpointer);
     row.SetField("icspr-srcrowpointer", entity.icsprSrcrowpointer);
     row.SetField("user1", entity.user1);
     row.SetField("user2", entity.user2);
     row.SetField("user3", entity.user3);
     row.SetField("user4", entity.user4);
     row.SetField("user5", entity.user5);
     row.SetField("user6", entity.user6);
     row.SetField("user7", entity.user7);
     row.SetField("user8", entity.user8);
     row.SetField("user9", entity.user9);
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Icsprsrcrestrict BuildIcsprsrcrestrictFromRow(DataRow row)
        {
            Icsprsrcrestrict entity = new Icsprsrcrestrict();

            entity.restricttype       = row.IsNull("restricttype") ? string.Empty : row.Field <string>("restricttype");
            entity.product            = row.IsNull("product") ? string.Empty : row.Field <string>("product");
            entity.prodline           = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.prodlinevendno     = row.IsNull("prodlinevendno") ? decimal.Zero : row.Field <decimal>("prodlinevendno");
            entity.prodcat            = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.startdt            = row.Field <DateTime?>("startdt");
            entity.expiredt           = row.Field <DateTime?>("expiredt");
            entity.whse               = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.vendno             = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.shiptowhse         = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse");
            entity.activefl           = row.Field <bool>("activefl");
            entity.restrictovrfl      = row.Field <bool>("restrictovrfl");
            entity.descrip            = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip");
            entity.module             = row.IsNull("module") ? string.Empty : row.Field <string>("module");
            entity.icsprRowid         = row.Field <byte[]>("icspr-rowid").ToStringEncoded();
            entity.icsprRowpointer    = row.IsNull("icspr-rowpointer") ? string.Empty : row.Field <string>("icspr-rowpointer");
            entity.icsprSrcrowpointer = row.IsNull("icspr-srcrowpointer") ? string.Empty : row.Field <string>("icspr-srcrowpointer");
            entity.user1              = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user2              = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user3              = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user4              = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user5              = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user6              = row.Field <decimal?>("user6");
            entity.user7              = row.Field <decimal?>("user7");
            entity.user8              = row.Field <DateTime?>("user8");
            entity.user9              = row.Field <DateTime?>("user9");
            entity.userfield          = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }