コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsprcriteria(ref DataRow row, Icsprcriteria entity)
 {
     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("whse", entity.whse);
     row.SetField("startdt", entity.startdt);
     row.SetField("begexpiredt", entity.begexpiredt);
     row.SetField("endexpiredt", entity.endexpiredt);
     row.SetField("statuscd", entity.statuscd);
     row.SetField("expiredactivefl", entity.expiredactivefl);
     row.SetField("certrequiredfl", entity.certrequiredfl);
     row.SetField("restrictovrfl", entity.restrictovrfl);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("restrictcd", entity.restrictcd);
     row.SetField("certcode", entity.certcode);
     row.SetField("recordlimit", entity.recordlimit);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Icsprcriteria BuildIcsprcriteriaFromRow(DataRow row)
        {
            Icsprcriteria entity = new Icsprcriteria();

            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.whse            = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.startdt         = row.Field <DateTime?>("startdt");
            entity.begexpiredt     = row.Field <DateTime?>("begexpiredt");
            entity.endexpiredt     = row.Field <DateTime?>("endexpiredt");
            entity.statuscd        = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd");
            entity.expiredactivefl = row.Field <bool>("expiredactivefl");
            entity.certrequiredfl  = row.Field <bool>("certrequiredfl");
            entity.restrictovrfl   = row.Field <bool>("restrictovrfl");
            entity.custno          = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto          = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.restrictcd      = row.IsNull("restrictcd") ? string.Empty : row.Field <string>("restrictcd");
            entity.certcode        = row.IsNull("certcode") ? string.Empty : row.Field <string>("certcode");
            entity.recordlimit     = row.IsNull("recordlimit") ? 0 : row.Field <int>("recordlimit");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }