コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromItemavail(ref DataRow row, Itemavail entity)
 {
     row.SetField("abs_num", entity.absNum);
     row.SetField("bin_num", entity.binNum);
     row.SetField("total_qty", entity.totalQty);
     row.SetField("pallet_id", entity.palletId);
     row.SetField("stock_stat", entity.stockStat);
     row.SetField("date_time_rec", entity.dateTimeRec);
     row.SetField("lot", entity.lot);
     row.SetField("date_expiration", entity.dateExpiration);
     row.SetField("case_quantity", entity.caseQuantity);
     row.SetField("cycle_flag", entity.cycleFlag);
     row.SetField("itemRowID", entity.itemRowID.ToByteArray());
     row.SetField("inventoryRowID", entity.inventoryRowID.ToByteArray());
     row.SetField("itemavailuserfield", entity.itemavailuserfield);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Itemavail BuildItemavailFromRow(DataRow row)
        {
            Itemavail entity = new Itemavail();

            entity.absNum             = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num");
            entity.binNum             = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num");
            entity.totalQty           = row.IsNull("total_qty") ? decimal.Zero : row.Field <decimal>("total_qty");
            entity.palletId           = row.IsNull("pallet_id") ? string.Empty : row.Field <string>("pallet_id");
            entity.stockStat          = row.IsNull("stock_stat") ? string.Empty : row.Field <string>("stock_stat");
            entity.dateTimeRec        = row.IsNull("date_time_rec") ? string.Empty : row.Field <string>("date_time_rec");
            entity.lot                = row.IsNull("lot") ? string.Empty : row.Field <string>("lot");
            entity.dateExpiration     = row.Field <DateTime?>("date_expiration");
            entity.caseQuantity       = row.IsNull("case_quantity") ? decimal.Zero : row.Field <decimal>("case_quantity");
            entity.cycleFlag          = row.Field <bool>("cycle_flag");
            entity.itemRowID          = row.Field <byte[]>("itemRowID").ToStringEncoded();
            entity.inventoryRowID     = row.Field <byte[]>("inventoryRowID").ToStringEncoded();
            entity.itemavailuserfield = row.IsNull("itemavailuserfield") ? string.Empty : row.Field <string>("itemavailuserfield");
            entity.userfield          = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }