| @@ -4,6 +4,7 @@ using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using System.Data.SqlClient; | |||
| using System.Data; | |||
| using jdis_import.RESTObjects; | |||
| namespace jdis_import | |||
| { | |||
| @@ -50,22 +51,29 @@ namespace jdis_import | |||
| public static int MachineExists(string serialnumber, string connStr) | |||
| { | |||
| int? id = 0; | |||
| string sql = string.Format("Select ID from equipment where serialnumber = '{0}'", serialnumber); | |||
| using (SqlConnection conn = new SqlConnection(connStr)) | |||
| { | |||
| conn.Open(); | |||
| SqlCommand cmd = conn.CreateCommand(); | |||
| cmd.CommandText = sql; | |||
| cmd.CommandType = CommandType.Text; | |||
| id = Convert.ToInt32(cmd.ExecuteScalar()); | |||
| if (id > 0) | |||
| { | |||
| cmd.CommandText = string.Format("Select ModelID from Equipment where ID = {0}", id); | |||
| id = Convert.ToInt32(cmd.ExecuteScalar()); | |||
| } | |||
| } | |||
| return Convert.ToInt32(id); | |||
| //int? id = 0; | |||
| Dictionary<string, string> search = new Dictionary<string, string>(); | |||
| search.Add("search", serialnumber); | |||
| RESTService svc = new RESTService(); | |||
| List<Equipment> machines = svc.RestGet<Equipment>("Equipments.svc", search); | |||
| if (machines.Count > 0) return machines.LastOrDefault().ID; | |||
| else return 0; | |||
| // string sql = string.Format("Select ID from equipment where serialnumber = '{0}'", serialnumber); | |||
| // using (SqlConnection conn = new SqlConnection(connStr)) | |||
| // { | |||
| // conn.Open(); | |||
| // SqlCommand cmd = conn.CreateCommand(); | |||
| // cmd.CommandText = sql; | |||
| // cmd.CommandType = CommandType.Text; | |||
| // id = Convert.ToInt32(cmd.ExecuteScalar()); | |||
| // if (id > 0) | |||
| // { | |||
| // cmd.CommandText = string.Format("Select ModelID from Equipment where ID = {0}", id); | |||
| // id = Convert.ToInt32(cmd.ExecuteScalar()); | |||
| // } | |||
| // } | |||
| // return Convert.ToInt32(id); | |||
| } | |||
| public void Validate() | |||
| @@ -0,0 +1,60 @@ | |||
| Date 27JAN2023 08:40:05 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 53 Work Order 4316656 Seg. 01 Opn Dt 20JAN2023 | |||
| Auth by Phone 905-265-7400 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S NPL CANADA INC. Cust No. 95300952 S NPL CANADA INC. | |||
| O 1 ROYAL GATE BLVD Pur-Ord. REQ H REMIT PAYMENTS TO: | |||
| L SUITE E 2ND FLOOR P-% 0.0 L-% 0.0 I BRANDT 1655 BRITANIA RD, | |||
| D VAUGHAN, ON L4L 8Z7 P MISSISSAUGA, ON L4W 1 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 310SL 1T0310SLTNF417281 20308 .0 F | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 500 HR PM | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: MISPM2 T | |||
| PROMISE DATE: 30JAN2023 T | |||
| SPECIAL INSTRUCTIONS: FINCH AT MILADY TORONTO AT AIRPORT T | |||
| BLACK CAR T | |||
| CONTACT: JODY LANGDON 905-693-5449 T | |||
| EMAIL: MAHMAD@NPLCANADA.CA T | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| FIELD SERVICE TRAVEL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,60 @@ | |||
| Date 27JAN2023 11:23:49 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 53 Work Order 4316656 Seg. 01 Opn Dt 20JAN2023 | |||
| Auth by Phone 905-265-7400 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S NPL CANADA INC. Cust No. 95300952 S NPL CANADA INC. | |||
| O 1 ROYAL GATE BLVD Pur-Ord. REQ H REMIT PAYMENTS TO: | |||
| L SUITE E 2ND FLOOR P-% 0.0 L-% 0.0 I BRANDT 1655 BRITANIA RD, | |||
| D VAUGHAN, ON L4L 8Z7 P MISSISSAUGA, ON L4W 1 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 310SL 1T0310SLTNF417281 20308 .0 F | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 500 HR PM | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: MISPM2 T | |||
| PROMISE DATE: 30JAN2023 T | |||
| SPECIAL INSTRUCTIONS: FINCH @MILADY TORONTO AIRPORT BLK CAR T | |||
| CONTACT: JODY LANGDON 905-693-5449 T | |||
| EMAIL: MAHMAD@NPLCANADA.CA T | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| FIELD SERVICE TRAVEL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,61 @@ | |||
| Date 24JAN2023 13:54:05 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 48 Work Order 3395086 Seg. 01 Opn Dt 24JAN2023 | |||
| Auth by ADRIAN GREENE Phone 204-663-0064 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S BIRD'S HILL GRAVEL & STON Cust No. 302312 S | |||
| O 1 TERRACON PL Pur-Ord. REQUIRED H NO PARTS ON ACCOUNT!! | |||
| L P-% 0.0 L-% 0.0 I USE , C.P.B. equipment | |||
| D WINNIPEG, MB R2J 4B3 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 844L 1DW844LXJNL714877 L71 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0302 Lbr Tx-0302 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 500 HR SERVICE | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: WINPM1 T | |||
| PROMISE DATE: 26JAN2023 T | |||
| SPECIAL INSTRUCTIONS: TBD T | |||
| CONTACT: ADRIAN GREENE 604-777-2233 T | |||
| EMAIL: AGREENE@GLACIALAGG.CA T | |||
| 1 1 RE572785 OIL FILTER XY 145.63 .00 | |||
| 1 1 RE532952 FILTER ELEMXY 183.43 .00 | |||
| 1 1 DZ112918 FILTER ELEMXY 226.86 .00 | |||
| 1 1 AM39653 OIL FILTER XY 19.39 .00 | |||
| 6 6 AT346594 FLUID KIT XY 52.14 .00 | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PM SERVICE CALL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| INITIAL 500HR + MISC ITEMS NOT COVERED BY PM INTERVAL | |||
| 2 2 AT489922 FILTER ELEMXY 206.08 .00 | |||
| 1 1 AT311066 AIR FILTER XY 279.52 .00 | |||
| 1 1 AT311067 AIR FILTER XY 139.13 .00 | |||
| 1 1 AT191102 AIR FILTER XY 30.89 .00 | |||
| 1 1 AT307501 AIR FILTER XY 25.41 .00 | |||
| SEG # 03 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Backordered Parts 1,775.26 * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,109 @@ | |||
| Date 24JAN2023 14:58:16 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 48 Work Order 3381594 Seg. 01 Opn Dt 24JAN2023 | |||
| Auth by CHRIS BUNES Phone 403-255-2600 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S BURNCO ROCK PRODUCTS LTD. Cust No. 40001045 S | |||
| O 5055 11 STREET NE Pur-Ord. REQUIRED H EMAIL ALL INVOICES TO: | |||
| L P-% 0.0 L-% 0.0 I payableinvoices@burnco.co | |||
| D CALGARY, AB T2E 8N4 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 944K 1DW944KXHKF695786 L394 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0909 Lbr Tx-0909 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 600 HR SERVICE | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: CGYPM1 T | |||
| PROMISE DATE: 04FEB2023 T | |||
| SPECIAL INSTRUCTIONS: BLV PIT T | |||
| CONTACT: CHRIS BUNES 403-990-8659 T | |||
| EMAIL: CHRIS.BUNES@BURNCO.COM T | |||
| 1 1 RE572785 OIL FILTER XY 145.63 .00 | |||
| 1 1 RE539465 FILTER ELEMXY 180.50 .00 | |||
| 1 1 DZ112918 FILTER ELEMXY 226.86 .00 | |||
| 1 1 T225008 BREATHER XY 46.38 .00 | |||
| 1 1 AT386551 FILTER ELEMXY 297.18 .00 | |||
| 1 1 HXE11091 FILTER ELEMXY 313.32 .00 | |||
| 1 1 AT191102 AIR FILTER XY 30.89 .00 | |||
| 1 1 AT307501 AIR FILTER XY 25.41 .00 | |||
| 3 3 AT346594 FLUID KIT XY 52.14 .00 | |||
| 4 4 AT346594 FLUID KIT XY 52.14 .00 | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PM SERVICE CALL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| MISC ITEMS NOT COVERED BY PM INTERVAL | |||
| SEG # 03 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Date 24JAN2023 14:58:16 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 48 Work Order 3381594 Seg. 03 Opn Dt 24JAN2023 | |||
| Auth by CHRIS BUNES Phone 403-255-2600 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S BURNCO ROCK PRODUCTS LTD. Cust No. 40001045 S | |||
| O 5055 11 STREET NE Pur-Ord. REQUIRED H EMAIL ALL INVOICES TO: | |||
| L P-% 0.0 L-% 0.0 I payableinvoices@burnco.co | |||
| D CALGARY, AB T2E 8N4 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 944K 1DW944KXHKF695786 L394 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0909 Lbr Tx-0909 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Backordered Parts 1,631.15 * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,60 @@ | |||
| Date 26JAN2023 07:45:51 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 58 Work Order 4807773 Seg. 01 Opn Dt 25JAN2023 | |||
| Auth by Phone 905-335-5250 Inv Cls Dt | |||
| INTERNAL Slprn | |||
| S NELSON AGGREGATE CO. Cust No. 95800456 S NELSON AGGREGATE CO. | |||
| O 2433 2 SIDE ROAD Pur-Ord. H 2433 2 SIDE ROAD | |||
| L P-% 0.0 L-% 0.0 I | |||
| D BURLINGTON, ON L7P 0G8 P BURLINGTON, ON L7P 0G8 | |||
| G/L # 988-88-8888 Stock# 00000000 Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 844L 1DW844LXHLF704949 O-402 5417.0 F | |||
| Prt Cls-PC Lbr Cls-IIN Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| FIELD TRAVEL- ONIEDA PIT DRY LAKE RD | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: STCPM1 T | |||
| PROMISE DATE: 26JAN2023 T | |||
| SPECIAL INSTRUCTIONS: DRY LAKE RD T | |||
| CONTACT: NICK 905-335-5250 T | |||
| EMAIL: TBD T | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| 500 HOUR PM SERVICE | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,115 @@ | |||
| Date 26JAN2023 11:02:35 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 57 Work Order 4707176 Seg. 01 Opn Dt 17JAN2023 | |||
| Auth by Phone 514-494-9898 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S LES SERVICES ENVIRONNEMEN Cust No. 96100812 S LES SERVICES ENVIRONNEMEN | |||
| O 2187 MONTEE MASSON Pur-Ord. H 2187 MTEE. MASSON | |||
| L P-% 0.0 L-% 0.0 I | |||
| D LAVAL, QC H7E 4P2 P LAVAL, QC H7E 4P2 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 644K 1DW644KZTHD680377 L-6441 8537.0 H S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0606 Lbr Tx-0606 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| TRAVEL TO SITE--LAMBTON | |||
| PM INTERVAL: 1000 HR T | |||
| EMPID: LDNPM1 T | |||
| PROMISE DATE: 20JAN2023 T | |||
| SPECIAL INSTRUCTIONS: LAMBTON T | |||
| CONTACT: BRYAN T | |||
| EMAIL: HDREISE@BRANDT.CA T | |||
| 1.25 01-20 R/T 57020 TRAVEL 240.00 300.00 | |||
| 1.75 01-20 O/T 57020 TRAVEL 290.00 507.50 | |||
| 1.75- 01-20 O/T 57020 TRAVEL 290.00 507.50- | |||
| 1.00 01-20 O/T 57020 TRAVEL 290.00 290.00 | |||
| SEG # 01 TOTAL = .00 P 2.25 LH 590.00 L .00 M 590.00 T | |||
| 1000 HR SERVICE | |||
| 2 2 AH128449 HYDR 141.58 283.16 | |||
| 1 1 RE504836 OIL 38.76 38.76 | |||
| 1 1 R502513 SEAL 11.86 11.86 | |||
| 1 1 RE541922 FILT 64.21 64.21 | |||
| 1 1 RE522878 FILT 64.26 64.26 | |||
| 1 1 AT365870 FILT 82.09 82.09 | |||
| 1 1 AT223493 FUEL 21.83 21.83 | |||
| 1 1 T225008 BREA 46.38 46.38 | |||
| 1 1 AT300487 FILT 126.79 126.79 | |||
| 1 1 AT314583 FILT 79.50 79.50 | |||
| 1 1 M89679 EJEC 35.08 35.08 | |||
| 1 1 AT191102 AIR 30.89 30.89 | |||
| 1 1 AT307501 AIR 25.41 25.41 | |||
| 1 1 TY27788 SCAN 150.82 150.82 | |||
| 5 5 AT346594 FLUI 52.14 260.70 | |||
| 5 5 AT315231 TEST 8.27 41.35 | |||
| 2 2 TY26679 PLUS 226.82 453.64 | |||
| 20 20 WDF WAST .10 2.00 | |||
| 1 1 TY26992 HY-G 10.38 10.38 | |||
| 5 5 GREASE 1LB 11.44 57.20 | |||
| .50 01-18 R/T 57024 REPAIR 205.00 102.50 | |||
| 2.25 01-20 R/T 57020 FIELD 240.00 540.00 | |||
| Date 26JAN2023 11:02:35 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 57 Work Order 4707176 Seg. 02 Opn Dt 17JAN2023 | |||
| Auth by Phone 514-494-9898 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S LES SERVICES ENVIRONNEMEN Cust No. 96100812 S LES SERVICES ENVIRONNEMEN | |||
| O 2187 MONTEE MASSON Pur-Ord. H 2187 MTEE. MASSON | |||
| L P-% 0.0 L-% 0.0 I | |||
| D LAVAL, QC H7E 4P2 P LAVAL, QC H7E 4P2 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 644K 1DW644KZTHD680377 L-6441 8537.0 H S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0606 Lbr Tx-0606 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 2.25- 01-20 R/T 57020 FIELD 240.00 540.00- | |||
| 1.50 01-20 R/T 57020 FIELD 240.00 360.00 | |||
| SEG # 02 TOTAL = 1,886.31 P 2.00 LH 462.50 L .00 M 2,348.81 T | |||
| INSTALL WIPER MOTOR - PART SUPPLIED BY CUSTOMER | |||
| 1.25 01-20 R/T 57020 FIELD 240.00 300.00 | |||
| .25 01-20 O/T 57020 FIELD 290.00 72.50 | |||
| .75 01-20 R/T 57020 FIELD 240.00 180.00 | |||
| 1.25- 01-20 R/T 57020 FIELD 240.00 300.00- | |||
| SEG # 03 TOTAL = .00 P 1.00 LH 252.50 L .00 M 252.50 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * Non-Taxable Parts 1,886.31 * | |||
| * Total Labor 1,305.00 * | |||
| * Non-Taxable 1,305.00 * | |||
| * Misc Charges .00 * | |||
| * GST/HST 414.88 * | |||
| * Sales Tax .00 * | |||
| * (Carbon Tax Surcharge will be added) * | |||
| * TOTAL DUE > 3,606.19 * | |||
| **************************************** | |||
| @@ -0,0 +1,111 @@ | |||
| Date 27JAN2023 10:33:05 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 48 Work Order 3371567 Seg. 01 Opn Dt 27JAN2023 | |||
| Auth by MATT MACDOUGALL Phone 604-520-5909 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S MATCON EXCAVATION AND SHO Cust No. 14003746 S | |||
| O 2208 HARTLEY AVE Pur-Ord. H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D COQUITLAM, BC V2K 6X3 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 524L 1DW524LZVKF700632 019001 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 2000 HR SERVICE | |||
| PM INTERVAL: 2000 HR T | |||
| EMPID: SRYPM1 T | |||
| PROMISE DATE: 28JAN2023 T | |||
| SPECIAL INSTRUCTIONS: AT THE BRANDT SHOP T | |||
| CONTACT: MATT MACDOUGALL T | |||
| EMAIL: MATTM@MATCON.CA T | |||
| 1 1 RE539279 OIL FILTER XY 49.50 .00 | |||
| 1 1 R502513 SEAL XY 11.86 .00 | |||
| 1 1 DZ115391 FILTER ELEMXY 75.38 .00 | |||
| 1 1 DZ115392 FILTER ELEMXY 83.19 .00 | |||
| 2 2 AT367635 FILTER ELEMXY 200.71 .00 | |||
| 1 1 M89679 EJECTOR XY 35.08 .00 | |||
| 5 5 AT346594 FLUID KIT XY 52.14 .00 | |||
| 1 1 AM39653 OIL FILTER 19.39 19.39 | |||
| 1 1 AT468647 OIL FILTER 104.65 104.65 | |||
| SEG # 01 TOTAL = 124.04 P .00 LH .00 L .00 M 124.04 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PM SERVICE CALL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| MISC ITEMS NOT COVERED BY PM INTERVAL | |||
| 1 1 AT178516 FILTER ELEMXY 112.96 .00 | |||
| 1 1 AT178517 FILTER ELEMXY 91.61 .00 | |||
| 1 1 AT191102 AIR FILTER XY 30.89 .00 | |||
| 1 1 AT307501 AIR FILTER XY 25.41 .00 | |||
| SEG # 03 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Date 27JAN2023 10:33:05 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 48 Work Order 3371567 Seg. 03 Opn Dt 27JAN2023 | |||
| Auth by MATT MACDOUGALL Phone 604-520-5909 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S MATCON EXCAVATION AND SHO Cust No. 14003746 S | |||
| O 2208 HARTLEY AVE Pur-Ord. H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D COQUITLAM, BC V2K 6X3 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 524L 1DW524LZVKF700632 019001 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * Non-Taxable Parts 124.04 * | |||
| * Backordered Parts 1,178.00 * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * GST/HST 6.20 * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > 130.24 * | |||
| **************************************** | |||
| @@ -9,6 +9,7 @@ using System.Data; | |||
| using System.Data.SqlClient; | |||
| using System.Reflection; | |||
| using jdis_import.RESTObjects; | |||
| using System.Linq; | |||
| /* | |||
| Secret Value up-8Q~y46~JyQZjJlsAJ-zpXpglpmuPIJ1Gx3a2O | |||
| @@ -22,6 +23,13 @@ namespace jdis_import | |||
| { | |||
| class Program | |||
| { | |||
| private static bool _runAPI = true; | |||
| private static RESTService _rservice; | |||
| private static List<User> _users; | |||
| private static Priority _priority; | |||
| private static Reason _reason; | |||
| private static Status _status; | |||
| private static List<Equipment> _machines; | |||
| private static List<Customer> _customers; | |||
| private static List<Make> _makes; | |||
| private static List<Product> _products; | |||
| @@ -34,28 +42,227 @@ namespace jdis_import | |||
| private static string _workOrderNumber = string.Empty; | |||
| private static List<string> _sqlMessages = new List<string>(); | |||
| private static bool _newMachine = false; | |||
| private static bool _newMake = false; | |||
| private static bool _newModel = false; | |||
| private static bool _newCustomer = false; | |||
| private static bool _quoted = false; | |||
| public static string ExeDir { get { return _exeDir; } } | |||
| private static Dictionary<string, string> _keys = new Dictionary<string, string>() { { "SecretV", "up-8Q~y46~JyQZjJlsAJ-zpXpglpmuPIJ1Gx3a2O" }, { "SecretID", "cba04a6c-a233-4646-909b-b50921edbe1c" }, { "ObjectId", "c7647074-edb6-4e8e-8a01-a1ed924fdae9" }, { "TenentID", "1fd06c96-d3a4-45e9-9ed7-bcecb394d277" }, { "AppID", "489776b1-ee79-4b14-bc44-9f6bf47332db" } }; | |||
| public static Dictionary<string, int> InspectionType; | |||
| private static Customer CreateNewCustomer(CustomerImport c, ToDo todo) | |||
| { | |||
| Customer cust = new Customer(); | |||
| cust.Name = c.Name; | |||
| cust.Address = c.Addr1; | |||
| cust.Address2 = c.Addr2; | |||
| cust.City = c.City; | |||
| cust.State = c.State; | |||
| cust.CreateDate = DateTime.Now; | |||
| cust.CreateUserID = -1; | |||
| cust.UpdateDate = DateTime.Now; | |||
| cust.UpdateUserID = -1; | |||
| cust.IsActive = true; | |||
| cust.Number = c.Number; | |||
| cust.ZipCode = c.Zip; | |||
| string json = Serialize.ToJson<Customer>(cust); | |||
| cust = _rservice.PostRest<Customer>(json, "customers.svc"); | |||
| return cust; | |||
| } | |||
| private static Model CreateNewModel(Product defaultP, EquipmentImport eq, ToDo todo) | |||
| { | |||
| Model mdl = new Model(); | |||
| //Find the Make and assign the default Product | |||
| mdl.Name = eq.Model.Trim(); | |||
| mdl.IsActive = true; | |||
| mdl.CreateDate = DateTime.Now; | |||
| mdl.CreateUserID = -1; | |||
| mdl.UpdateDate = DateTime.Now; ; | |||
| mdl.UpdateUserID = -1; | |||
| mdl.Product = defaultP; | |||
| Make mk = (from x in _makes where x.Name.Trim() == eq.Make.Trim() select x).FirstOrDefault(); | |||
| if (mk == null) | |||
| { | |||
| //Create new Make | |||
| mk.Name = eq.Make.Trim(); | |||
| mk.CreateDate = DateTime.Now; | |||
| mk.CreateUserID = -1; | |||
| mk.UpdateDate = DateTime.Now; | |||
| mk.UpdateUserID = -1; | |||
| mk.IsActive = true; | |||
| mk.Description = eq.Make.Trim(); | |||
| string mkJson = Serialize.ToJson<Make>(mk); | |||
| mk = _rservice.PostRest<Make>(mkJson, "makes.svc"); | |||
| } | |||
| mdl.Make = mk; | |||
| string json = Serialize.ToJson<Model>(mdl); | |||
| mdl = _rservice.PostRest<Model>(json, "models.svc"); | |||
| return mdl; | |||
| } | |||
| private static Equipment CreateNewMachine(EquipmentImport eq, Model mdl, Customer cust, ToDo todo) | |||
| { | |||
| Equipment newMachine = new Equipment(); | |||
| newMachine.Model = mdl; | |||
| newMachine.Make = mdl.Make; | |||
| newMachine.Product = mdl.Product; | |||
| newMachine.BarcodeID = null; | |||
| newMachine.CreateDate = DateTime.Now; | |||
| newMachine.UpdateDate = DateTime.Now; | |||
| newMachine.UpateUserID = -1; | |||
| newMachine.CreateUserID = -1; | |||
| newMachine.Description = eq.SerialNumber; | |||
| newMachine.IsActive = true; | |||
| newMachine.LastServiceDate = null; | |||
| newMachine.Location = null; | |||
| newMachine.ManufacturerYear = "2000"; | |||
| newMachine.MeterReading = eq.MeterReading; | |||
| newMachine.Number = eq.EquipmentNumber; | |||
| newMachine.Odometer = null; | |||
| newMachine.SerialNumber = eq.SerialNumber; | |||
| newMachine.Customer = cust; | |||
| string eqJson = Serialize.ToJson<Equipment>(newMachine); | |||
| newMachine = _rservice.PostRest<Equipment>(eqJson, "Equipments.svc"); | |||
| return newMachine; | |||
| } | |||
| public static void APIPush(CustomerImport c, WorkOrderImport wo, List<PartImport> parts, EquipmentImport eq, ToDo todo) | |||
| { | |||
| Equipment machine = new Equipment(); | |||
| Model mdl = _models.Find(x => x.Name.Trim() == eq.Model.Trim()); | |||
| Product defaultP = _products.Find(x => x.ID == 14); | |||
| //Customer cust = new Customer(); | |||
| Customer cust = IsNewCustomer(c.Name); | |||
| if (cust == null) | |||
| cust = CreateNewCustomer(c, todo); | |||
| List<Equipment> equipment = IsNewMachine(eq.SerialNumber); | |||
| _newMachine = equipment.Count == 0; | |||
| if (_newMachine) | |||
| { | |||
| bool isNewModel = mdl == null; | |||
| if (isNewModel) | |||
| { | |||
| string sModel = eq.Model.Trim().Substring(0, eq.Model.Length - 1); | |||
| mdl = (from x in _models where x.Name.Contains(sModel) orderby x.ID select x).LastOrDefault(); | |||
| if (mdl == null) | |||
| mdl = CreateNewModel(defaultP, eq, todo); | |||
| else | |||
| machine = CreateNewMachine(eq, mdl, cust, todo); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| machine = equipment.FindAll(x => x.SerialNumber == eq.SerialNumber).LastOrDefault(); | |||
| machine.Customer = cust; | |||
| } | |||
| //Find the Template | |||
| Template template = _templates.Find(x => x.InspectionLevel.ID == Convert.ToInt32(wo.InspectionLevel) && x.InspectionType.ID == Convert.ToInt32(wo.InspectionType) && x.Name == eq.Model); | |||
| if (template == null) | |||
| { | |||
| //Search by model prefix and get the last one | |||
| string prefix = eq.Model.Trim(); | |||
| prefix = prefix.Substring(0, prefix.Length - 1); | |||
| template = (from x in _templates where x.InspectionLevel.ID == Convert.ToInt32(wo.InspectionLevel) && x.InspectionType.ID == Convert.ToInt32(wo.InspectionType) && x.Name.Contains(prefix) orderby x.ID select x).LastOrDefault(); | |||
| if (template == null || template.ID == 0) | |||
| { | |||
| todo.Success = false; | |||
| todo.Validation = todo.Validation + " No template for this model."; | |||
| } | |||
| } | |||
| User user = _users.Find(x => x.Number == wo.TechnicianUserID.Trim()); | |||
| WorkOrder workorder = new WorkOrder(); | |||
| workorder.Number = wo.Number; | |||
| workorder.Technician = user; | |||
| workorder.Reason = _reason; | |||
| workorder.Priority = _priority; | |||
| workorder.Status = _status; | |||
| workorder.CreateDate = DateTime.Now; | |||
| workorder.CreateUserID = -1; | |||
| workorder.Equipment = machine; | |||
| workorder.Customer = cust; | |||
| workorder.MeterReading = Convert.ToDecimal(eq.MeterReading); | |||
| workorder.ScheduledStartDate = wo.OpnDt; | |||
| workorder.ScheduledEndDate = wo.OpnDt.AddDays(1d); | |||
| workorder.UpdateDate = DateTime.Now; | |||
| workorder.UpdateUserID = -1; | |||
| string woJson = Serialize.ToJson<WorkOrder>(workorder); | |||
| Console.WriteLine(woJson); | |||
| workorder = _rservice.PostRest<WorkOrder>(woJson, "workorders.svc"); | |||
| if (template == null || template.ID == 0) | |||
| { | |||
| todo.Validation = todo.Validation + Environment.NewLine + string.Format("Work Order {0} was created but there is no template matching model # {1}", workorder.Number, mdl.Name); | |||
| todo.Success = false; | |||
| } | |||
| else | |||
| { | |||
| Dictionary<string, string> tps = new Dictionary<string, string>(); | |||
| tps.Add("create", string.Format("{0}/{1}/{2}", template.ID, workorder.ID, -1)); | |||
| Inspection i = _rservice.RestGet<Inspection>(true, "inspections.svc", tps); | |||
| tps["create"] = string.Format("{0}/{1}/{2}", 1691, workorder.ID, -1); | |||
| Inspection sta = _rservice.RestGet<Inspection>(true, "inspections.svc", tps); | |||
| if (i != null && i.ID != 0) | |||
| { | |||
| todo.Success = true; | |||
| } | |||
| } | |||
| } | |||
| private static Customer IsNewCustomer(string name) | |||
| { | |||
| List<Customer> list = _customers.FindAll(x => x.Name.Trim() == name.Trim()); | |||
| if (list.Count > 1) | |||
| return list.LastOrDefault(); | |||
| else if (list.Count == 1) | |||
| return list[0]; | |||
| else return null; | |||
| } | |||
| private static List<Equipment> IsNewMachine(string serial) | |||
| { | |||
| Dictionary<string, string> ps = new Dictionary<string, string>(); | |||
| ps.Add("search", serial); | |||
| _machines = _rservice.RestGet<Equipment>("equipments.svc", ps); | |||
| return _machines; | |||
| } | |||
| private static void ListsAndDefaults() | |||
| { | |||
| _rservice = new RESTService(); | |||
| _customers = _rservice.RestGet<Customer>("customers.svc"); | |||
| _makes = _rservice.RestGet<Make>("makes.svc"); | |||
| _products = _rservice.RestGet<Product>("products.svc"); | |||
| _models = _rservice.RestGet<Model>("models.svc"); | |||
| _inspectionTypes = _rservice.RestGet<InspectionType>("inspectionTypes.svc"); | |||
| _templates = _rservice.RestGet<Template>("templates.svc"); | |||
| _users = _rservice.RestGet<User>("users.svc"); | |||
| _status = new Status(); | |||
| _status.ID = 1; | |||
| _status.Name = "Open"; | |||
| _priority = new Priority(); | |||
| _priority.ID = 3; | |||
| _priority.Name = "Medium"; | |||
| _reason = new Reason(); | |||
| _reason.ID = 9; | |||
| _reason.Name = "Cust. Request"; | |||
| _reason.IsActive = true; | |||
| _reason.CreateDate = new DateTime(2013, 10, 1, 9, 23, 7); | |||
| _reason.CreateUserID = -1; | |||
| _reason.UpdateDate = new DateTime(2013, 10, 1, 9, 23, 7); | |||
| _reason.UpdateUserID = -1; | |||
| } | |||
| static async System.Threading.Tasks.Task Main(string[] args) | |||
| { | |||
| RESTService rservice = new RESTService(); | |||
| _customers = rservice.RestGet<Customer>("customers.svc"); | |||
| _makes = rservice.RestGet<Make>("makes.svc"); | |||
| _products = rservice.RestGet<Product>("products.svc"); | |||
| _models = rservice.RestGet<Model>("models.svc"); | |||
| _inspectionTypes = rservice.RestGet<InspectionType>("inspectionTypes.svc"); | |||
| _templates = rservice.RestGet<Template>("templates.svc"); | |||
| ListsAndDefaults(); | |||
| Console.WriteLine("Web APIs have loaded."); | |||
| _exeDir = Environment.CurrentDirectory; | |||
| SetupDirectories(); | |||
| List<ToDo> list = new List<ToDo>(); | |||
| var cca = ConfidentialClientApplicationBuilder | |||
| // .Create("1dff6bdb-7009-4d2a-ae0f-9f333a4f182b") | |||
| // .WithClientSecret("VOD8Q~7BI9u4ySU0saesCG87TaEtKSCya5vw6as5") | |||
| // .WithTenantId("1fd06c96-d3a4-45e9-9ed7-bcecb394d277") | |||
| .Create(_keys["AppID"]) | |||
| .WithClientSecret(_keys["SecretV"]) | |||
| .WithTenantId(_keys["TenentID"]) | |||
| @@ -72,8 +279,7 @@ namespace jdis_import | |||
| var ewsClient = new ExchangeService(); | |||
| ewsClient.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx"); | |||
| ewsClient.Credentials = new OAuthCredentials(authResult.AccessToken); | |||
| ewsClient.ImpersonatedUserId = | |||
| new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "cmobile@prelub.com"); | |||
| ewsClient.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "cmobile@prelub.com"); | |||
| Mailbox mb = new Mailbox("connexionmobile@rpmindustries.org"); | |||
| FolderId fid = new FolderId(WellKnownFolderName.Inbox, mb); | |||
| List<SearchFilter> searchFilterCollection = new List<SearchFilter>(); | |||
| @@ -120,9 +326,7 @@ namespace jdis_import | |||
| Console.WriteLine("Beginning Import."); | |||
| foreach (ToDo import in list) | |||
| { | |||
| //System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; | |||
| //Start Importing | |||
| BeginImport(import); | |||
| GetInspectionTypes(); | |||
| ReadFile(import); | |||
| @@ -133,23 +337,23 @@ namespace jdis_import | |||
| string body = "JDIS File: {0} Work Order:{1} {2}"; | |||
| if (sendMsg.Success) | |||
| { | |||
| body = string.Format(body, sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1).Trim(), sendMsg.WorkOrder, "Was Imported Successfully"); | |||
| body = string.Format(body, sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1).Trim(), sendMsg.WorkOrderNumber, "Was Imported Successfully"); | |||
| } | |||
| else | |||
| { | |||
| body = string.Format(body, sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1).Trim(), sendMsg.WorkOrder, string.Format("Had Errors while importing: {0}", sendMsg.Validation)); | |||
| body = string.Format(body, sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1).Trim(), sendMsg.WorkOrderNumber, string.Format("Had Errors while importing: {0}", sendMsg.Validation)); | |||
| msgToSend.Attachments.AddFileAttachment(Path.Combine(_exeDir, sendMsg.FileName)); | |||
| } | |||
| msgToSend.Subject = sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1); | |||
| string fileNameOnly = sendMsg.FileName.Substring(sendMsg.FileName.LastIndexOf("/") + 1); | |||
| msgToSend.Subject = fileNameOnly; | |||
| msgToSend.ToRecipients.Add(new EmailAddress(sendMsg.Sender)); | |||
| msgToSend.CcRecipients.Add(new EmailAddress("mcarman@rpmindustries.com")); | |||
| msgToSend.Body = body; | |||
| msgToSend.SendAndSaveCopy(); | |||
| string pathToFile = Path.Combine(_exeDir, sendMsg.FileName); | |||
| if (sendMsg.Success) File.Move(pathToFile, Path.Combine(_exeDir, "Success", sendMsg.FileName)); | |||
| else File.Move(sendMsg.FileName, Path.Combine(_exeDir, "Fail", sendMsg.FileName)); | |||
| if (sendMsg.Success) File.Move(pathToFile, Path.Combine(_exeDir, "Success", fileNameOnly)); | |||
| else File.Move(sendMsg.FileName, Path.Combine(_exeDir, "Fail", fileNameOnly)); | |||
| } | |||
| } | |||
| catch (MsalException ex) | |||
| @@ -189,7 +393,15 @@ namespace jdis_import | |||
| } | |||
| public static void GetInspectionTypes() | |||
| { | |||
| List<InspectionType> list = _rservice.RestGet<InspectionType>("inspectiontypes.svc"); | |||
| InspectionType = new Dictionary<string, int>(); | |||
| foreach (InspectionType t in list) | |||
| { | |||
| InspectionType.Add(t.Name, t.ID); | |||
| } | |||
| /* | |||
| SqlConnection con = new SqlConnection("Data Source=192.168.0.7;Initial Catalog=Connexion_Brandt;User ID=mobilepmuser;Password=data4techs;Encrypt=No;TrustServerCertificate=true;Persist Security Info=True;"); | |||
| con.Open(); | |||
| SqlCommand cmd = con.CreateCommand(); | |||
| @@ -208,6 +420,7 @@ namespace jdis_import | |||
| cmd.Dispose(); | |||
| con.Close(); | |||
| con.Dispose(); | |||
| */ | |||
| } | |||
| private static string frmtString | |||
| @@ -522,7 +735,7 @@ namespace jdis_import | |||
| string strWONum = currentline.Substring(currentline.IndexOf("Work Order") + 10, 12); | |||
| strWONum = strWONum.Trim(); | |||
| wo.Number = strWONum; | |||
| todo.WorkOrder = strWONum; | |||
| todo.WorkOrderNumber = strWONum; | |||
| _workOrderNumber = strWONum; | |||
| string strSeg = currentline.Substring(currentline.IndexOf("Seg.") + 4, 25); | |||
| strSeg = strSeg.Trim(); | |||
| @@ -579,7 +792,7 @@ namespace jdis_import | |||
| if (!string.IsNullOrEmpty(wo.InspectionLevel)) wo.InspectionInterval = pminterval; | |||
| string strService = currentline.Substring(currentline.IndexOf(":") + 2); | |||
| strService = strService.Substring(strService.IndexOf(" ") + 1).Trim(); | |||
| strService = strService.Substring(strService.IndexOf(" ") + 1).Trim(); | |||
| strService = strService.Substring(0, strService.IndexOf(" ") + 1).Trim(); | |||
| if (strService.IndexOf(" ") > 0) | |||
| strService = strService.Substring(0, strService.IndexOf(" ")).Trim(); | |||
| if (InspectionType.ContainsKey(strService)) | |||
| @@ -661,180 +874,189 @@ namespace jdis_import | |||
| parts.Add(p); | |||
| } | |||
| static void conn_InfoMsg(object sender, SqlInfoMessageEventArgs e) | |||
| //Put API Integration here | |||
| if (_runAPI) | |||
| { | |||
| _sqlMessages.Add(e.Message); | |||
| APIPush(c, wo, parts, eq, todo); | |||
| } | |||
| foreach (PartImport prt in parts) | |||
| else | |||
| { | |||
| CSVObject obj = new CSVObject(); | |||
| obj.Address = string.Format(frmtString, c.Addr1.Trim()); | |||
| obj.Address2 = string.Format(frmtString, c.Addr2.Trim()); | |||
| obj.City = string.Format(frmtString, c.City.Trim()); | |||
| obj.State = string.Format(frmtString, c.State.Trim()); | |||
| obj.CustomerName = string.Format(frmtString, c.Name.Trim()); | |||
| obj.CustomerNumber = string.Format(frmtString, c.Number.Trim()); | |||
| obj.DBSWorkOrderNumber = string.Format(frmtString, wo.Number.Trim()); | |||
| obj.EquipmentNumber = string.Format(frmtString, eq.EquipmentNumber.Trim()); | |||
| obj.Make = string.Format(frmtString, eq.Make.Trim()); | |||
| obj.MeterReading = string.Format(frmtString, eq.MeterReading.Trim()); | |||
| obj.Model = string.Format(frmtString, eq.Model.Trim()); | |||
| obj.PartNumber = string.Format(frmtString, prt.Number.Trim()); | |||
| obj.PartNumberDescription = string.Format(frmtString, prt.Description.Trim()); | |||
| obj.Quantity = string.Format(frmtString, prt.Qty.Trim()); | |||
| obj.SegmentNumber = string.Format(frmtString, wo.Segment.Trim()); | |||
| obj.SerialNumber = string.Format(frmtString, eq.SerialNumber.Trim()); | |||
| obj.ZipCode = string.Format(frmtString, c.Zip.Trim()); | |||
| obj.CodeAndDescription = string.Format(frmtString, wo.InspectionLevel.Trim()); | |||
| obj.SpecialInstructions = specialInstructions.ToString(); | |||
| obj.CodeAndDescriptionOriginal = string.Format(frmtString, wo.CodeAndDescriptionOriginal); | |||
| obj.ContractTypeCode = string.Format(frmtString, ""); | |||
| obj.DateActualStart = string.Format(frmtString, wo.CreateDate); | |||
| obj.FamilyCode = string.Format(frmtString, ""); | |||
| obj.FamilyDescription = string.Format(frmtString, ""); | |||
| obj.JobSiteContactName = string.Format(frmtString, ""); | |||
| obj.JobSiteContactPhone = string.Format(frmtString, ""); | |||
| obj.LastServiceDate = string.Format(frmtString, ""); | |||
| obj.PriorityCode = string.Format(frmtString, ""); | |||
| obj.ReferenceDocNumber = string.Format(frmtString, ""); | |||
| obj.ServiceTech = string.Format(frmtString, wo.TechnicianUserID); | |||
| obj.StoreDescription = string.Format(frmtString, ""); | |||
| obj.Store = string.Format(frmtString, ""); | |||
| obj.TechName = string.Format(frmtString, ""); | |||
| obj.Year = string.Format(frmtString, ""); | |||
| obj.ScheduledStartDate = string.Format(frmtString, wo.ScheduledStartDate.ToString("yyyy-MM-dd hh:mm:ss")); | |||
| obj.InspectionType = string.Format(frmtString, wo.InspectionType.ToString()); | |||
| obj.Validate(); | |||
| if (string.IsNullOrEmpty(obj.SerialNumber)) | |||
| static void conn_InfoMsg(object sender, SqlInfoMessageEventArgs e) | |||
| { | |||
| exceptions.Add(obj); | |||
| //throw new ApplicationException("Serial Number is missing."); | |||
| _sqlMessages.Add(e.Message); | |||
| } | |||
| else list.Add(obj); | |||
| if (list.Count == 0) | |||
| foreach (PartImport prt in parts) | |||
| { | |||
| StringBuilder sbException = new StringBuilder(); | |||
| foreach (CSVObject csvobj in exceptions) | |||
| foreach (PropertyInfo pi in csvobj.GetType().GetProperties()) | |||
| { | |||
| sbException.AppendLine(string.Format("{0}: {1}", pi.Name, pi.GetValue(csvobj, null))); | |||
| } | |||
| throw new ApplicationException(string.Format("Object Validation Error\r\n{0}", sbException.ToString())); | |||
| CSVObject obj = new CSVObject(); | |||
| obj.Address = string.Format(frmtString, c.Addr1.Trim()); | |||
| obj.Address2 = string.Format(frmtString, c.Addr2.Trim()); | |||
| obj.City = string.Format(frmtString, c.City.Trim()); | |||
| obj.State = string.Format(frmtString, c.State.Trim()); | |||
| obj.CustomerName = string.Format(frmtString, c.Name.Trim()); | |||
| obj.CustomerNumber = string.Format(frmtString, c.Number.Trim()); | |||
| obj.DBSWorkOrderNumber = string.Format(frmtString, wo.Number.Trim()); | |||
| obj.EquipmentNumber = string.Format(frmtString, eq.EquipmentNumber.Trim()); | |||
| obj.Make = string.Format(frmtString, eq.Make.Trim()); | |||
| obj.MeterReading = string.Format(frmtString, eq.MeterReading.Trim()); | |||
| obj.Model = string.Format(frmtString, eq.Model.Trim()); | |||
| obj.PartNumber = string.Format(frmtString, prt.Number.Trim()); | |||
| obj.PartNumberDescription = string.Format(frmtString, prt.Description.Trim()); | |||
| obj.Quantity = string.Format(frmtString, prt.Qty.Trim()); | |||
| obj.SegmentNumber = string.Format(frmtString, wo.Segment.Trim()); | |||
| obj.SerialNumber = string.Format(frmtString, eq.SerialNumber.Trim()); | |||
| obj.ZipCode = string.Format(frmtString, c.Zip.Trim()); | |||
| obj.CodeAndDescription = string.Format(frmtString, wo.InspectionLevel.Trim()); | |||
| obj.SpecialInstructions = specialInstructions.ToString(); | |||
| obj.CodeAndDescriptionOriginal = string.Format(frmtString, wo.CodeAndDescriptionOriginal); | |||
| obj.ContractTypeCode = string.Format(frmtString, ""); | |||
| obj.DateActualStart = string.Format(frmtString, wo.CreateDate); | |||
| obj.FamilyCode = string.Format(frmtString, ""); | |||
| obj.FamilyDescription = string.Format(frmtString, ""); | |||
| obj.JobSiteContactName = string.Format(frmtString, ""); | |||
| obj.JobSiteContactPhone = string.Format(frmtString, ""); | |||
| obj.LastServiceDate = string.Format(frmtString, ""); | |||
| obj.PriorityCode = string.Format(frmtString, ""); | |||
| obj.ReferenceDocNumber = string.Format(frmtString, ""); | |||
| obj.ServiceTech = string.Format(frmtString, wo.TechnicianUserID); | |||
| obj.StoreDescription = string.Format(frmtString, ""); | |||
| obj.Store = string.Format(frmtString, ""); | |||
| obj.TechName = string.Format(frmtString, ""); | |||
| obj.Year = string.Format(frmtString, ""); | |||
| obj.ScheduledStartDate = string.Format(frmtString, wo.ScheduledStartDate.ToString("yyyy-MM-dd hh:mm:ss")); | |||
| obj.InspectionType = string.Format(frmtString, wo.InspectionType.ToString()); | |||
| obj.Validate(); | |||
| if (string.IsNullOrEmpty(obj.SerialNumber)) | |||
| { | |||
| exceptions.Add(obj); | |||
| //throw new ApplicationException("Serial Number is missing."); | |||
| } | |||
| else list.Add(obj); | |||
| if (list.Count == 0) | |||
| { | |||
| StringBuilder sbException = new StringBuilder(); | |||
| foreach (CSVObject csvobj in exceptions) | |||
| foreach (PropertyInfo pi in csvobj.GetType().GetProperties()) | |||
| { | |||
| sbException.AppendLine(string.Format("{0}: {1}", pi.Name, pi.GetValue(csvobj, null))); | |||
| } | |||
| throw new ApplicationException(string.Format("Object Validation Error\r\n{0}", sbException.ToString())); | |||
| } | |||
| } | |||
| } | |||
| filemove = Path.Combine("Success", file);// string.Format("{0}\\{1}\\{2}", _currentDir, _settings["SUCCESSDIR"], file); | |||
| try | |||
| { | |||
| SqlConnection conn = new SqlConnection(_connection); | |||
| conn.Open(); | |||
| string errorstr = CSVObject.WriteToDB(list, conn); | |||
| conn.Close(); | |||
| conn.Dispose(); | |||
| if (!string.IsNullOrEmpty(errorstr)) throw new ApplicationException(errorstr); | |||
| SqlCommand cmd = new SqlCommand("usp_DoImport", new SqlConnection(_connection)); | |||
| cmd.CommandTimeout = 0; | |||
| SqlParameter sqlReturn = cmd.Parameters.Add("@b", SqlDbType.Int); | |||
| sqlReturn.Direction = ParameterDirection.ReturnValue; | |||
| cmd.Connection.Open(); | |||
| cmd.Connection.InfoMessage += new SqlInfoMessageEventHandler(conn_InfoMsg); | |||
| cmd.Connection.FireInfoMessageEventOnUserErrors = true; | |||
| cmd.CommandType = CommandType.StoredProcedure; | |||
| cmd.ExecuteNonQuery(); | |||
| if (Convert.ToInt32(cmd.Parameters["@b"].Value) != 0) | |||
| throw new Exception("Error happend in the do import"); | |||
| cmd.Connection.Close(); | |||
| cmd.Dispose(); | |||
| conn.Dispose(); | |||
| SqlCommand delcmd = new SqlCommand("Delete Results_Brandt", new SqlConnection(_connection)); | |||
| delcmd.CommandTimeout = 0; | |||
| delcmd.Connection.Open(); | |||
| delcmd.CommandType = CommandType.Text; | |||
| filemove = Path.Combine("Success", file);// string.Format("{0}\\{1}\\{2}", _currentDir, _settings["SUCCESSDIR"], file); | |||
| try | |||
| { | |||
| SqlConnection conn = new SqlConnection(_connection); | |||
| conn.Open(); | |||
| string errorstr = CSVObject.WriteToDB(list, conn); | |||
| conn.Close(); | |||
| conn.Dispose(); | |||
| if (!string.IsNullOrEmpty(errorstr)) throw new ApplicationException(errorstr); | |||
| SqlCommand cmd = new SqlCommand("usp_DoImport", new SqlConnection(_connection)); | |||
| cmd.CommandTimeout = 0; | |||
| SqlParameter sqlReturn = cmd.Parameters.Add("@b", SqlDbType.Int); | |||
| sqlReturn.Direction = ParameterDirection.ReturnValue; | |||
| cmd.Connection.Open(); | |||
| cmd.Connection.InfoMessage += new SqlInfoMessageEventHandler(conn_InfoMsg); | |||
| cmd.Connection.FireInfoMessageEventOnUserErrors = true; | |||
| cmd.CommandType = CommandType.StoredProcedure; | |||
| cmd.ExecuteNonQuery(); | |||
| if (Convert.ToInt32(cmd.Parameters["@b"].Value) != 0) | |||
| throw new Exception("Error happend in the do import"); | |||
| cmd.Connection.Close(); | |||
| cmd.Dispose(); | |||
| conn.Dispose(); | |||
| SqlCommand delcmd = new SqlCommand("Delete Results_Brandt", new SqlConnection(_connection)); | |||
| delcmd.CommandTimeout = 0; | |||
| delcmd.Connection.Open(); | |||
| delcmd.CommandType = CommandType.Text; | |||
| try | |||
| { | |||
| delcmd.ExecuteNonQuery(); | |||
| delcmd.ExecuteNonQuery(); | |||
| } | |||
| catch (Exception dex) | |||
| { | |||
| throw new Exception(dex.Message); | |||
| } | |||
| delcmd.Connection.Close(); | |||
| delcmd.Dispose(); | |||
| } | |||
| catch (Exception dex) | |||
| catch (Exception exSql) | |||
| { | |||
| throw new Exception(dex.Message); | |||
| } | |||
| delcmd.Connection.Close(); | |||
| delcmd.Dispose(); | |||
| } | |||
| catch (Exception exSql) | |||
| { | |||
| string msg = exSql.Message; | |||
| string logmsg = string.Format("Date: {0} Error: {1}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), exSql.Message); | |||
| WriteToLog(logmsg); | |||
| todo.Validation = exSql.Message + " " + _workOrderNumber; | |||
| filemove = Path.Combine("Fail", todo.FileName); | |||
| //File.Move(todo.FileName, filemove); | |||
| //MailSvc.SendResponse(msg, _workOrderNumber); | |||
| string msg = exSql.Message; | |||
| string logmsg = string.Format("Date: {0} Error: {1}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), exSql.Message); | |||
| WriteToLog(logmsg); | |||
| todo.Validation = exSql.Message + " " + _workOrderNumber; | |||
| filemove = Path.Combine("Fail", todo.FileName); | |||
| //File.Move(todo.FileName, filemove); | |||
| //MailSvc.SendResponse(msg, _workOrderNumber); | |||
| } | |||
| Console.WriteLine("Line 584: " + filemove); | |||
| if (File.Exists(filemove)) File.Delete(filemove); | |||
| //File.Move(file, filemove); | |||
| if (_log) | |||
| { | |||
| string successmsg = string.Format("Success Date: {0} File Name: {1} Work Order #: {2}{3}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), file, _workOrderNumber, "********************************"); | |||
| WriteToLog(successmsg); | |||
| if (exceptions.Count > 0) | |||
| } | |||
| Console.WriteLine("Line 584: " + filemove); | |||
| if (File.Exists(filemove)) File.Delete(filemove); | |||
| //File.Move(file, filemove); | |||
| if (_log) | |||
| { | |||
| foreach (CSVObject csvobj in exceptions) | |||
| string successmsg = string.Format("Success Date: {0} File Name: {1} Work Order #: {2}{3}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), file, _workOrderNumber, "********************************"); | |||
| WriteToLog(successmsg); | |||
| if (exceptions.Count > 0) | |||
| { | |||
| foreach (CSVObject csvobj in exceptions) | |||
| { | |||
| string csvmsg = string.Format("Null Serial# Exception Date: {0} File Name: {1} Work Order #: {2}{3}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), file, _workOrderNumber, "********************************"); | |||
| WriteToLog(csvmsg); | |||
| } | |||
| } | |||
| if (_sqlMessages.Count > 0) | |||
| { | |||
| string csvmsg = string.Format("Null Serial# Exception Date: {0} File Name: {1} Work Order #: {2}{3}", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"), file, _workOrderNumber, "********************************"); | |||
| WriteToLog(csvmsg); | |||
| WriteToLog("***********************SQL Messages************************"); | |||
| foreach (string sqlmessg in _sqlMessages) | |||
| WriteToLog(sqlmessg); | |||
| WriteToLog("*********************End SQL Messages**********************"); | |||
| } | |||
| } | |||
| if (_sqlMessages.Count > 0) | |||
| using (SqlConnection doublecheck = new SqlConnection(_connection)) | |||
| { | |||
| WriteToLog("***********************SQL Messages************************"); | |||
| foreach (string sqlmessg in _sqlMessages) | |||
| WriteToLog(sqlmessg); | |||
| WriteToLog("*********************End SQL Messages**********************"); | |||
| } | |||
| } | |||
| using (SqlConnection doublecheck = new SqlConnection(_connection)) | |||
| { | |||
| SqlCommand cmddoublecheck = doublecheck.CreateCommand(); | |||
| cmddoublecheck.Connection.Open(); | |||
| cmddoublecheck.CommandTimeout = 0; | |||
| cmddoublecheck.CommandText = string.Format("Select MAX(ID) from WorkOrder where Number = '{0}'", wo.Number); | |||
| cmddoublecheck.CommandType = CommandType.Text; | |||
| int rslt = (cmddoublecheck.ExecuteScalar() == DBNull.Value ? 0 : (int)cmddoublecheck.ExecuteScalar()); | |||
| SqlCommand cmddoublecheck = doublecheck.CreateCommand(); | |||
| cmddoublecheck.Connection.Open(); | |||
| cmddoublecheck.CommandTimeout = 0; | |||
| cmddoublecheck.CommandText = string.Format("Select MAX(ID) from WorkOrder where Number = '{0}'", wo.Number); | |||
| cmddoublecheck.CommandType = CommandType.Text; | |||
| int rslt = (cmddoublecheck.ExecuteScalar() == DBNull.Value ? 0 : (int)cmddoublecheck.ExecuteScalar()); | |||
| cmddoublecheck.Dispose(); | |||
| if (rslt > 0) | |||
| { | |||
| cmddoublecheck.CommandText = string.Format("Select ID from Inspection where workorderid = {0}", rslt); | |||
| rslt = (cmddoublecheck.ExecuteScalar() == DBNull.Value ? 0 : (int)cmddoublecheck.ExecuteScalar()); | |||
| cmddoublecheck.Dispose(); | |||
| if (rslt > 0) | |||
| { | |||
| todo.Success = true; | |||
| //MailSvc.SendResponse("Work Order was imported successfully.", wo.Number); | |||
| cmddoublecheck.CommandText = string.Format("Select ID from Inspection where workorderid = {0}", rslt); | |||
| rslt = (cmddoublecheck.ExecuteScalar() == DBNull.Value ? 0 : (int)cmddoublecheck.ExecuteScalar()); | |||
| if (rslt > 0) | |||
| { | |||
| todo.Success = true; | |||
| //MailSvc.SendResponse("Work Order was imported successfully.", wo.Number); | |||
| } | |||
| else | |||
| { | |||
| //string noTemplate = string.Format("Work Order was created successfully. However, it appears there is no template for this model: {0}", eq.Model); | |||
| todo.Validation = todo.Validation + "\r\n" + string.Format("Work Order was created successfully. However, it appears there is no template for this model: {0}", eq.Model); | |||
| todo.Success = false; | |||
| } | |||
| } | |||
| else | |||
| { | |||
| //string noTemplate = string.Format("Work Order was created successfully. However, it appears there is no template for this model: {0}", eq.Model); | |||
| todo.Validation = todo.Validation + "\r\n" + string.Format("Work Order was created successfully. However, it appears there is no template for this model: {0}", eq.Model); | |||
| todo.Success = false; | |||
| todo.Validation = todo.Validation + "\r\n" + string.Format("Failed to import work order {0}", wo.Number);//) | |||
| } | |||
| //MailSvc.SendResponse(string.Format("Failed to import work order {0}.", wo.Number), wo.Number); | |||
| } | |||
| else | |||
| { | |||
| todo.Validation = todo.Validation + "\r\n" + string.Format("Failed to import work order {0}", wo.Number);//) | |||
| } | |||
| //MailSvc.SendResponse(string.Format("Failed to import work order {0}.", wo.Number), wo.Number); | |||
| } | |||
| //Console.ReadLine(); | |||
| } | |||
| catch (Exception ex) | |||
| { | |||
| @@ -895,6 +1117,7 @@ namespace jdis_import | |||
| } | |||
| } | |||
| } | |||
| public class ToDo | |||
| @@ -906,6 +1129,6 @@ namespace jdis_import | |||
| public string FileName { get; set; } | |||
| public string Validation { get; set; } | |||
| public string WorkOrder { get; set; } | |||
| public string WorkOrderNumber { get; set; } | |||
| } | |||
| } | |||
| @@ -31,6 +31,8 @@ namespace jdis_import.RESTObjects | |||
| public string Phone2 { get; set; } | |||
| [JsonProperty(PropertyName = "Fax")] | |||
| public string Fax { get; set; } | |||
| [JsonProperty(PropertyName = "ZipCode")] | |||
| public string ZipCode { get; set; } | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| public DateTime CreateDate { get; set; } | |||
| [JsonProperty(PropertyName = "CreateUserID")] | |||
| @@ -0,0 +1,59 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Equipment | |||
| { | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| public DateTime CreateDate { get; set; } | |||
| [JsonProperty(PropertyName = "CreateUserID")] | |||
| public int CreateUserID { get; set; } | |||
| [JsonProperty(PropertyName = "BarcodeID")] | |||
| public int? BarcodeID { get; set; } | |||
| [JsonProperty(PropertyName = "Description")] | |||
| public string Description { get; set; } | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "IsActive")] | |||
| public bool IsActive { get; set; } | |||
| [JsonProperty(PropertyName = "LastServiceDate")] | |||
| public DateTime? LastServiceDate { get; set; } | |||
| [JsonProperty(PropertyName = "Location")] | |||
| public string Location { get; set; } | |||
| [JsonProperty(PropertyName = "ManufacturerYear")] | |||
| public string ManufacturerYear { get; set; } | |||
| [JsonProperty(PropertyName = "MeterReading")] | |||
| public string MeterReading { get; set; } | |||
| [JsonProperty(PropertyName = "Number")] | |||
| public string Number { get; set; } | |||
| [JsonProperty(PropertyName = "Odometer")] | |||
| public string Odometer { get; set; } | |||
| [JsonProperty(PropertyName = "SerialNumber")] | |||
| public string SerialNumber { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateDate")] | |||
| public DateTime? UpdateDate { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateUserID")] | |||
| public int? UpateUserID { get; set; } | |||
| [JsonProperty(PropertyName = "Make")] | |||
| public Make Make { get; set; } | |||
| [JsonProperty(PropertyName = "MakeID")] | |||
| public int MakeID { get { return this.Make != null ? this.Make.ID : 0; } set { value = this.Make != null ? this.Make.ID : 0; } } | |||
| [JsonProperty(PropertyName = "Product")] | |||
| public Product Product { get; set; } | |||
| [JsonProperty(PropertyName = "ProductID")] | |||
| public int ProductID { get { return this.Product != null ? this.Product.ID : 0; } set { value = this.Product != null ? this.Product.ID : 0; } } | |||
| [JsonProperty(PropertyName = "Model")] | |||
| public Model Model { get; set; } | |||
| [JsonProperty(PropertyName = "ModelID")] | |||
| public int ModelID { get { return this.Model != null ? this.Model.ID : 0; } set { value = this.Model != null ? this.Model.ID : 0; } } | |||
| [JsonProperty(PropertyName = "Customer")] | |||
| public Customer Customer { get; set; } | |||
| [JsonProperty(PropertyName = "CustomerID")] | |||
| public int CustomerID { get { return this.Customer != null ? this.Customer.ID : 0; } set { value = this.Customer != null ? this.Customer.ID : 0; } } | |||
| } | |||
| } | |||
| @@ -0,0 +1,15 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Inspection | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| } | |||
| } | |||
| @@ -6,6 +6,7 @@ using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class InspectionLevel | |||
| { | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| @@ -6,6 +6,7 @@ using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class InspectionType | |||
| { | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| @@ -6,6 +6,7 @@ using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Model | |||
| { | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| @@ -0,0 +1,18 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Priority | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "Name")] | |||
| public string Name { get; set; } | |||
| } | |||
| } | |||
| @@ -6,6 +6,7 @@ using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Product | |||
| { | |||
| @@ -1,6 +1,7 @@ | |||
| using System.Globalization; | |||
| using Newtonsoft.Json; | |||
| using Newtonsoft.Json.Converters; | |||
| using System; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| @@ -41,7 +42,9 @@ namespace jdis_import.RESTObjects | |||
| { | |||
| public static T FromJson<T>(string json) | |||
| { | |||
| Console.WriteLine(json); | |||
| return JsonConvert.DeserializeObject<T>(json, Converter.Settings); | |||
| } | |||
| } | |||
| public static class Serialize | |||
| @@ -10,7 +10,7 @@ namespace jdis_import.RESTObjects | |||
| { | |||
| public class RESTService | |||
| { | |||
| private string _baseUrl = "http://servicesbrandt.rpmindustries.com:8081"; | |||
| private string _baseUrl = "https://servicesbrandt.rpmindustries.com";//:8081"; | |||
| private HttpClient _httpClient; | |||
| public RESTService() | |||
| @@ -49,10 +49,76 @@ namespace jdis_import.RESTObjects | |||
| RestResponse response = client.Execute(request); | |||
| return response.Content; | |||
| } | |||
| public List<T> RestGet<T>(string endpoint) | |||
| public T RestGet<T>(bool single, string endpoint, Dictionary<string, string> parameters = null) | |||
| { | |||
| RESTResponse<T> rest = new RESTResponse<T>(); | |||
| string url = _baseUrl + "/" + endpoint + "/"; | |||
| if (parameters != null) | |||
| { | |||
| foreach (KeyValuePair<string, string> kvp in parameters) | |||
| { | |||
| url = url + kvp.Key + "/" + kvp.Value; | |||
| } | |||
| } | |||
| RestClient client = new RestClient(url); | |||
| RestRequest request = new RestRequest(); | |||
| request.AddHeader("Accept", "application/json"); | |||
| request.Method = Method.Get; | |||
| RestResponse response = client.Execute(request); | |||
| rest = Deserialize.FromJson<RESTResponse<T>>(response.Content); | |||
| return rest.data; | |||
| } | |||
| public T PostRest<T>(string json, string endpoint) | |||
| { | |||
| RESTResponse<T> rest = new RESTResponse<T>(); | |||
| string url = _baseUrl + "/" + endpoint + "/"; | |||
| RestClient client = new RestClient(url); | |||
| Console.WriteLine(); | |||
| Console.WriteLine(); | |||
| Console.WriteLine(); | |||
| Console.WriteLine(json); | |||
| RestRequest request = new RestRequest(); | |||
| request.Method = Method.Post; | |||
| request.RequestFormat = DataFormat.Json; | |||
| request.AddBody(json); | |||
| request.AddHeader("Accept", "application/json"); | |||
| RestResponse response = client.Execute(request); | |||
| Console.WriteLine(); | |||
| Console.WriteLine(); | |||
| Console.WriteLine(response.Content); | |||
| rest = Deserialize.FromJson<RESTResponse<T>>(response.Content); | |||
| return rest.data; | |||
| } | |||
| public T PostRest<T>(string json, string endpoint, Dictionary<string, string> parameters) | |||
| { | |||
| RESTResponse<T> rest = new RESTResponse<T>(); | |||
| string url = _baseUrl + "/" + endpoint + "/"; | |||
| foreach (KeyValuePair<string, string> kvp in parameters) | |||
| { | |||
| url = url + kvp.Key + "/" + kvp.Value; | |||
| } | |||
| RestClient client = new RestClient(url); | |||
| RestRequest request = new RestRequest(url, Method.Post); | |||
| request.AddBody(json); | |||
| request.AddHeader("Accept", "application/json"); | |||
| RestResponse response = client.Execute(request); | |||
| rest = Deserialize.FromJson<RESTResponse<T>>(response.Content); | |||
| return rest.data; | |||
| } | |||
| public List<T> RestGet<T>(string endpoint, Dictionary<string, string> parameters = null) | |||
| { | |||
| RESTResponse<List<T>> rest = new RESTResponse<List<T>>(); | |||
| string url = _baseUrl + "/" + endpoint + "/"; | |||
| if (parameters != null) | |||
| { | |||
| foreach (KeyValuePair<string, string> kvp in parameters) | |||
| { | |||
| url = url + kvp.Key + "/" + kvp.Value; | |||
| } | |||
| } | |||
| RestClient client = new RestClient(url); | |||
| @@ -0,0 +1,36 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Reason | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "Name")] | |||
| public string Name { get; set; } | |||
| [JsonProperty(PropertyName = "Description")] | |||
| public string Description { get; set; } | |||
| [JsonProperty(PropertyName = "IsActive")] | |||
| public bool IsActive { get; set; } | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| public DateTime CreateDate { get; set; } | |||
| [JsonProperty(PropertyName = "CreateUserID")] | |||
| public int CreateUserID { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateDate")] | |||
| public DateTime UpdateDate { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateUserID")] | |||
| public int UpdateUserID { get; set; } | |||
| } | |||
| } | |||
| @@ -0,0 +1,18 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Status | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "Name")] | |||
| public string Name { get; set; } | |||
| } | |||
| } | |||
| @@ -6,6 +6,7 @@ using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class Template | |||
| { | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| @@ -0,0 +1,18 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class User | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "Number")] | |||
| public string Number { get; set; } | |||
| } | |||
| } | |||
| @@ -0,0 +1,112 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| using Newtonsoft.Json; | |||
| namespace jdis_import.RESTObjects | |||
| { | |||
| [JsonObject(MemberSerialization.OptIn)] | |||
| public class WorkOrder | |||
| { | |||
| [JsonProperty(PropertyName = "ID")] | |||
| public int ID { get; set; } | |||
| [JsonProperty(PropertyName = "CustomerID")] | |||
| public int CustomerID { get { return this.Customer != null ? this.Customer.ID : 0; } set { value = this.Customer != null ? this.Customer.ID : 0; } } | |||
| [JsonProperty(PropertyName = "PriorityID")] | |||
| public int PriorityID | |||
| { | |||
| get { return this.Priority != null ? this.Priority.ID : 0; } | |||
| set { value = this.Priority != null ? this.Priority.ID : 0; } | |||
| } | |||
| [JsonProperty(PropertyName = "StatusID")] | |||
| public int StatusID | |||
| { | |||
| get { return this.Status != null ? this.Status.ID : 0; } | |||
| set { value = this.Status != null ? this.Status.ID : 0; } | |||
| } | |||
| [JsonProperty(PropertyName = "EquipmentID")] | |||
| public int EquipmentID | |||
| { | |||
| get { return this.Equipment != null ? this.Equipment.ID : 0; } | |||
| set { value = this.Equipment != null ? this.Equipment.ID : 0; } | |||
| } | |||
| [JsonProperty(PropertyName = "ReasonID")] | |||
| public int? ReasonID | |||
| { | |||
| get { return this.Reason != null ? this.Reason.ID : null; } | |||
| set { value = this.Reason != null ? this.Reason.ID : null; } | |||
| } | |||
| [JsonProperty(PropertyName = "IncompleteReasonID")] | |||
| public int? IncompleteReasonID { get; set; } | |||
| [JsonProperty(PropertyName = "TechnicianUserID")] | |||
| public int TechnicianUserID | |||
| { | |||
| get { return this.Technician != null ? this.Technician.ID : 0; } | |||
| set { value = this.Technician != null ? this.Technician.ID : 0; } | |||
| } | |||
| [JsonProperty(PropertyName = "Number")] | |||
| public string Number { get; set; } | |||
| [JsonProperty(PropertyName = "MeterReading")] | |||
| public decimal? MeterReading { get; set; } | |||
| [JsonProperty(PropertyName = "Odometer")] | |||
| public decimal? Odometer { get; set; } | |||
| [JsonProperty(PropertyName = "SpecialInstructions")] | |||
| public string SpecialInstructions { get; set; } | |||
| [JsonProperty(PropertyName = "ScheduledStartDate")] | |||
| public DateTime ScheduledStartDate { get; set; } | |||
| [JsonProperty(PropertyName = "ScheduledEndDate")] | |||
| public DateTime ScheduledEndDate { get; set; } | |||
| [JsonProperty(PropertyName = "StartDate")] | |||
| public DateTime? StartDate { get; set; } | |||
| [JsonProperty(PropertyName = "EndDate")] | |||
| public DateTime? EndDate { get; set; } | |||
| [JsonProperty(PropertyName = "ApprovedDate")] | |||
| public DateTime? ApprovedDate { get; set; } | |||
| [JsonProperty(PropertyName = "CreateDate")] | |||
| public DateTime CreateDate { get; set; } | |||
| [JsonProperty(PropertyName = "CreateUserID")] | |||
| public int CreateUserID { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateDate")] | |||
| public DateTime UpdateDate { get; set; } | |||
| [JsonProperty(PropertyName = "UpdateUserID")] | |||
| public int UpdateUserID { get; set; } | |||
| [JsonProperty(PropertyName = "Customer")] | |||
| public Customer Customer { get; set; } | |||
| [JsonProperty(PropertyName = "Priority")] | |||
| public Priority Priority { get; set; } | |||
| [JsonProperty(PropertyName = "Status")] | |||
| public Status Status { get; set; } | |||
| [JsonProperty(PropertyName = "Equipment")] | |||
| public Equipment Equipment { get; set; } | |||
| [JsonProperty(PropertyName = "Reason")] | |||
| public Reason Reason { get; set; } | |||
| [JsonProperty(PropertyName = "Technician")] | |||
| public User Technician { get; set; } | |||
| } | |||
| } | |||
| @@ -0,0 +1,61 @@ | |||
| Date 26JAN2023 14:37:15 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 48 Work Order 3376917 Seg. 01 Opn Dt 26JAN2023 | |||
| Auth by MARLIN SAWATSKY Phone 403-232-6900 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S STRAD CANADA INC. Cust No. 67782552 S STRAD CANADA INC. | |||
| O ATTN: A/P 650-440 2 AVE SPur-Ord. REQUIRED H MUST HAVE PO ON ALL INVOI | |||
| L P-% 0.0 L-% 0.0 I 2974-37 AVE E | |||
| D CALGARY, AB T2P 5E9 P WHITECOURT, AB T7S 0A2 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 250G 1FF250GXHJF610787 932063 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0909 Lbr Tx-0909 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 500 HR SERVICE | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: EDMPM1 T | |||
| PROMISE DATE: 27JAN2023 T | |||
| SPECIAL INSTRUCTIONS: 2315 5A STREET NISKU AB CALL MARLIN T | |||
| PRIOR TO GOING OUT TO SITE T | |||
| CONTACT: MARLIN SAWATSKY 780-918-7849 T | |||
| EMAIL: MSAWATSKY@STRADINC.COM T | |||
| 1 1 RE539279 OIL FILTXY 49.50 .00 | |||
| 1 1 RE556406 FILTER KXY 212.53 .00 | |||
| 1 1 AT365870 FILTER EXY 82.09 .00 | |||
| 1 1 AT300487 FILTER EXY 126.79 .00 | |||
| 1 1 AT314583 FILTER EXY 79.50 .00 | |||
| 1 1 4S00686R FILTER XY 130.99 .00 | |||
| 1 1 FYA00001490R AIR FILTXY 85.37 .00 | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PM SERVICE CALL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| MISC ITEMS NOT COVERED BY PM INTERVAL | |||
| SEG # 03 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Backordered Parts 766.77 * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,115 @@ | |||
| Date 27JAN2023 08:06:04 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 58 Work Order 4807703 Seg. 01 Opn Dt 18JAN2023 | |||
| Auth by Phone 905-547-8888 Inv Cls Dt | |||
| INTERNAL Slprn | |||
| S TRIPLE M METAL LIMITED Cust No. 95800988 S TRIPLE M METAL LIMITED | |||
| O 670 STRATHEARNE AVENUE Pur-Ord. H 670 STRATHEARNE AVENUE | |||
| L P-% 0.0 L-% 0.0 I | |||
| D HAMILTON, ON L8H 7N7 P HAMILTON, ON L8H 7N7 | |||
| G/L # 988-88-8888 Stock# 00000000 Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 844L 1DW844LXHLF705700 WL-75 11224.0 F | |||
| Prt Cls-PC Lbr Cls-IIN Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| FILED TRAVEL-DOFASCO | |||
| PM INTERVAL: 1000 HR T | |||
| EMPID: STCPM1 T | |||
| PROMISE DATE: 28JAN2023 T | |||
| SPECIAL INSTRUCTIONS: DOFASCO T | |||
| CONTACT: ADAM 905-536-4551 T | |||
| EMAIL: TBD T | |||
| 2.25 01-20 R/T 58025 TRAVEL 240.00 540.00 | |||
| 2.25- 01-20 R/T 58025 TRAVEL 240.00 540.00- | |||
| .50 01-20 R/T 58025 TRAVEL 240.00 120.00 | |||
| .75 01-20 R/T 58025 TRAVEL 240.00 180.00 | |||
| SEG # 01 TOTAL = .00 P 1.25 LH 300.00 L .00 M 300.00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PREFORM 1000 HR SERVICE (PM) | |||
| 2 2 AT489922 FILTER 206.08 412.16 | |||
| 1 1 RE572785 OIL FI 145.63 145.63 | |||
| 1 1 RE539465 FILTER 180.50 180.50 | |||
| 1 1 DZ112918 FILTER 226.86 226.86 | |||
| 1 1 AT311066 AIR FI 279.52 279.52 | |||
| 1 1 AT311067 AIR FI 139.13 139.13 | |||
| 1 1 H216169 BREATH 50.48 50.48 | |||
| 40 40 245081000L 1000L 6.76 270.40 | |||
| 1 1 62841000L 1000L 10.22 10.22 | |||
| 5 5 AT346594 FLUID 52.14 260.70 | |||
| 5 5 AT315231 TEST/M 8.27 41.35 | |||
| .50 01-18 R/T 58026 FIELD 240.00 120.00 | |||
| 8.00 01-20 R/T 58025 FIELD 240.00 1920.00 | |||
| .25 01-20 O/T 58025 FIELD 290.00 72.50 | |||
| 8.00- 01-20 R/T 58025 FIELD 240.00 1920.00- | |||
| 4.50 01-20 R/T 58025 FIELD 240.00 1080.00 | |||
| 1.00 01-20 R/T 58025 FIELD 240.00 240.00 | |||
| 1.00 01-20 R/T 58025 FIELD 240.00 240.00 | |||
| 4.50- 01-20 R/T 58025 FIELD 240.00 1080.00- | |||
| .25- 01-20 O/T 58025 FIELD 290.00 72.50- | |||
| 3.25 01-20 R/T 58025 FIELD 240.00 780.00 | |||
| Date 27JAN2023 08:06:04 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 58 Work Order 4807703 Seg. 02 Opn Dt 18JAN2023 | |||
| Auth by Phone 905-547-8888 Inv Cls Dt | |||
| INTERNAL Slprn | |||
| S TRIPLE M METAL LIMITED Cust No. 95800988 S TRIPLE M METAL LIMITED | |||
| O 670 STRATHEARNE AVENUE Pur-Ord. H 670 STRATHEARNE AVENUE | |||
| L P-% 0.0 L-% 0.0 I | |||
| D HAMILTON, ON L8H 7N7 P HAMILTON, ON L8H 7N7 | |||
| G/L # 988-88-8888 Stock# 00000000 Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 844L 1DW844LXHLF705700 WL-75 11224.0 F | |||
| Prt Cls-PC Lbr Cls-IIN Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 1.75 01-20 R/T 58025 FIELD 240.00 420.00 | |||
| 1.00- 01-20 R/T 58025 FIELD 240.00 240.00- | |||
| SEG # 02 TOTAL = 2,016.95 P 6.50 LH 1,560.00 L .00 M 3,576.95 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts 2,016.95 * | |||
| * * | |||
| * Total Labor 1,860.00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax 232.62 * | |||
| * (Carbon Tax Surcharge will be added) * | |||
| * TOTAL DUE > 4,109.57 * | |||
| **************************************** | |||
| @@ -0,0 +1,60 @@ | |||
| Date 27JAN2023 08:32:23 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 53 Work Order 4316599 Seg. 01 Opn Dt 17JAN2023 | |||
| Auth by Phone 416-738-4486 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S ASTRO EXCAVATING INC. Cust No. 95301649 S ASTRO EXCAVATING INC. | |||
| O 645 CORONATION DRIVE Pur-Ord. H 645 CORONATION DRIVE | |||
| L P-% 0.0 L-% 5.0 I | |||
| D SCARBOROUGH, ON M1E 2K4 P SCARBOROUGH, ON M1E 2 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 350GLC 1FF350GXCED810447 T3,13'1" A 9057.0 H F | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 1000 HR PM | |||
| PM INTERVAL: 1000 HR T | |||
| EMPID: MISPM1 T | |||
| PROMISE DATE: 30JAN2023 T | |||
| SPECIAL INSTRUCTIONS: 45 RICHMOND ST E T | |||
| CONTACT: DANIEL GOVE 416-985-3523 T | |||
| EMAIL: DANIEL@ASTROEXCAVATING.COM T | |||
| .50 01-18 R/T 53092 REPAIR 225.00 106.88 | |||
| SEG # 01 TOTAL = .00 P .50 LH 106.88 L .00 M 106.88 T | |||
| FIELD SERVICE TRAVEL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Total Labor 106.88 * | |||
| * Non-Taxable 106.88 * | |||
| * Misc Charges .00 * | |||
| * GST/HST 13.89 * | |||
| * Sales Tax .00 * | |||
| * (Carbon Tax Surcharge will be added) * | |||
| * TOTAL DUE > 120.77 * | |||
| **************************************** | |||
| @@ -0,0 +1,60 @@ | |||
| Date 27JAN2023 08:35:25 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 53 Work Order 4316544 Seg. 01 Opn Dt 13JAN2023 | |||
| Auth by Phone 519-737-1577 Inv Cls Dt | |||
| CHARGE Slprn | |||
| S AMICO INFRASTRUCTURES INC Cust No. 95600170 S AMICO INFRASTRUCTURES INC | |||
| O 2199 BLACKACRE DRIVE Pur-Ord. REQ H 2199 BLACKACRE DRIVE | |||
| L P-% 0.0 L-% 0.0 I | |||
| D OLDCASTLE, ON N0R 1L0 P OLDCASTLE, ON N0R 1L0 | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 750L 1T0750LXCLF385507 53104 10855.0 H F | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-0101 Lbr Tx-0101 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 1000 HR PM | |||
| PM INTERVAL: 500 HR T | |||
| EMPID: MISPM2 T | |||
| PROMISE DATE: 30JAN2023 T | |||
| SPECIAL INSTRUCTIONS: 1461 HARWOOD AVE N AJAX T | |||
| CONTACT: JASON 519-796-2456 T | |||
| EMAIL: jason.blais@amico.build T | |||
| SEG # 01 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| FIELD SERVICE TRAVEL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > .00 * | |||
| **************************************** | |||
| @@ -0,0 +1,111 @@ | |||
| Date 27JAN2023 10:33:05 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 48 Work Order 3371567 Seg. 01 Opn Dt 27JAN2023 | |||
| Auth by MATT MACDOUGALL Phone 604-520-5909 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S MATCON EXCAVATION AND SHO Cust No. 14003746 S | |||
| O 2208 HARTLEY AVE Pur-Ord. H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D COQUITLAM, BC V2K 6X3 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 524L 1DW524LZVKF700632 019001 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 2000 HR SERVICE | |||
| PM INTERVAL: 2000 HR T | |||
| EMPID: SRYPM1 T | |||
| PROMISE DATE: 28JAN2023 T | |||
| SPECIAL INSTRUCTIONS: AT THE BRANDT SHOP T | |||
| CONTACT: MATT MACDOUGALL T | |||
| EMAIL: MATTM@MATCON.CA T | |||
| 1 1 RE539279 OIL FILTER XY 49.50 .00 | |||
| 1 1 R502513 SEAL XY 11.86 .00 | |||
| 1 1 DZ115391 FILTER ELEMXY 75.38 .00 | |||
| 1 1 DZ115392 FILTER ELEMXY 83.19 .00 | |||
| 2 2 AT367635 FILTER ELEMXY 200.71 .00 | |||
| 1 1 M89679 EJECTOR XY 35.08 .00 | |||
| 5 5 AT346594 FLUID KIT XY 52.14 .00 | |||
| 1 1 AM39653 OIL FILTER 19.39 19.39 | |||
| 1 1 AT468647 OIL FILTER 104.65 104.65 | |||
| SEG # 01 TOTAL = 124.04 P .00 LH .00 L .00 M 124.04 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| PM SERVICE CALL | |||
| SEG # 02 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| MISC ITEMS NOT COVERED BY PM INTERVAL | |||
| 1 1 AT178516 FILTER ELEMXY 112.96 .00 | |||
| 1 1 AT178517 FILTER ELEMXY 91.61 .00 | |||
| 1 1 AT191102 AIR FILTER XY 30.89 .00 | |||
| 1 1 AT307501 AIR FILTER XY 25.41 .00 | |||
| SEG # 03 TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Quoted TOTAL = .00 P .00 LH .00 L .00 M .00 T | |||
| Date 27JAN2023 10:33:05 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 48 Work Order 3371567 Seg. 03 Opn Dt 27JAN2023 | |||
| Auth by MATT MACDOUGALL Phone 604-520-5909 Inv Cls Dt | |||
| CHARGE Slprn 48 | |||
| S MATCON EXCAVATION AND SHO Cust No. 14003746 S | |||
| O 2208 HARTLEY AVE Pur-Ord. H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D COQUITLAM, BC V2K 6X3 P | |||
| G/L # Stock# Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 524L 1DW524LZVKF700632 019001 .0 S | |||
| Prt Cls-PC Lbr Cls-ICL Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * Non-Taxable Parts 124.04 * | |||
| * Backordered Parts 1,178.00 * | |||
| * Total Labor .00 * | |||
| * * | |||
| * Misc Charges .00 * | |||
| * GST/HST 6.20 * | |||
| * Sales Tax .00 * | |||
| * * | |||
| * TOTAL DUE > 130.24 * | |||
| **************************************** | |||
| @@ -0,0 +1,114 @@ | |||
| Date 27JAN2023 13:09:24 ** WORK ORDER PREVIEW ** Page 1 | |||
| Location 53 Work Order 4316454 Seg. 01 Opn Dt 06JAN2023 | |||
| Auth by Phone 855-339-4933 Inv Cls Dt | |||
| INTERNAL Slprn | |||
| S CRH CANADA GROUP INC. Cust No. 95300431 S | |||
| O PO BOX 5400 Pur-Ord. CONT H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D CONCORD, ON L4K 1B6 P | |||
| G/L # 249-03-0053 Stock# PM673799 Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 724K 1DW724KZAGD673799 8609 10381.0 H F | |||
| Prt Cls-PC Lbr Cls-IIN Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| 5000 HR PM | |||
| PM INTERVAL: 1000 HR T | |||
| EMPID: MISPM1 T | |||
| PROMISE DATE: 26JAN2023 T | |||
| SPECIAL INSTRUCTIONS: 650 COMMISSIONERS ST TORONTO T | |||
| CONTACT: ROBERT CABA 416-717-2558 T | |||
| EMAIL: ROBERT.CABA@CA.CRH.COM T | |||
| TRANS 39934397 B | |||
| R DIFF 39934417 B | |||
| F DIFF 39934416 B | |||
| ENGINE 39934415 B | |||
| PARK BRAKE 70064705 B | |||
| HYDRAULIC 39934425 B | |||
| 1 1 AH128449 HYDRAULI 141.58 141.58 | |||
| 1 1 DZ118283 FILTER K 42.30 42.30 | |||
| 1 1 RE525523 FILTER E 179.52 179.52 | |||
| 1 1 AT223493 FUEL FIL 21.83 21.83 | |||
| 1 1 AT223226 FILTER E 186.14 186.14 | |||
| 1 1 AT175224 FILTER E 105.15 105.15 | |||
| 1 1 T158495 VALVEVAL 40.29 40.29 | |||
| 1 1 AT191102 AIR FILT 30.89 30.89 | |||
| 1 1 AT307501 AIR FILT 25.41 25.41 | |||
| 1 1 2450820L 20L - 36 158.15 158.15 | |||
| 2 2 245085L 5L-(4x5) 43.01 86.02 | |||
| 5 5 AT346594 FLUID KI 52.14 260.70 | |||
| 1 1 6341 14oz tub 10.45 10.45 | |||
| 7.50 01-26 R/T 53087 REPAIR 225.00 1687.50 | |||
| 1 01-27 1 SERVICE ACCESSORIES 151.88 151.88 | |||
| SEG # 01 TOTAL = 1,288.43 P 7.50 LH 1,687.50 L 151.88 M 3,127.81 T | |||
| FIELD SERVICE TRAVEL | |||
| 650 COMIISSIONERS ST, TORONTO ROBERT 416-717-2558 B | |||
| 2.50 01-26 R/T 53087 REPAIR 225.00 562.50 | |||
| 1.00 01-26 O/T 53087 REPAIR 285.00 285.00 | |||
| SEG # 02 TOTAL = .00 P 3.50 LH 847.50 L .00 M 847.50 T | |||
| Date 27JAN2023 13:09:24 ** WORK ORDER PREVIEW ** Page 2 | |||
| Location 53 Work Order 4316454 Seg. 02 Opn Dt 06JAN2023 | |||
| Auth by Phone 855-339-4933 Inv Cls Dt | |||
| INTERNAL Slprn | |||
| S CRH CANADA GROUP INC. Cust No. 95300431 S | |||
| O PO BOX 5400 Pur-Ord. CONT H | |||
| L P-% 0.0 L-% 0.0 I | |||
| D CONCORD, ON L4K 1B6 P | |||
| G/L # 249-03-0053 Stock# PM673799 Multi-use# | |||
| Make Model PIN Number Equipment Meter MC SFR | |||
| JD 724K 1DW724KZAGD673799 8609 10381.0 H F | |||
| Prt Cls-PC Lbr Cls-IIN Price Cd-L Prt Tx-N001 Lbr Tx-N001 | |||
| Item Hrs/Ord Bk-Ord Ship Description/Comments RATE EXTENSION | |||
| ------------------------------------------------------------------------------- | |||
| **************************************** | |||
| * Taxable Parts .00 * | |||
| * Non-Taxable Parts 1,288.43 * | |||
| * Total Labor 2,535.00 * | |||
| * Non-Taxable 2,535.00 * | |||
| * Misc Charges 151.88 * | |||
| * * | |||
| * Sales Tax .00 * | |||
| * (Carbon Tax Surcharge will be added) * | |||
| * TOTAL DUE > 3,975.31 * | |||
| **************************************** | |||
| @@ -1 +1 @@ | |||
| 9c6d316ded7c4a917a259ca5a18a9504297be571 | |||
| eab89a116482c1c8b6d6096ff5cc9d69a6d66e72 | |||
| @@ -80,20 +80,6 @@ | |||
| ], | |||
| "assetTargetFallback": true, | |||
| "warn": true, | |||
| "downloadDependencies": [ | |||
| { | |||
| "name": "Microsoft.AspNetCore.App.Runtime.linux-x64", | |||
| "version": "[6.0.4, 6.0.4]" | |||
| }, | |||
| { | |||
| "name": "Microsoft.NETCore.App.Host.linux-x64", | |||
| "version": "[6.0.4, 6.0.4]" | |||
| }, | |||
| { | |||
| "name": "Microsoft.NETCore.App.Runtime.linux-x64", | |||
| "version": "[6.0.4, 6.0.4]" | |||
| } | |||
| ], | |||
| "frameworkReferences": { | |||
| "Microsoft.NETCore.App": { | |||
| "privateAssets": "all" | |||
| @@ -101,11 +87,6 @@ | |||
| }, | |||
| "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/6.0.202/RuntimeIdentifierGraph.json" | |||
| } | |||
| }, | |||
| "runtimes": { | |||
| "ubuntu.16.04-x64": { | |||
| "#import": [] | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -1,6 +1,6 @@ | |||
| { | |||
| "version": 2, | |||
| "dgSpecHash": "sH7hVlHbQHBVwZvCmGKBeFEP5ff/v2zL+LnRhHw0pKLRqckR163IpCBvzZ1qI1cCVHJ6x18eciRAVcD5wWVosA==", | |||
| "dgSpecHash": "pgKZuWyGmgmpIWpoM4fUw4agIrFlCdXHSXZuk9ZIkB8GdySaj2Z3B5ak/7ZT54F4n5KR1HzwQsY5g5P+jzJxQg==", | |||
| "success": true, | |||
| "projectFilePath": "/Volumes/New2TBDrive/apps/acumatica/console/jdis_import/jdis_import.csproj", | |||
| "expectedPackageFiles": [ | |||
| @@ -17,23 +17,6 @@ | |||
| "/Users/michielcarman/.nuget/packages/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/newtonsoft.json.bson/1.0.1/newtonsoft.json.bson.1.0.1.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/restsharp/108.0.2/restsharp.108.0.2.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.collections/4.3.0/runtime.any.system.collections.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.diagnostics.tools/4.3.0/runtime.any.system.diagnostics.tools.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.diagnostics.tracing/4.3.0/runtime.any.system.diagnostics.tracing.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.globalization/4.3.0/runtime.any.system.globalization.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.globalization.calendars/4.3.0/runtime.any.system.globalization.calendars.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.io/4.3.0/runtime.any.system.io.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.reflection/4.3.0/runtime.any.system.reflection.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.reflection.extensions/4.3.0/runtime.any.system.reflection.extensions.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.reflection.primitives/4.3.0/runtime.any.system.reflection.primitives.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.resources.resourcemanager/4.3.0/runtime.any.system.resources.resourcemanager.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.runtime/4.3.0/runtime.any.system.runtime.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.runtime.handles/4.3.0/runtime.any.system.runtime.handles.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.runtime.interopservices/4.3.0/runtime.any.system.runtime.interopservices.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.text.encoding/4.3.0/runtime.any.system.text.encoding.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.text.encoding.extensions/4.3.0/runtime.any.system.text.encoding.extensions.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.threading.tasks/4.3.0/runtime.any.system.threading.tasks.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.any.system.threading.timer/4.3.0/runtime.any.system.threading.timer.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| @@ -49,19 +32,8 @@ | |||
| "/Users/michielcarman/.nuget/packages/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.16.04-x64.runtime.native.system/4.3.0/runtime.ubuntu.16.04-x64.runtime.native.system.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.16.04-x64.runtime.native.system.io.compression/4.3.0/runtime.ubuntu.16.04-x64.runtime.native.system.io.compression.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.16.04-x64.runtime.native.system.net.http/4.3.0/runtime.ubuntu.16.04-x64.runtime.native.system.net.http.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.microsoft.win32.primitives/4.3.0/runtime.unix.microsoft.win32.primitives.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.console/4.3.0/runtime.unix.system.console.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.diagnostics.debug/4.3.0/runtime.unix.system.diagnostics.debug.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.io.filesystem/4.3.0/runtime.unix.system.io.filesystem.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.net.primitives/4.3.0/runtime.unix.system.net.primitives.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.net.sockets/4.3.0/runtime.unix.system.net.sockets.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.private.uri/4.3.0/runtime.unix.system.private.uri.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.unix.system.runtime.extensions/4.3.0/runtime.unix.system.runtime.extensions.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.win-arm64.runtime.native.system.data.sqlclient.sni/4.4.0/runtime.win-arm64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.win-x64.runtime.native.system.data.sqlclient.sni/4.4.0/runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/runtime.win-x86.runtime.native.system.data.sqlclient.sni/4.4.0/runtime.win-x86.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512", | |||
| @@ -86,11 +58,9 @@ | |||
| "/Users/michielcarman/.nuget/packages/system.linq/4.3.0/system.linq.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.linq.expressions/4.3.0/system.linq.expressions.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.net.http/4.3.0/system.net.http.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.net.nameresolution/4.3.0/system.net.nameresolution.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.net.primitives/4.3.0/system.net.primitives.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.net.sockets/4.3.0/system.net.sockets.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.objectmodel/4.3.0/system.objectmodel.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.private.uri/4.3.0/system.private.uri.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.reflection/4.3.0/system.reflection.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.reflection.emit/4.3.0/system.reflection.emit.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.reflection.emit.ilgeneration/4.3.0/system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512", | |||
| @@ -121,13 +91,9 @@ | |||
| "/Users/michielcarman/.nuget/packages/system.threading/4.3.0/system.threading.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.threading.tasks/4.3.0/system.threading.tasks.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.threading.tasks.extensions/4.3.0/system.threading.tasks.extensions.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.threading.threadpool/4.3.0/system.threading.threadpool.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.threading.timer/4.3.0/system.threading.timer.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.xml.readerwriter/4.3.0/system.xml.readerwriter.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/system.xml.xdocument/4.3.0/system.xml.xdocument.4.3.0.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/microsoft.netcore.app.runtime.linux-x64/6.0.4/microsoft.netcore.app.runtime.linux-x64.6.0.4.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/6.0.4/microsoft.aspnetcore.app.runtime.linux-x64.6.0.4.nupkg.sha512", | |||
| "/Users/michielcarman/.nuget/packages/microsoft.netcore.app.host.linux-x64/6.0.4/microsoft.netcore.app.host.linux-x64.6.0.4.nupkg.sha512" | |||
| "/Users/michielcarman/.nuget/packages/system.xml.xdocument/4.3.0/system.xml.xdocument.4.3.0.nupkg.sha512" | |||
| ], | |||
| "logs": [ | |||
| { | |||