예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsefresults(ref DataRow row, Icsefresults entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("whse", entity.whse);
     row.SetField("prodnotesfl", entity.prodnotesfl);
     row.SetField("lookupnm", entity.lookupnm);
     row.SetField("receiptdt", entity.receiptdt);
     row.SetField("seqno", entity.seqno);
     row.SetField("availfl", entity.availfl);
     row.SetField("quantity", entity.quantity);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("addoncost", entity.addoncost);
     row.SetField("prccostperlbl", entity.prccostperlbl);
     row.SetField("icsefrowid", entity.icsefrowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Icsefresults BuildIcsefresultsFromRow(DataRow row)
        {
            Icsefresults entity = new Icsefresults();

            entity.prod          = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.whse          = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prodnotesfl   = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl");
            entity.lookupnm      = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm");
            entity.receiptdt     = row.Field <DateTime?>("receiptdt");
            entity.seqno         = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.availfl       = row.Field <bool>("availfl");
            entity.quantity      = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity");
            entity.prodcost      = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.addoncost     = row.IsNull("addoncost") ? decimal.Zero : row.Field <decimal>("addoncost");
            entity.prccostperlbl = row.IsNull("prccostperlbl") ? string.Empty : row.Field <string>("prccostperlbl");
            entity.icsefrowid    = row.Field <byte[]>("icsefrowid").ToStringEncoded();
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }