示例#1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromAltloc(ref DataRow row, Altloc entity)
 {
     row.SetField("co_num", entity.coNum);
     row.SetField("wh_num", entity.whNum);
     row.SetField("bin_num", entity.binNum);
     row.SetField("wh_zone", entity.whZone);
     row.SetField("row_status", entity.rowStatus);
     row.SetField("bin_hits", entity.binHits);
     row.SetField("height", entity.height);
     row.SetField("width", entity.width);
     row.SetField("depth", entity.depth);
     row.SetField("max_pal", entity.maxPal);
     row.SetField("max_weight", entity.maxWeight);
     row.SetField("cube", entity.cube);
     row.SetField("pallet_footprint", entity.palletFootprint);
     row.SetField("binmstRowID", entity.binmstRowID.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
示例#2
0
        public static Altloc BuildAltlocFromRow(DataRow row)
        {
            Altloc entity = new Altloc();

            entity.coNum           = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num");
            entity.whNum           = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num");
            entity.binNum          = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num");
            entity.whZone          = row.IsNull("wh_zone") ? string.Empty : row.Field <string>("wh_zone");
            entity.rowStatus       = row.Field <bool>("row_status");
            entity.binHits         = row.IsNull("bin_hits") ? 0 : row.Field <int>("bin_hits");
            entity.height          = row.IsNull("height") ? 0 : row.Field <int>("height");
            entity.width           = row.IsNull("width") ? 0 : row.Field <int>("width");
            entity.depth           = row.IsNull("depth") ? 0 : row.Field <int>("depth");
            entity.maxPal          = row.IsNull("max_pal") ? 0 : row.Field <int>("max_pal");
            entity.maxWeight       = row.IsNull("max_weight") ? 0 : row.Field <int>("max_weight");
            entity.cube            = row.IsNull("cube") ? decimal.Zero : row.Field <decimal>("cube");
            entity.palletFootprint = row.IsNull("pallet_footprint") ? 0 : row.Field <int>("pallet_footprint");
            entity.binmstRowID     = row.Field <byte[]>("binmstRowID").ToStringEncoded();
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }