Beispiel #1
0
        public static Wmproductbins BuildWmproductbinsFromRow(DataRow row)
        {
            Wmproductbins entity = new Wmproductbins();

            entity.whse          = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prod          = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.binloc        = row.IsNull("binloc") ? string.Empty : row.Field <string>("binloc");
            entity.acode         = row.IsNull("acode") ? string.Empty : row.Field <string>("acode");
            entity.scode         = row.IsNull("scode") ? string.Empty : row.Field <string>("scode");
            entity.qtyavail      = row.IsNull("qtyavail") ? decimal.Zero : row.Field <decimal>("qtyavail");
            entity.lstoredt      = row.Field <DateTime?>("lstoredt");
            entity.fstoredt      = row.Field <DateTime?>("fstoredt");
            entity.tmstored      = row.IsNull("tmstored") ? 0 : row.Field <int>("tmstored");
            entity.lpickdt       = row.Field <DateTime?>("lpickdt");
            entity.tmpicked      = row.IsNull("tmpicked") ? 0 : row.Field <int>("tmpicked");
            entity.qtyonhand     = row.IsNull("qtyonhand") ? decimal.Zero : row.Field <decimal>("qtyonhand");
            entity.qtycommitted  = row.IsNull("qtycommitted") ? decimal.Zero : row.Field <decimal>("qtycommitted");
            entity.qtyreceived   = row.IsNull("qtyreceived") ? decimal.Zero : row.Field <decimal>("qtyreceived");
            entity.minqty        = row.IsNull("minqty") ? decimal.Zero : row.Field <decimal>("minqty");
            entity.maxqty        = row.IsNull("maxqty") ? decimal.Zero : row.Field <decimal>("maxqty");
            entity.icspnotesfl   = row.IsNull("icspnotesfl") ? string.Empty : row.Field <string>("icspnotesfl");
            entity.icspunitstock = row.IsNull("icspunitstock") ? string.Empty : row.Field <string>("icspunitstock");
            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 UpdateRowFromWmproductbins(ref DataRow row, Wmproductbins entity)
 {
     row.SetField("whse", entity.whse);
     row.SetField("prod", entity.prod);
     row.SetField("binloc", entity.binloc);
     row.SetField("acode", entity.acode);
     row.SetField("scode", entity.scode);
     row.SetField("qtyavail", entity.qtyavail);
     row.SetField("lstoredt", entity.lstoredt);
     row.SetField("fstoredt", entity.fstoredt);
     row.SetField("tmstored", entity.tmstored);
     row.SetField("lpickdt", entity.lpickdt);
     row.SetField("tmpicked", entity.tmpicked);
     row.SetField("qtyonhand", entity.qtyonhand);
     row.SetField("qtycommitted", entity.qtycommitted);
     row.SetField("qtyreceived", entity.qtyreceived);
     row.SetField("minqty", entity.minqty);
     row.SetField("maxqty", entity.maxqty);
     row.SetField("icspnotesfl", entity.icspnotesfl);
     row.SetField("icspunitstock", entity.icspunitstock);
     row.SetField("userfield", entity.userfield);
 }