Beispiel #1
0
        public static Oeaddons BuildOeaddonsFromRow(DataRow row)
        {
            Oeaddons entity = new Oeaddons();

            entity.addonamt    = row.IsNull("addonamt") ? decimal.Zero : row.Field <decimal>("addonamt");
            entity.addoncapfl  = row.Field <bool>("addoncapfl");
            entity.addondist   = row.IsNull("addondist") ? decimal.Zero : row.Field <decimal>("addondist");
            entity.addondistr  = row.IsNull("addondistr") ? string.Empty : row.Field <string>("addondistr");
            entity.addonnet    = row.IsNull("addonnet") ? decimal.Zero : row.Field <decimal>("addonnet");
            entity.addonno     = row.IsNull("addonno") ? 0 : row.Field <int>("addonno");
            entity.addontype   = row.Field <bool>("addontype");
            entity.addoverfl   = row.Field <bool>("addoverfl");
            entity.addtaxgroup = row.IsNull("addtaxgroup") ? 0 : row.Field <int>("addtaxgroup");
            entity.cono        = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.directfl    = row.Field <bool>("directfl");
            entity.operinit    = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit");
            entity.orderno     = row.IsNull("orderno") ? 0 : row.Field <int>("orderno");
            entity.ordersuf    = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf");
            entity.ordertype   = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype");
            entity.prevaddamt  = row.IsNull("prevaddamt") ? decimal.Zero : row.Field <decimal>("prevaddamt");
            entity.prevaddtype = row.Field <bool>("prevaddtype");
            entity.seqno       = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.transdt     = row.Field <DateTime?>("transdt");
            entity.transproc   = row.IsNull("transproc") ? string.Empty : row.Field <string>("transproc");
            entity.transtm     = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm");
            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.addondesc   = row.IsNull("addondesc") ? string.Empty : row.Field <string>("addondesc");
            entity.ehffl       = row.Field <bool>("ehffl");
            entity.state       = row.IsNull("state") ? string.Empty : row.Field <string>("state");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Beispiel #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOeaddons(ref DataRow row, Oeaddons entity)
 {
     row.SetField("addonamt", entity.addonamt);
     row.SetField("addoncapfl", entity.addoncapfl);
     row.SetField("addondist", entity.addondist);
     row.SetField("addondistr", entity.addondistr);
     row.SetField("addonnet", entity.addonnet);
     row.SetField("addonno", entity.addonno);
     row.SetField("addontype", entity.addontype);
     row.SetField("addoverfl", entity.addoverfl);
     row.SetField("addtaxgroup", entity.addtaxgroup);
     row.SetField("cono", entity.cono);
     row.SetField("directfl", entity.directfl);
     row.SetField("operinit", entity.operinit);
     row.SetField("orderno", entity.orderno);
     row.SetField("ordersuf", entity.ordersuf);
     row.SetField("ordertype", entity.ordertype);
     row.SetField("prevaddamt", entity.prevaddamt);
     row.SetField("prevaddtype", entity.prevaddtype);
     row.SetField("seqno", entity.seqno);
     row.SetField("transdt", entity.transdt);
     row.SetField("transproc", entity.transproc);
     row.SetField("transtm", entity.transtm);
     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("addondesc", entity.addondesc);
     row.SetField("ehffl", entity.ehffl);
     row.SetField("state", entity.state);
     row.SetField("userfield", entity.userfield);
 }