コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPhysinv(ref DataRow row, Physinv entity)
 {
     row.SetField("loc", entity.loc);
     row.SetField("loc_status", entity.locStatus);
     row.SetField("loc_type", entity.locType);
     row.SetField("prim_pick", entity.primPick);
     row.SetField("zone", entity.zone);
     row.SetField("zone_type", entity.zoneType);
     row.SetField("aisle", entity.aisle);
     row.SetField("pallet", entity.pallet);
     row.SetField("item", entity.item);
     row.SetField("qty_before", entity.qtyBefore);
     row.SetField("qty_after", entity.qtyAfter);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Physinv BuildPhysinvFromRow(DataRow row)
        {
            Physinv entity = new Physinv();

            entity.loc       = row.IsNull("loc") ? string.Empty : row.Field <string>("loc");
            entity.locStatus = row.Field <bool>("loc_status");
            entity.locType   = row.IsNull("loc_type") ? string.Empty : row.Field <string>("loc_type");
            entity.primPick  = row.Field <bool>("prim_pick");
            entity.zone      = row.IsNull("zone") ? string.Empty : row.Field <string>("zone");
            entity.zoneType  = row.IsNull("zone_type") ? string.Empty : row.Field <string>("zone_type");
            entity.aisle     = row.IsNull("aisle") ? 0 : row.Field <int>("aisle");
            entity.pallet    = row.IsNull("pallet") ? string.Empty : row.Field <string>("pallet");
            entity.item      = row.IsNull("item") ? string.Empty : row.Field <string>("item");
            entity.qtyBefore = row.IsNull("qty_before") ? decimal.Zero : row.Field <decimal>("qty_before");
            entity.qtyAfter  = row.IsNull("qty_after") ? decimal.Zero : row.Field <decimal>("qty_after");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }