Exemple #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSastchistoryresults(ref DataRow row, Sastchistoryresults entity)
 {
     row.SetField("currencyty", entity.currencyty);
     row.SetField("draftfl", entity.draftfl);
     row.SetField("oldexrate", entity.oldexrate);
     row.SetField("newexrate", entity.newexrate);
     row.SetField("ratesource", entity.ratesource);
     row.SetField("edicurrency", entity.edicurrency);
     row.SetField("glacctno", entity.glacctno);
     row.SetField("gldeptno", entity.gldeptno);
     row.SetField("gldivno", entity.gldivno);
     row.SetField("glsubno", entity.glsubno);
     row.SetField("rvglacctno", entity.rvglacctno);
     row.SetField("rvgldeptno", entity.rvgldeptno);
     row.SetField("rvgldivno", entity.rvgldivno);
     row.SetField("rvglsubno", entity.rvglsubno);
     row.SetField("rowid-sastch", entity.rowidSastch.ToByteArray());
     row.SetField("transproc", entity.transproc);
     row.SetField("changedt", entity.changedt);
     row.SetField("changent", entity.changent);
     row.SetField("changetm", entity.changetm);
     row.SetField("changety", entity.changety);
     row.SetField("operinit", entity.operinit);
     row.SetField("transdt", entity.transdt);
     row.SetField("transtm", entity.transtm);
     row.SetField("cglno", entity.cglno);
     row.SetField("userfield", entity.userfield);
 }
Exemple #2
0
        public static Sastchistoryresults BuildSastchistoryresultsFromRow(DataRow row)
        {
            Sastchistoryresults entity = new Sastchistoryresults();

            entity.currencyty  = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.draftfl     = row.Field <bool>("draftfl");
            entity.oldexrate   = row.IsNull("oldexrate") ? decimal.Zero : row.Field <decimal>("oldexrate");
            entity.newexrate   = row.IsNull("newexrate") ? decimal.Zero : row.Field <decimal>("newexrate");
            entity.ratesource  = row.IsNull("ratesource") ? string.Empty : row.Field <string>("ratesource");
            entity.edicurrency = row.IsNull("edicurrency") ? string.Empty : row.Field <string>("edicurrency");
            entity.glacctno    = row.IsNull("glacctno") ? 0 : row.Field <int>("glacctno");
            entity.gldeptno    = row.IsNull("gldeptno") ? 0 : row.Field <int>("gldeptno");
            entity.gldivno     = row.IsNull("gldivno") ? 0 : row.Field <int>("gldivno");
            entity.glsubno     = row.IsNull("glsubno") ? 0 : row.Field <int>("glsubno");
            entity.rvglacctno  = row.IsNull("rvglacctno") ? 0 : row.Field <int>("rvglacctno");
            entity.rvgldeptno  = row.IsNull("rvgldeptno") ? 0 : row.Field <int>("rvgldeptno");
            entity.rvgldivno   = row.IsNull("rvgldivno") ? 0 : row.Field <int>("rvgldivno");
            entity.rvglsubno   = row.IsNull("rvglsubno") ? 0 : row.Field <int>("rvglsubno");
            entity.rowidSastch = row.Field <byte[]>("rowid-sastch").ToStringEncoded();
            entity.transproc   = row.IsNull("transproc") ? string.Empty : row.Field <string>("transproc");
            entity.changedt    = row.Field <DateTime?>("changedt");
            entity.changent    = row.IsNull("changent") ? string.Empty : row.Field <string>("changent");
            entity.changetm    = row.IsNull("changetm") ? string.Empty : row.Field <string>("changetm");
            entity.changety    = row.IsNull("changety") ? string.Empty : row.Field <string>("changety");
            entity.operinit    = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit");
            entity.transdt     = row.Field <DateTime?>("transdt");
            entity.transtm     = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm");
            entity.cglno       = row.IsNull("cglno") ? string.Empty : row.Field <string>("cglno");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }