Beispiel #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWtsaaddchg(ref DataRow row, Wtsaaddchg entity)
 {
     row.SetField("updatetype", entity.updatetype);
     row.SetField("recordtype", entity.recordtype);
     row.SetField("shipfmwhse", entity.shipfmwhse);
     row.SetField("shiptowhse", entity.shiptowhse);
     row.SetField("cono2", entity.cono2);
     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("addontype", entity.addontype);
     row.SetField("addonamt", entity.addonamt);
     row.SetField("wtsa-srcrowpointer", entity.wtsaSrcrowpointer);
     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);
 }
Beispiel #2
0
        public static Wtsaaddchg BuildWtsaaddchgFromRow(DataRow row)
        {
            Wtsaaddchg entity = new Wtsaaddchg();

            entity.updatetype        = row.IsNull("updatetype") ? string.Empty : row.Field <string>("updatetype");
            entity.recordtype        = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype");
            entity.shipfmwhse        = row.IsNull("shipfmwhse") ? string.Empty : row.Field <string>("shipfmwhse");
            entity.shiptowhse        = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse");
            entity.cono2             = row.IsNull("cono2") ? 0 : row.Field <int>("cono2");
            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.addontype         = row.IsNull("addontype") ? string.Empty : row.Field <string>("addontype");
            entity.addonamt          = row.IsNull("addonamt") ? decimal.Zero : row.Field <decimal>("addonamt");
            entity.wtsaSrcrowpointer = row.IsNull("wtsa-srcrowpointer") ? string.Empty : row.Field <string>("wtsa-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);
        }