Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOmorderlist(ref DataRow row, Omorderlist entity)
 {
     row.SetField("actual_freight", entity.actualFreight);
     row.SetField("assigned", entity.assigned);
     row.SetField("batchid", entity.batchid);
     row.SetField("bill_addr1", entity.billAddr1);
     row.SetField("bill_addr2", entity.billAddr2);
     row.SetField("bill_addr_ext1", entity.billAddrExt1);
     row.SetField("bill_addr_ext2", entity.billAddrExt2);
     row.SetField("bill_addr_ext3", entity.billAddrExt3);
     row.SetField("bill_city", entity.billCity);
     row.SetField("bill_country", entity.billCountry);
     row.SetField("bill_name", entity.billName);
     row.SetField("bill_state", entity.billState);
     row.SetField("bill_zip", entity.billZip);
     row.SetField("branch_id", entity.branchId);
     row.SetField("cancel_flag", entity.cancelFlag);
     row.SetField("carrier", entity.carrier);
     row.SetField("charges", entity.charges);
     row.SetField("class", entity.@class);
     row.SetField("clearance_code", entity.clearanceCode);
     row.SetField("clearance_required", entity.clearanceRequired);
     row.SetField("cod_addr1", entity.codAddr1);
     row.SetField("cod_addr2", entity.codAddr2);
     row.SetField("cod_addr3", entity.codAddr3);
     row.SetField("cod_addr4", entity.codAddr4);
     row.SetField("cod_addr5", entity.codAddr5);
     row.SetField("cod_amount", entity.codAmount);
     row.SetField("cod_charge", entity.codCharge);
     row.SetField("cod_city", entity.codCity);
     row.SetField("cod_country", entity.codCountry);
     row.SetField("cod_flag", entity.codFlag);
     row.SetField("cod_name", entity.codName);
     row.SetField("cod_state", entity.codState);
     row.SetField("cod_zip", entity.codZip);
     row.SetField("comment", entity.comment);
     row.SetField("co_num", entity.coNum);
     row.SetField("customer_freight", entity.customerFreight);
     row.SetField("customer_po", entity.customerPo);
     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("custom_selector", entity.customSelector);
     row.SetField("cust_code", entity.custCode);
     row.SetField("del_route", entity.delRoute);
     row.SetField("discount", entity.discount);
     row.SetField("drop_cube", entity.dropCube);
     row.SetField("drop_type", entity.dropType);
     row.SetField("drop_weight", entity.dropWeight);
     row.SetField("exp_ship_date", entity.expShipDate);
     row.SetField("freight_terms", entity.freightTerms);
     row.SetField("guaranteed_del_time", entity.guaranteedDelTime);
     row.SetField("hold_reason", entity.holdReason);
     row.SetField("host_batch", entity.hostBatch);
     row.SetField("host_selector", entity.hostSelector);
     row.SetField("host_sequence", entity.hostSequence);
     row.SetField("id", entity.id);
     row.SetField("international", entity.international);
     row.SetField("kit_build_type", entity.kitBuildType);
     row.SetField("line_count", entity.lineCount);
     row.SetField("lot", entity.lot);
     row.SetField("max_days", entity.maxDays);
     row.SetField("memo", entity.memo);
     row.SetField("order", entity.order);
     row.SetField("order_date", entity.orderDate);
     row.SetField("order_status", entity.orderStatus);
     row.SetField("order_suffix", entity.orderSuffix);
     row.SetField("orig_cube", entity.origCube);
     row.SetField("orig_order_date", entity.origOrderDate);
     row.SetField("orig_weight", entity.origWeight);
     row.SetField("pallet_drop_fl", entity.palletDropFl);
     row.SetField("partial", entity.partial);
     row.SetField("pay_method", entity.payMethod);
     row.SetField("printed", entity.printed);
     row.SetField("priority", entity.priority);
     row.SetField("product", entity.product);
     row.SetField("product_qty", entity.productQty);
     row.SetField("pro_number", entity.proNumber);
     row.SetField("rate_type", entity.rateType);
     row.SetField("route", entity.route);
     row.SetField("row_status", entity.rowStatus);
     row.SetField("service", entity.service);
     row.SetField("ship_addr1", entity.shipAddr1);
     row.SetField("ship_addr2", entity.shipAddr2);
     row.SetField("ship_addr_ext1", entity.shipAddrExt1);
     row.SetField("ship_addr_ext2", entity.shipAddrExt2);
     row.SetField("ship_addr_ext3", entity.shipAddrExt3);
     row.SetField("ship_city", entity.shipCity);
     row.SetField("ship_country", entity.shipCountry);
     row.SetField("ship_cube", entity.shipCube);
     row.SetField("ship_cust_code", entity.shipCustCode);
     row.SetField("ship_date", entity.shipDate);
     row.SetField("ship_name", entity.shipName);
     row.SetField("ship_state", entity.shipState);
     row.SetField("ship_to_code", entity.shipToCode);
     row.SetField("ship_weight", entity.shipWeight);
     row.SetField("ship_zip", entity.shipZip);
     row.SetField("shp_by_irms", entity.shpByIrms);
     row.SetField("slsrepin", entity.slsrepin);
     row.SetField("slsrepout", entity.slsrepout);
     row.SetField("takenby", entity.takenby);
     row.SetField("tax", entity.tax);
     row.SetField("total_line_cnt", entity.totalLineCnt);
     row.SetField("total_line_qty", entity.totalLineQty);
     row.SetField("trans_date", entity.transDate);
     row.SetField("trans_proc", entity.transProc);
     row.SetField("trans_user", entity.transUser);
     row.SetField("type", entity.type);
     row.SetField("wh_num", entity.whNum);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("calc_status", entity.calcStatus);
     row.SetField("IWave", entity.iWave);
     row.SetField("Notes", entity.notes);
     row.SetField("ord_id", entity.ordId);
     row.SetField("emp_num", entity.empNum);
     row.SetField("is_comments", entity.isComments);
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Omorderlist BuildOmorderlistFromRow(DataRow row)
        {
            Omorderlist entity = new Omorderlist();

            entity.actualFreight     = row.IsNull("actual_freight") ? decimal.Zero : row.Field <decimal>("actual_freight");
            entity.assigned          = row.Field <bool>("assigned");
            entity.batchid           = row.IsNull("batchid") ? 0 : row.Field <int>("batchid");
            entity.billAddr1         = row.IsNull("bill_addr1") ? string.Empty : row.Field <string>("bill_addr1");
            entity.billAddr2         = row.IsNull("bill_addr2") ? string.Empty : row.Field <string>("bill_addr2");
            entity.billAddrExt1      = row.IsNull("bill_addr_ext1") ? string.Empty : row.Field <string>("bill_addr_ext1");
            entity.billAddrExt2      = row.IsNull("bill_addr_ext2") ? string.Empty : row.Field <string>("bill_addr_ext2");
            entity.billAddrExt3      = row.IsNull("bill_addr_ext3") ? string.Empty : row.Field <string>("bill_addr_ext3");
            entity.billCity          = row.IsNull("bill_city") ? string.Empty : row.Field <string>("bill_city");
            entity.billCountry       = row.IsNull("bill_country") ? string.Empty : row.Field <string>("bill_country");
            entity.billName          = row.IsNull("bill_name") ? string.Empty : row.Field <string>("bill_name");
            entity.billState         = row.IsNull("bill_state") ? string.Empty : row.Field <string>("bill_state");
            entity.billZip           = row.IsNull("bill_zip") ? string.Empty : row.Field <string>("bill_zip");
            entity.branchId          = row.IsNull("branch_id") ? string.Empty : row.Field <string>("branch_id");
            entity.cancelFlag        = row.Field <bool>("cancel_flag");
            entity.carrier           = row.IsNull("carrier") ? string.Empty : row.Field <string>("carrier");
            entity.charges           = row.IsNull("charges") ? decimal.Zero : row.Field <decimal>("charges");
            entity.@class            = row.IsNull("class") ? string.Empty : row.Field <string>("class");
            entity.clearanceCode     = row.IsNull("clearance_code") ? string.Empty : row.Field <string>("clearance_code");
            entity.clearanceRequired = row.Field <bool>("clearance_required");
            entity.codAddr1          = row.IsNull("cod_addr1") ? string.Empty : row.Field <string>("cod_addr1");
            entity.codAddr2          = row.IsNull("cod_addr2") ? string.Empty : row.Field <string>("cod_addr2");
            entity.codAddr3          = row.IsNull("cod_addr3") ? string.Empty : row.Field <string>("cod_addr3");
            entity.codAddr4          = row.IsNull("cod_addr4") ? string.Empty : row.Field <string>("cod_addr4");
            entity.codAddr5          = row.IsNull("cod_addr5") ? string.Empty : row.Field <string>("cod_addr5");
            entity.codAmount         = row.IsNull("cod_amount") ? decimal.Zero : row.Field <decimal>("cod_amount");
            entity.codCharge         = row.IsNull("cod_charge") ? string.Empty : row.Field <string>("cod_charge");
            entity.codCity           = row.IsNull("cod_city") ? string.Empty : row.Field <string>("cod_city");
            entity.codCountry        = row.IsNull("cod_country") ? string.Empty : row.Field <string>("cod_country");
            entity.codFlag           = row.Field <bool>("cod_flag");
            entity.codName           = row.IsNull("cod_name") ? string.Empty : row.Field <string>("cod_name");
            entity.codState          = row.IsNull("cod_state") ? string.Empty : row.Field <string>("cod_state");
            entity.codZip            = row.IsNull("cod_zip") ? string.Empty : row.Field <string>("cod_zip");
            entity.comment           = row.IsNull("comment") ? string.Empty : row.Field <string>("comment");
            entity.coNum             = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num");
            entity.customerFreight   = row.IsNull("customer_freight") ? decimal.Zero : row.Field <decimal>("customer_freight");
            entity.customerPo        = row.IsNull("customer_po") ? string.Empty : row.Field <string>("customer_po");
            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.customSelector    = row.IsNull("custom_selector") ? string.Empty : row.Field <string>("custom_selector");
            entity.custCode          = row.IsNull("cust_code") ? string.Empty : row.Field <string>("cust_code");
            entity.delRoute          = row.IsNull("del_route") ? string.Empty : row.Field <string>("del_route");
            entity.discount          = row.IsNull("discount") ? decimal.Zero : row.Field <decimal>("discount");
            entity.dropCube          = row.IsNull("drop_cube") ? decimal.Zero : row.Field <decimal>("drop_cube");
            entity.dropType          = row.IsNull("drop_type") ? string.Empty : row.Field <string>("drop_type");
            entity.dropWeight        = row.IsNull("drop_weight") ? decimal.Zero : row.Field <decimal>("drop_weight");
            entity.expShipDate       = row.Field <DateTime?>("exp_ship_date");
            entity.freightTerms      = row.IsNull("freight_terms") ? string.Empty : row.Field <string>("freight_terms");
            entity.guaranteedDelTime = row.IsNull("guaranteed_del_time") ? string.Empty : row.Field <string>("guaranteed_del_time");
            entity.holdReason        = row.IsNull("hold_reason") ? string.Empty : row.Field <string>("hold_reason");
            entity.hostBatch         = row.IsNull("host_batch") ? string.Empty : row.Field <string>("host_batch");
            entity.hostSelector      = row.IsNull("host_selector") ? string.Empty : row.Field <string>("host_selector");
            entity.hostSequence      = row.IsNull("host_sequence") ? 0 : row.Field <int>("host_sequence");
            entity.id            = row.IsNull("id") ? 0 : row.Field <int>("id");
            entity.international = row.Field <bool>("international");
            entity.kitBuildType  = row.IsNull("kit_build_type") ? string.Empty : row.Field <string>("kit_build_type");
            entity.lineCount     = row.IsNull("line_count") ? 0 : row.Field <int>("line_count");
            entity.lot           = row.IsNull("lot") ? string.Empty : row.Field <string>("lot");
            entity.maxDays       = row.IsNull("max_days") ? 0 : row.Field <int>("max_days");
            entity.memo          = row.IsNull("memo") ? string.Empty : row.Field <string>("memo");
            entity.order         = row.IsNull("order") ? string.Empty : row.Field <string>("order");
            entity.orderDate     = row.Field <DateTime?>("order_date");
            entity.orderStatus   = row.IsNull("order_status") ? string.Empty : row.Field <string>("order_status");
            entity.orderSuffix   = row.IsNull("order_suffix") ? string.Empty : row.Field <string>("order_suffix");
            entity.origCube      = row.IsNull("orig_cube") ? decimal.Zero : row.Field <decimal>("orig_cube");
            entity.origOrderDate = row.Field <DateTime?>("orig_order_date");
            entity.origWeight    = row.IsNull("orig_weight") ? decimal.Zero : row.Field <decimal>("orig_weight");
            entity.palletDropFl  = row.Field <bool>("pallet_drop_fl");
            entity.partial       = row.Field <bool>("partial");
            entity.payMethod     = row.IsNull("pay_method") ? string.Empty : row.Field <string>("pay_method");
            entity.printed       = row.Field <bool>("printed");
            entity.priority      = row.IsNull("priority") ? 0 : row.Field <int>("priority");
            entity.product       = row.IsNull("product") ? string.Empty : row.Field <string>("product");
            entity.productQty    = row.IsNull("product_qty") ? decimal.Zero : row.Field <decimal>("product_qty");
            entity.proNumber     = row.IsNull("pro_number") ? string.Empty : row.Field <string>("pro_number");
            entity.rateType      = row.IsNull("rate_type") ? string.Empty : row.Field <string>("rate_type");
            entity.route         = row.IsNull("route") ? string.Empty : row.Field <string>("route");
            entity.rowStatus     = row.Field <bool>("row_status");
            entity.service       = row.IsNull("service") ? string.Empty : row.Field <string>("service");
            entity.shipAddr1     = row.IsNull("ship_addr1") ? string.Empty : row.Field <string>("ship_addr1");
            entity.shipAddr2     = row.IsNull("ship_addr2") ? string.Empty : row.Field <string>("ship_addr2");
            entity.shipAddrExt1  = row.IsNull("ship_addr_ext1") ? string.Empty : row.Field <string>("ship_addr_ext1");
            entity.shipAddrExt2  = row.IsNull("ship_addr_ext2") ? string.Empty : row.Field <string>("ship_addr_ext2");
            entity.shipAddrExt3  = row.IsNull("ship_addr_ext3") ? string.Empty : row.Field <string>("ship_addr_ext3");
            entity.shipCity      = row.IsNull("ship_city") ? string.Empty : row.Field <string>("ship_city");
            entity.shipCountry   = row.IsNull("ship_country") ? string.Empty : row.Field <string>("ship_country");
            entity.shipCube      = row.IsNull("ship_cube") ? decimal.Zero : row.Field <decimal>("ship_cube");
            entity.shipCustCode  = row.IsNull("ship_cust_code") ? string.Empty : row.Field <string>("ship_cust_code");
            entity.shipDate      = row.Field <DateTime?>("ship_date");
            entity.shipName      = row.IsNull("ship_name") ? string.Empty : row.Field <string>("ship_name");
            entity.shipState     = row.IsNull("ship_state") ? string.Empty : row.Field <string>("ship_state");
            entity.shipToCode    = row.IsNull("ship_to_code") ? string.Empty : row.Field <string>("ship_to_code");
            entity.shipWeight    = row.IsNull("ship_weight") ? decimal.Zero : row.Field <decimal>("ship_weight");
            entity.shipZip       = row.IsNull("ship_zip") ? string.Empty : row.Field <string>("ship_zip");
            entity.shpByIrms     = row.Field <bool>("shp_by_irms");
            entity.slsrepin      = row.IsNull("slsrepin") ? string.Empty : row.Field <string>("slsrepin");
            entity.slsrepout     = row.IsNull("slsrepout") ? string.Empty : row.Field <string>("slsrepout");
            entity.takenby       = row.IsNull("takenby") ? string.Empty : row.Field <string>("takenby");
            entity.tax           = row.IsNull("tax") ? decimal.Zero : row.Field <decimal>("tax");
            entity.totalLineCnt  = row.IsNull("total_line_cnt") ? 0 : row.Field <int>("total_line_cnt");
            entity.totalLineQty  = row.IsNull("total_line_qty") ? decimal.Zero : row.Field <decimal>("total_line_qty");
            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.type          = row.IsNull("type") ? string.Empty : row.Field <string>("type");
            entity.whNum         = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num");
            entity.rowid         = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.calcStatus    = row.IsNull("calc_status") ? string.Empty : row.Field <string>("calc_status");
            entity.iWave         = row.IsNull("IWave") ? string.Empty : row.Field <string>("IWave");
            entity.notes         = row.IsNull("Notes") ? string.Empty : row.Field <string>("Notes");
            entity.ordId         = row.IsNull("ord_id") ? 0 : row.Field <long>("ord_id");
            entity.empNum        = row.IsNull("emp_num") ? string.Empty : row.Field <string>("emp_num");
            entity.isComments    = row.Field <bool>("is_comments");
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }