Пример #1
0
        public static Aocustomer BuildAocustomerFromRow(DataRow row)
        {
            Aocustomer entity = new Aocustomer();

            entity.cono                      = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.arminblamt                = row.IsNull("arminblamt") ? decimal.Zero : row.Field <decimal>("arminblamt");
            entity.arstmtfrmt                = row.IsNull("arstmtfrmt") ? 0 : row.Field <int>("arstmtfrmt");
            entity.arstmtheadfl              = row.Field <bool>("arstmtheadfl");
            entity.arminbalsc                = row.IsNull("arminbalsc") ? decimal.Zero : row.Field <decimal>("arminbalsc");
            entity.svcchgdivfl               = row.Field <bool>("svcchgdivfl");
            entity.arminscamt                = row.IsNull("arminscamt") ? decimal.Zero : row.Field <decimal>("arminscamt");
            entity.svcchgshipfl              = row.Field <bool>("svcchgshipfl");
            entity.sctype                    = row.IsNull("sctype") ? string.Empty : row.Field <string>("sctype");
            entity.arscpc21                  = row.IsNull("arscpc21") ? decimal.Zero : row.Field <decimal>("arscpc21");
            entity.arscpc22                  = row.IsNull("arscpc22") ? decimal.Zero : row.Field <decimal>("arscpc22");
            entity.arscpc23                  = row.IsNull("arscpc23") ? decimal.Zero : row.Field <decimal>("arscpc23");
            entity.arscpc24                  = row.IsNull("arscpc24") ? decimal.Zero : row.Field <decimal>("arscpc24");
            entity.arscpct1                  = row.IsNull("arscpct1") ? decimal.Zero : row.Field <decimal>("arscpct1");
            entity.arscpct2                  = row.IsNull("arscpct2") ? decimal.Zero : row.Field <decimal>("arscpct2");
            entity.arscpct3                  = row.IsNull("arscpct3") ? decimal.Zero : row.Field <decimal>("arscpct3");
            entity.arscpct4                  = row.IsNull("arscpct4") ? decimal.Zero : row.Field <decimal>("arscpct4");
            entity.arscbal1                  = row.IsNull("arscbal1") ? decimal.Zero : row.Field <decimal>("arscbal1");
            entity.arscbal2                  = row.IsNull("arscbal2") ? decimal.Zero : row.Field <decimal>("arscbal2");
            entity.arscbal3                  = row.IsNull("arscbal3") ? decimal.Zero : row.Field <decimal>("arscbal3");
            entity.arscbal4                  = row.IsNull("arscbal4") ? decimal.Zero : row.Field <decimal>("arscbal4");
            entity.arshiptosvc               = row.IsNull("arshiptosvc") ? string.Empty : row.Field <string>("arshiptosvc");
            entity.ardiscdays                = row.IsNull("ardiscdays") ? 0 : row.Field <int>("ardiscdays");
            entity.arcrdiscfl                = row.Field <bool>("arcrdiscfl");
            entity.arpiflimit                = row.IsNull("arpiflimit") ? decimal.Zero : row.Field <decimal>("arpiflimit");
            entity.arshipfl                  = row.Field <bool>("arshipfl");
            entity.sequcfl                   = row.Field <bool>("sequcfl");
            entity.arperdays1                = row.IsNull("arperdays1") ? 0 : row.Field <int>("arperdays1");
            entity.arperdays2                = row.IsNull("arperdays2") ? 0 : row.Field <int>("arperdays2");
            entity.arperdays3                = row.IsNull("arperdays3") ? 0 : row.Field <int>("arperdays3");
            entity.arperdays4                = row.IsNull("arperdays4") ? 0 : row.Field <int>("arperdays4");
            entity.mcarrollcd                = row.Field <bool>("mcarrollcd");
            entity.scarrollcd                = row.Field <bool>("scarrollcd");
            entity.arcodinbalfl              = row.Field <bool>("arcodinbalfl");
            entity.arfpaddonfl               = row.Field <bool>("arfpaddonfl");
            entity.credduetype               = row.IsNull("credduetype") ? string.Empty : row.Field <string>("credduetype");
            entity.artermscd                 = row.IsNull("artermscd") ? string.Empty : row.Field <string>("artermscd");
            entity.sascRowid                 = row.Field <byte[]>("sasc-rowid").ToStringEncoded();
            entity.userfield                 = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            entity.statementOutputType       = row.IsNull("StatementOutputType") ? string.Empty : row.Field <string>("StatementOutputType");
            entity.statementExtraDataLevel1  = row.IsNull("StatementExtraDataLevel1") ? string.Empty : row.Field <string>("StatementExtraDataLevel1");
            entity.statementExtraDataLevel2  = row.IsNull("StatementExtraDataLevel2") ? string.Empty : row.Field <string>("StatementExtraDataLevel2");
            entity.statementIDMDocTypeID     = row.IsNull("StatementIDMDocTypeID") ? string.Empty : row.Field <string>("StatementIDMDocTypeID");
            entity.statementIDMTemplateName  = row.IsNull("StatementIDMTemplateName") ? string.Empty : row.Field <string>("StatementIDMTemplateName");
            entity.statementIDMFromEmailAddr = row.IsNull("StatementIDMFromEmailAddr") ? string.Empty : row.Field <string>("StatementIDMFromEmailAddr");
            entity.statementIDMFromEmailName = row.IsNull("StatementIDMFromEmailName") ? string.Empty : row.Field <string>("StatementIDMFromEmailName");
            entity.validateDupLookupNm       = row.Field <bool>("ValidateDupLookupNm");
            entity.allowPaymentTypes         = row.Field <bool>("AllowPaymentTypes");
            return(entity);
        }
Пример #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromAocustomer(ref DataRow row, Aocustomer entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("arminblamt", entity.arminblamt);
     row.SetField("arstmtfrmt", entity.arstmtfrmt);
     row.SetField("arstmtheadfl", entity.arstmtheadfl);
     row.SetField("arminbalsc", entity.arminbalsc);
     row.SetField("svcchgdivfl", entity.svcchgdivfl);
     row.SetField("arminscamt", entity.arminscamt);
     row.SetField("svcchgshipfl", entity.svcchgshipfl);
     row.SetField("sctype", entity.sctype);
     row.SetField("arscpc21", entity.arscpc21);
     row.SetField("arscpc22", entity.arscpc22);
     row.SetField("arscpc23", entity.arscpc23);
     row.SetField("arscpc24", entity.arscpc24);
     row.SetField("arscpct1", entity.arscpct1);
     row.SetField("arscpct2", entity.arscpct2);
     row.SetField("arscpct3", entity.arscpct3);
     row.SetField("arscpct4", entity.arscpct4);
     row.SetField("arscbal1", entity.arscbal1);
     row.SetField("arscbal2", entity.arscbal2);
     row.SetField("arscbal3", entity.arscbal3);
     row.SetField("arscbal4", entity.arscbal4);
     row.SetField("arshiptosvc", entity.arshiptosvc);
     row.SetField("ardiscdays", entity.ardiscdays);
     row.SetField("arcrdiscfl", entity.arcrdiscfl);
     row.SetField("arpiflimit", entity.arpiflimit);
     row.SetField("arshipfl", entity.arshipfl);
     row.SetField("sequcfl", entity.sequcfl);
     row.SetField("arperdays1", entity.arperdays1);
     row.SetField("arperdays2", entity.arperdays2);
     row.SetField("arperdays3", entity.arperdays3);
     row.SetField("arperdays4", entity.arperdays4);
     row.SetField("mcarrollcd", entity.mcarrollcd);
     row.SetField("scarrollcd", entity.scarrollcd);
     row.SetField("arcodinbalfl", entity.arcodinbalfl);
     row.SetField("arfpaddonfl", entity.arfpaddonfl);
     row.SetField("credduetype", entity.credduetype);
     row.SetField("artermscd", entity.artermscd);
     row.SetField("sasc-rowid", entity.sascRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
     row.SetField("StatementOutputType", entity.statementOutputType);
     row.SetField("StatementExtraDataLevel1", entity.statementExtraDataLevel1);
     row.SetField("StatementExtraDataLevel2", entity.statementExtraDataLevel2);
     row.SetField("StatementIDMDocTypeID", entity.statementIDMDocTypeID);
     row.SetField("StatementIDMTemplateName", entity.statementIDMTemplateName);
     row.SetField("StatementIDMFromEmailAddr", entity.statementIDMFromEmailAddr);
     row.SetField("StatementIDMFromEmailName", entity.statementIDMFromEmailName);
     row.SetField("ValidateDupLookupNm", entity.validateDupLookupNm);
     row.SetField("AllowPaymentTypes", entity.allowPaymentTypes);
 }