Exemplo n.º 1
0
        public static Icspcaddchg BuildIcspcaddchgFromRow(DataRow row)
        {
            Icspcaddchg entity = new Icspcaddchg();

            entity.cono               = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.updatetype         = row.IsNull("updatetype") ? string.Empty : row.Field <string>("updatetype");
            entity.recordtype         = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype");
            entity.srcrowpointer      = row.IsNull("srcrowpointer") ? string.Empty : row.Field <string>("srcrowpointer");
            entity.setuptype          = row.IsNull("setuptype") ? string.Empty : row.Field <string>("setuptype");
            entity.whse               = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.custno             = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto             = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.shiptogrp          = row.IsNull("shiptogrp") ? string.Empty : row.Field <string>("shiptogrp");
            entity.shiptogrpfl        = row.Field <bool>("shiptogrpfl");
            entity.startdt            = row.Field <DateTime?>("startdt");
            entity.expiredt           = row.Field <DateTime?>("expiredt");
            entity.activefl           = row.Field <bool>("activefl");
            entity.contractno         = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno");
            entity.refer              = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.fillpriority       = row.IsNull("fillpriority") ? 0 : row.Field <int>("fillpriority");
            entity.fillpriorityfl     = row.Field <bool>("fillpriorityfl");
            entity.createdt           = row.Field <DateTime?>("createdt");
            entity.expectedratepct    = row.IsNull("expectedratepct") ? 0 : row.Field <int>("expectedratepct");
            entity.expectedratepctfl  = row.Field <bool>("expectedratepctfl");
            entity.expiredusagetype   = row.IsNull("expiredusagetype") ? string.Empty : row.Field <string>("expiredusagetype");
            entity.expiredusagetypefl = row.Field <bool>("expiredusagetypefl");
            entity.copyusage          = row.IsNull("copyusage") ? string.Empty : row.Field <string>("copyusage");
            entity.copyusagefl        = row.Field <bool>("copyusagefl");
            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.icspcRowpointer    = row.IsNull("icspc-rowpointer") ? string.Empty : row.Field <string>("icspc-rowpointer");
            entity.copydetailfl       = row.Field <bool>("copydetailfl");
            entity.rowid              = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield          = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcspcaddchg(ref DataRow row, Icspcaddchg entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("updatetype", entity.updatetype);
     row.SetField("recordtype", entity.recordtype);
     row.SetField("srcrowpointer", entity.srcrowpointer);
     row.SetField("setuptype", entity.setuptype);
     row.SetField("whse", entity.whse);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("shiptogrp", entity.shiptogrp);
     row.SetField("shiptogrpfl", entity.shiptogrpfl);
     row.SetField("startdt", entity.startdt);
     row.SetField("expiredt", entity.expiredt);
     row.SetField("activefl", entity.activefl);
     row.SetField("contractno", entity.contractno);
     row.SetField("refer", entity.refer);
     row.SetField("fillpriority", entity.fillpriority);
     row.SetField("fillpriorityfl", entity.fillpriorityfl);
     row.SetField("createdt", entity.createdt);
     row.SetField("expectedratepct", entity.expectedratepct);
     row.SetField("expectedratepctfl", entity.expectedratepctfl);
     row.SetField("expiredusagetype", entity.expiredusagetype);
     row.SetField("expiredusagetypefl", entity.expiredusagetypefl);
     row.SetField("copyusage", entity.copyusage);
     row.SetField("copyusagefl", entity.copyusagefl);
     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("icspc-rowpointer", entity.icspcRowpointer);
     row.SetField("copydetailfl", entity.copydetailfl);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }