Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWtialineresults(ref DataRow row, Wtialineresults entity)
 {
     row.SetField("lineno", entity.lineno);
     row.SetField("approvety", entity.approvety);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("shipprod", entity.shipprod);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("qtyship", entity.qtyship);
     row.SetField("unit", entity.unit);
     row.SetField("bofl", entity.bofl);
     row.SetField("prodtype", entity.prodtype);
     row.SetField("rowid-wtel", entity.rowidWtel.ToByteArray());
     row.SetField("cmessage", entity.cmessage);
     row.SetField("NetAvailable", entity.netAvailable);
     row.SetField("Surplus", entity.surplus);
     row.SetField("TotalLineAmt", entity.totalLineAmt);
     row.SetField("msdsfl", entity.msdsfl);
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Wtialineresults BuildWtialineresultsFromRow(DataRow row)
        {
            Wtialineresults entity = new Wtialineresults();

            entity.lineno       = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.approvety    = row.IsNull("approvety") ? string.Empty : row.Field <string>("approvety");
            entity.nonstockty   = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.shipprod     = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.proddesc     = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.qtyord       = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.qtyship      = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship");
            entity.unit         = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.bofl         = row.Field <bool>("bofl");
            entity.prodtype     = row.IsNull("prodtype") ? string.Empty : row.Field <string>("prodtype");
            entity.rowidWtel    = row.Field <byte[]>("rowid-wtel").ToStringEncoded();
            entity.cmessage     = row.IsNull("cmessage") ? string.Empty : row.Field <string>("cmessage");
            entity.netAvailable = row.IsNull("NetAvailable") ? decimal.Zero : row.Field <decimal>("NetAvailable");
            entity.surplus      = row.IsNull("Surplus") ? decimal.Zero : row.Field <decimal>("Surplus");
            entity.totalLineAmt = row.IsNull("TotalLineAmt") ? decimal.Zero : row.Field <decimal>("TotalLineAmt");
            entity.msdsfl       = row.Field <bool>("msdsfl");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }