Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcspraddchg(ref DataRow row, Icspraddchg entity)
 {
     row.SetField("updatetype", entity.updatetype);
     row.SetField("recordtype", entity.recordtype);
     row.SetField("restricttype", entity.restricttype);
     row.SetField("product", entity.product);
     row.SetField("prodline", entity.prodline);
     row.SetField("vendno", entity.vendno);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("prodprctype", entity.prodprctype);
     row.SetField("altprodgrp", entity.altprodgrp);
     row.SetField("brandcd", entity.brandcd);
     row.SetField("startdt", entity.startdt);
     row.SetField("expiredt", entity.expiredt);
     row.SetField("whse", entity.whse);
     row.SetField("statuscd", entity.statuscd);
     row.SetField("restrictcd", entity.restrictcd);
     row.SetField("activefl", entity.activefl);
     row.SetField("certrequiredfl", entity.certrequiredfl);
     row.SetField("restrictovrfl", entity.restrictovrfl);
     row.SetField("restrictdesc", entity.restrictdesc);
     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("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Icspraddchg BuildIcspraddchgFromRow(DataRow row)
        {
            Icspraddchg entity = new Icspraddchg();

            entity.updatetype         = row.IsNull("updatetype") ? string.Empty : row.Field <string>("updatetype");
            entity.recordtype         = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype");
            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.vendno             = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.prodcat            = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.prodprctype        = row.IsNull("prodprctype") ? string.Empty : row.Field <string>("prodprctype");
            entity.altprodgrp         = row.IsNull("altprodgrp") ? string.Empty : row.Field <string>("altprodgrp");
            entity.brandcd            = row.IsNull("brandcd") ? string.Empty : row.Field <string>("brandcd");
            entity.startdt            = row.Field <DateTime?>("startdt");
            entity.expiredt           = row.Field <DateTime?>("expiredt");
            entity.whse               = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.statuscd           = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd");
            entity.restrictcd         = row.IsNull("restrictcd") ? string.Empty : row.Field <string>("restrictcd");
            entity.activefl           = row.Field <bool>("activefl");
            entity.certrequiredfl     = row.Field <bool>("certrequiredfl");
            entity.restrictovrfl      = row.Field <bool>("restrictovrfl");
            entity.restrictdesc       = row.IsNull("restrictdesc") ? string.Empty : row.Field <string>("restrictdesc");
            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.rowid              = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield          = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }