Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApsdgetlistresults(ref DataRow row, Apsdgetlistresults entity)
 {
     row.SetField("vendno", entity.vendno);
     row.SetField("vendname", entity.vendname);
     row.SetField("shipfmno", entity.shipfmno);
     row.SetField("shipfmname", entity.shipfmname);
     row.SetField("shipviaty", entity.shipviaty);
     row.SetField("shipviadesc", entity.shipviadesc);
     row.SetField("minleaddays", entity.minleaddays);
     row.SetField("deliverycd", entity.deliverycd);
     row.SetField("shipsrvcd", entity.shipsrvcd);
     row.SetField("wodiscpct", entity.wodiscpct);
     row.SetField("wodisctype", entity.wodisctype);
     row.SetField("usewodisc", entity.usewodisc);
     row.SetField("useaddons", entity.useaddons);
     row.SetField("apsd-rowid", entity.apsdRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Apsdgetlistresults BuildApsdgetlistresultsFromRow(DataRow row)
        {
            Apsdgetlistresults entity = new Apsdgetlistresults();

            entity.vendno      = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendname    = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.shipfmno    = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno");
            entity.shipfmname  = row.IsNull("shipfmname") ? string.Empty : row.Field <string>("shipfmname");
            entity.shipviaty   = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty");
            entity.shipviadesc = row.IsNull("shipviadesc") ? string.Empty : row.Field <string>("shipviadesc");
            entity.minleaddays = row.IsNull("minleaddays") ? 0 : row.Field <int>("minleaddays");
            entity.deliverycd  = row.IsNull("deliverycd") ? string.Empty : row.Field <string>("deliverycd");
            entity.shipsrvcd   = row.IsNull("shipsrvcd") ? string.Empty : row.Field <string>("shipsrvcd");
            entity.wodiscpct   = row.IsNull("wodiscpct") ? decimal.Zero : row.Field <decimal>("wodiscpct");
            entity.wodisctype  = row.Field <bool>("wodisctype");
            entity.usewodisc   = row.Field <bool>("usewodisc");
            entity.useaddons   = row.Field <bool>("useaddons");
            entity.apsdRowid   = row.Field <byte[]>("apsd-rowid").ToStringEncoded();
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }