Esempio n. 1
0
        public static Receipttransmaster BuildReceipttransmasterFromRow(DataRow row)
        {
            Receipttransmaster entity = new Receipttransmaster();

            entity.cargoControl      = row.IsNull("cargo_control") ? string.Empty : row.Field <string>("cargo_control");
            entity.carrier           = row.IsNull("carrier") ? string.Empty : row.Field <string>("carrier");
            entity.clearanceCode     = row.IsNull("clearance_code") ? string.Empty : row.Field <string>("clearance_code");
            entity.clearanceRequired = row.Field <bool>("clearance_required");
            entity.comments          = row.IsNull("comments") ? string.Empty : row.Field <string>("comments");
            entity.coNum             = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num");
            entity.createdBy         = row.IsNull("created_by") ? string.Empty : row.Field <string>("created_by");
            entity.customData1       = row.IsNull("custom_data1") ? string.Empty : row.Field <string>("custom_data1");
            entity.customData2       = row.IsNull("custom_data2") ? string.Empty : row.Field <string>("custom_data2");
            entity.customData3       = row.IsNull("custom_data3") ? string.Empty : row.Field <string>("custom_data3");
            entity.customData4       = row.IsNull("custom_data4") ? string.Empty : row.Field <string>("custom_data4");
            entity.customData5       = row.IsNull("custom_data5") ? string.Empty : row.Field <string>("custom_data5");
            entity.delivery          = row.Field <DateTime?>("delivery");
            entity.numCartons        = row.IsNull("num_cartons") ? 0 : row.Field <int>("num_cartons");
            entity.order             = row.IsNull("order") ? string.Empty : row.Field <string>("order");
            entity.orderSuffix       = row.IsNull("order_suffix") ? string.Empty : row.Field <string>("order_suffix");
            entity.packingList       = row.Field <bool>("packing_list");
            entity.percentFill       = row.IsNull("percent_fill") ? decimal.Zero : row.Field <decimal>("percent_fill");
            entity.releaseId         = row.IsNull("release_id") ? string.Empty : row.Field <string>("release_id");
            entity.rowStatus         = row.IsNull("row_status") ? string.Empty : row.Field <string>("row_status");
            entity.rtId      = row.IsNull("rt_id") ? 0 : row.Field <int>("rt_id");
            entity.rtNum     = row.IsNull("rt_num") ? string.Empty : row.Field <string>("rt_num");
            entity.taskId    = row.IsNull("task_id") ? 0 : row.Field <int>("task_id");
            entity.transDate = row.IsNull("trans_date") ? string.Empty : row.Field <string>("trans_date");
            entity.transProc = row.IsNull("trans_proc") ? string.Empty : row.Field <string>("trans_proc");
            entity.transUser = row.IsNull("trans_user") ? string.Empty : row.Field <string>("trans_user");
            entity.truckId   = row.IsNull("truck_id") ? string.Empty : row.Field <string>("truck_id");
            entity.type      = row.IsNull("type") ? string.Empty : row.Field <string>("type");
            entity.unplanned = row.Field <bool>("unplanned");
            entity.vendorId  = row.IsNull("vendor_id") ? string.Empty : row.Field <string>("vendor_id");
            entity.whNum     = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num");
            entity.rowID     = row.Field <byte[]>("rowID").ToStringEncoded();
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Esempio n. 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromReceipttransmaster(ref DataRow row, Receipttransmaster entity)
 {
     row.SetField("cargo_control", entity.cargoControl);
     row.SetField("carrier", entity.carrier);
     row.SetField("clearance_code", entity.clearanceCode);
     row.SetField("clearance_required", entity.clearanceRequired);
     row.SetField("comments", entity.comments);
     row.SetField("co_num", entity.coNum);
     row.SetField("created_by", entity.createdBy);
     row.SetField("custom_data1", entity.customData1);
     row.SetField("custom_data2", entity.customData2);
     row.SetField("custom_data3", entity.customData3);
     row.SetField("custom_data4", entity.customData4);
     row.SetField("custom_data5", entity.customData5);
     row.SetField("delivery", entity.delivery);
     row.SetField("num_cartons", entity.numCartons);
     row.SetField("order", entity.order);
     row.SetField("order_suffix", entity.orderSuffix);
     row.SetField("packing_list", entity.packingList);
     row.SetField("percent_fill", entity.percentFill);
     row.SetField("release_id", entity.releaseId);
     row.SetField("row_status", entity.rowStatus);
     row.SetField("rt_id", entity.rtId);
     row.SetField("rt_num", entity.rtNum);
     row.SetField("task_id", entity.taskId);
     row.SetField("trans_date", entity.transDate);
     row.SetField("trans_proc", entity.transProc);
     row.SetField("trans_user", entity.transUser);
     row.SetField("truck_id", entity.truckId);
     row.SetField("type", entity.type);
     row.SetField("unplanned", entity.unplanned);
     row.SetField("vendor_id", entity.vendorId);
     row.SetField("wh_num", entity.whNum);
     row.SetField("rowID", entity.rowID.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }