コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOrdertransdetail(ref DataRow row, Ordertransdetail entity)
 {
     row.SetField("co_num", entity.coNum);
     row.SetField("wh_num", entity.whNum);
     row.SetField("po_number", entity.poNumber);
     row.SetField("po_suffix", entity.poSuffix);
     row.SetField("date_time", entity.dateTime);
     row.SetField("bin_num", entity.binNum);
     row.SetField("trans_type", entity.transType);
     row.SetField("pallet_id", entity.palletId);
     row.SetField("po_line", entity.poLine);
     row.SetField("line_sequence", entity.lineSequence);
     row.SetField("lot", entity.lot);
     row.SetField("bin_from", entity.binFrom);
     row.SetField("bin_to", entity.binTo);
     row.SetField("adj_code", entity.adjCode);
     row.SetField("stock_stat", entity.stockStat);
     row.SetField("release_id", entity.releaseId);
     row.SetField("batch", entity.batch);
     row.SetField("comments", entity.comments);
     row.SetField("proc_created", entity.procCreated);
     row.SetField("emp_num", entity.empNum);
     row.SetField("abs_num", entity.absNum);
     row.SetField("item_desc", entity.itemDesc);
     row.SetField("carton_id", entity.cartonId);
     row.SetField("item_qty", entity.itemQty);
     row.SetField("isCartons", entity.isCartons);
     row.SetField("isSerials", entity.isSerials);
     row.SetField("rowID", entity.rowID.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Ordertransdetail BuildOrdertransdetailFromRow(DataRow row)
        {
            Ordertransdetail entity = new Ordertransdetail();

            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.poNumber     = row.IsNull("po_number") ? string.Empty : row.Field <string>("po_number");
            entity.poSuffix     = row.IsNull("po_suffix") ? string.Empty : row.Field <string>("po_suffix");
            entity.dateTime     = row.IsNull("date_time") ? string.Empty : row.Field <string>("date_time");
            entity.binNum       = row.IsNull("bin_num") ? string.Empty : row.Field <string>("bin_num");
            entity.transType    = row.IsNull("trans_type") ? string.Empty : row.Field <string>("trans_type");
            entity.palletId     = row.IsNull("pallet_id") ? string.Empty : row.Field <string>("pallet_id");
            entity.poLine       = row.IsNull("po_line") ? 0 : row.Field <int>("po_line");
            entity.lineSequence = row.IsNull("line_sequence") ? 0 : row.Field <int>("line_sequence");
            entity.lot          = row.IsNull("lot") ? string.Empty : row.Field <string>("lot");
            entity.binFrom      = row.IsNull("bin_from") ? string.Empty : row.Field <string>("bin_from");
            entity.binTo        = row.IsNull("bin_to") ? string.Empty : row.Field <string>("bin_to");
            entity.adjCode      = row.IsNull("adj_code") ? string.Empty : row.Field <string>("adj_code");
            entity.stockStat    = row.IsNull("stock_stat") ? string.Empty : row.Field <string>("stock_stat");
            entity.releaseId    = row.IsNull("release_id") ? string.Empty : row.Field <string>("release_id");
            entity.batch        = row.IsNull("batch") ? 0 : row.Field <int>("batch");
            entity.comments     = row.IsNull("comments") ? string.Empty : row.Field <string>("comments");
            entity.procCreated  = row.IsNull("proc_created") ? string.Empty : row.Field <string>("proc_created");
            entity.empNum       = row.IsNull("emp_num") ? string.Empty : row.Field <string>("emp_num");
            entity.absNum       = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num");
            entity.itemDesc     = row.IsNull("item_desc") ? string.Empty : row.Field <string>("item_desc");
            entity.cartonId     = row.IsNull("carton_id") ? string.Empty : row.Field <string>("carton_id");
            entity.itemQty      = row.IsNull("item_qty") ? decimal.Zero : row.Field <decimal>("item_qty");
            entity.isCartons    = row.Field <bool>("isCartons");
            entity.isSerials    = row.Field <bool>("isSerials");
            entity.rowID        = row.Field <byte[]>("rowID").ToStringEncoded();
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }