-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmMain.vb
2199 lines (1706 loc) · 109 KB
/
frmMain.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Imports System.ComponentModel
Imports System.Data.SqlClient
Imports System.Net
Imports System.Web
Public Class frmMain
Public clsDB As New clsDatenbank
Dim bIsLoading As Boolean = True
Public lvwStartupKategorie As ListView
Dim bIsKomplettÜbersetzung As Boolean = False
'#################################################
'# >> setSettingsDelete
'# My.Settings.xxx String Collection alle löschen
'#################################################
Public Function setSettingsDelete() As Boolean
Dim i As Integer
For i = 0 To My.Settings.db_server.Count - 1
Try
My.Settings.db_server.RemoveAt(0)
Catch ex As Exception
End Try
Try
My.Settings.db_datenbankname.RemoveAt(0)
Catch ex As Exception
End Try
Try
My.Settings.db_username.RemoveAt(0)
Catch ex As Exception
End Try
msgMaster.Text = "Es existieren noch " & My.Settings.db_server.Count & " Einstellungen"
Next
Return True
End Function
'##################################################################################
'# >> geteazybusinessSettings()
'# Findet die Position an der Sich die Hauptdatenbank befindet
'##################################################################################
Public Function getMySettingsPositionByDatabase(strDatabaseName As String) As Integer
Try
Dim i As Byte
Dim iGefunden As Integer = -1
Dim bGefunden As Boolean = False
'# Keine Einstellung gefunden
If My.Settings.db_datenbankname.Count = 0 Then
Return -1
Exit Function
End If
For i = 0 To My.Settings.db_datenbankname.Count - 1
If My.Settings.db_datenbankname(i) = strDatabaseName Then
bGefunden = True
iGefunden = i
Exit For
End If
Next
'# Nicht gefunden Position 0
If bGefunden = False Then
iGefunden = -1
End If
My.Settings.Save()
Return iGefunden
Catch ex As Exception
MessageBox.Show("Fehler: " & ex.Message, "geteMySettingsbyDatabase()", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return -1
End Try
End Function
'#################################################
'# >> setSettingsInit
'# My.Settings.xxx String Collection initalisieren
'#################################################
Public Function setSettingsInit(ByVal iSize As Integer) As Integer
Try
Dim txtShopURL_test As String = ""
Dim iCount_insert As Integer = 0
If My.Settings.db_server.Count - 1 < iSize Then
For iCount As Integer = My.Settings.db_server.Count To iSize
My.Settings.db_server.Insert(iCount, "")
My.Settings.db_datenbankname.Insert(iCount, "")
My.Settings.db_username.Insert(iCount, "")
My.Settings.db_passwort.Insert(iCount, "")
My.Settings.SpracheSelected.Insert(iCount, "")
My.Settings.Webproxy.Insert(iCount, "")
My.Settings.JTLSHOP.Insert(iCount, "")
My.Settings.JTLSHOP_HTTP.Insert(iCount, "")
iCount_insert += 1
Next
End If
Return iCount_insert
Catch ex As Exception
MessageBox.Show("Fehler bei setInitSettings: " & ex.Message, "setInitSettings()", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return -1
End Try
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strFilename As String = Application.StartupPath & "\SQL\Update.sql"
bIsLoading = True
Call setMainWindowTitle("", Me)
gbl_KeyCode = getWMI_KeyCode()
Dim strServerInfo() As String = getHTTPResponseMessage("https://api.bludau-media.de//SafeSandy/IsRegistered.php?key=" & gbl_KeyCode & "&versionsnummer=" & strVersionsNummer, mgetUpdaterMessage.getIstBuyed, True)
If Not strServerInfo(0) = "GEKAUFT" Then
Dim frmRegisterJTLBridge As New frmDemoVersion
frmRegisterJTLBridge.ShowDialog()
End If
'# Keine Datenbankverbindungsmöglichkeiten vorhanden erster Start
If My.Settings.mandant_position = -1 Then
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
End If
''# Prüfung ob my.settings.mandant_position außerhalb des Index
Try
If My.Settings.db_server(My.Settings.mandant_position) = "" Then
End If
Catch ex As Exception
'# Außerhalb des Index default Datenbank laden, falls vorhanden
MainMenuStrip.Text = "Fehler: aktuelle Position innerhalb der Einstellungen '" & My.Settings.mandant_position & "' - lade Standard Werte"
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
'My.Settings.mandant_position = getMySettingsPositionByDatabase("eazybusiness")
End Try
'##################################################
'# >> Standarddatenbank easzybusiness Connection
'##################################################
If clsDB.strConnectionString_eazybusiness = "" Then
Dim iDefaultDB As Integer = getMySettingsPositionByDatabase("eazybusiness")
'# Es konnte keine Standarddatenbank gefunden werden
If iDefaultDB = -1 Then
iDefaultDB = 0
End If
Dim strCon2 As String = "server=" & My.Settings.db_server.Item(iDefaultDB) & ";uid=" & My.Settings.db_username.Item(iDefaultDB) & ";pwd=" & My.Settings.db_passwort.Item(iDefaultDB) & ";database=" & My.Settings.db_datenbankname.Item(iDefaultDB) & ";"
If clsDB.getDBConnect(strCon2, True) = False Then
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
End If
End If
'######################################################
'# >> Mandantendatenbank auswählen
'######################################################
If My.Settings.db_server(My.Settings.mandant_position) = "" Or My.Settings.db_datenbankname(My.Settings.mandant_position) = "" Or My.Settings.db_passwort(My.Settings.mandant_position) = "" Or My.Settings.db_username(My.Settings.mandant_position) = "" Then
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
End If
Dim strCon As String = "server=" & My.Settings.db_server.Item(My.Settings.mandant_position) & ";uid=" & My.Settings.db_username.Item(My.Settings.mandant_position) & ";pwd=" & My.Settings.db_passwort.Item(My.Settings.mandant_position) & ";database=" & My.Settings.db_datenbankname.Item(My.Settings.mandant_position) & ";"
If clsDB.getDBConnect(strCon) = False Then
Dim frmDBSetting As New frmDatenbankEinstellungen
frmDBSetting.ShowDialog()
End If
'# Datenbank Verbindung initialisieren
'Call setDBSettings(True)
'#################################################################
'# >> Standardmandanten laden - eazybusiness Standarddatenbank
'#################################################################
Call clsDB.setMandantbyCombobox(cmbMandant, False)
'JTL Shops auslesen
Call clsDB.getJTLShops(cmbJTLShops)
ToolStripStatusLabel1.Text = "JTL SHOP: " + clsDB.getJTLShop(cmbJTLShops.Text)
Dim strServerInfo1() As String = getHTTPResponseMessage("https://api.bludau-media.de//SafeSandy/Update.php?key=" & gbl_KeyCode & "&programID=11&versionsnummer=" & strVersionsNummer & "&KeinUpdate=1", mgetUpdaterMessage.getProgramUpdateCheck, True)
If Not strServerInfo1(0) = "VERSION_AKTUELL" Then
Dim frmUpdater As New frmUpdater
frmUpdater.ShowDialog()
End If
Dim strOutput(1) As String
' strOutput = clsDB.getKategorieOberKategorie(0, 1)
'# Gibt es SpracheSelected???
Try
My.Settings.SpracheSelected(My.Settings.mandant_position) = 0
Catch ex As Exception
My.Settings.SpracheSelected.Insert(0, "")
My.Settings.Webproxy.Insert(My.Settings.mandant_position, "")
My.Settings.SpracheSelected.Insert(My.Settings.mandant_position, "")
My.Settings.JTLSHOP.Insert(My.Settings.mandant_position, "")
My.Settings.JTLSHOP_HTTP.Insert(My.Settings.mandant_position, "")
End Try
'# Alle aktiven verfügbaren Sprachen aus JTL auslesen
Call clsDB.getPossibleLanguages2Checkbox(cmbZielSpache)
If My.Settings.bSQLUpdate_immer = True Then
Dim strFilename2 As String = Application.StartupPath & "\SQL\Update.sql"
If IO.File.Exists(strFilename) = True Then
Call clsDB.setInstallUpdateAllMandant(strFilename2, cmbMandant)
End If
End If
If cmbZielSpache.Items.Count > 0 Then
If cmbZielSpache.Items.Count > 1 Then
cmbZielSpache.SelectedIndex = 1
Else
cmbZielSpache.SelectedIndex = 0
End If
End If
'# Privoxy und Tor starten...
If My.Settings.chkUseTorPrivoy = True Then
setStartupTorPrivoxy(True)
End If
Call setGUIModus()
'# Aktuell setzten
'DateTimePicker1.Value = Date.Now.AddMonths(-1)
'chkUseDateTimePicker.Checked = My.Settings.chkTranslate_normal_benutzeDatum
'# Kategorien abrufen in Listview
lvwArtikel_kategorien.Items.Clear() ' Listview löschen
bIsLoading = False
If My.Settings.SHOPSTE_domain_id.Length = 0 Then
Dim frmShopsteLogin As New LoginForm1
frmShopsteLogin.Show()
End If
'# Nur Login wenn kein Benutzername gesetzt ist
If My.Settings.SHOPSTE_USERNAME.Length > 0 Then
btnÜbertrage.Enabled = True
Else
btnÜbertrage.Enabled = False
End If
End Sub
Private Sub BeeendenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BeeendenToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub DatenbankverbindungToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DatenbankverbindungToolStripMenuItem.Click
Dim frmDBCon As New frmDatenbankEinstellungen
frmDBCon.ShowDialog()
End Sub
Function setArtikel2Shopste()
Try
Dim strLokalFile As String
Dim strLast As String
Dim strImportError As String = ""
Dim iCount As Integer = 0
Dim strBeschreibung As String = ""
For iCount = 0 To lvwMainData.SelectedItems.Count - 1
Dim str2() As String = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=get_shopste_kategorie_by_eisocatid&eiso_cat_id=" & lvwMainData.SelectedItems(iCount).SubItems(11).Text & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.getEiSo2ShopsteKat, False)
If Not IsNumeric(str2(0)) = True Then
MessageBox.Show("Es wurde keine gültige Shopste.com Kategorie gefunden.", "ungültige Kategorie", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Continue For
End If
' lvwMainData.Items(iCount).Selected = True
' Application.DoEvents()
Dim Request As HttpWebRequest = CType(WebRequest.Create(My.Settings.SHOPSTE_API_URL), HttpWebRequest)
Request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
msgMaster.Text = iCount & " | " & lvwMainData.SelectedItems.Count - 1 & " - Bereite einfügen vor..."
Application.DoEvents()
'MessageBox.Show(System.Net.WebUtility.HtmlEncode(ListView1.SelectedItems(0).SubItems(0).Text))
'System.Net.WebUtility.HtmlEncode
' Dim strBeschreibung As String
' If chkImportKeineHTMLBeschreibung.Checked = False Then
'strBeschreibung = HttpUtility.UrlEncode(HttpUtility.HtmlEncode(lvwMainData.SelectedItems(iCount).SubItems(1).Text))
strBeschreibung = System.Uri.EscapeDataString(lvwMainData.SelectedItems(iCount).SubItems(1).Text)
' Else
' strBeschreibung = HttpUtility.UrlEncode(lvwMainData.SelectedItems(0).SubItems(0).Text)
' End If
'# Letztes zu importierendes Produkt?
If iCount = lvwMainData.SelectedItems.Count - 1 Then
strLast = "true"
Else
strLast = "false"
End If
Dim Post As String = "modus=system_shop_item_add&domain_id=" & My.Settings.SHOPSTE_domain_id & "&shop_item_beschreibung=" & strBeschreibung & "&shop_item_menge=" & lvwMainData.SelectedItems(iCount).SubItems(9).Text & "&shop_item_price=" & lvwMainData.SelectedItems(iCount).SubItems(2).Text.Replace(",", ".") & "&shop_item_name=" & System.Uri.EscapeDataString(lvwMainData.SelectedItems(iCount).SubItems(1).Text) & "&shop_item_duration=15&shop_item_mwst=19&shop_item_artikelnummer=" & lvwMainData.SelectedItems(iCount).SubItems(0).Text & "&bLastItem=" & strLast & "&user=" & My.Settings.SHOPSTE_USERNAME & "&subshop_cat=" & strHTTPDataStore & "&shopste_cat=" & lvwMainData.SelectedItems(iCount).SubItems(12).Text & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD
' Clipboard.SetText(WebUtility.HtmlEncode(ListView1.SelectedItems(0).SubItems(5).Text))
'Dim postQuery As Byte() = System.Text.Encoding.ASCII.GetBytes("Post
Dim byteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(Post)
Request.ContentLength = byteArray.Length
Dim DataStream As System.IO.Stream = Request.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
DataStream = Response.GetResponseStream()
Dim reader As New System.IO.StreamReader(DataStream)
Dim ServerResponse As String = reader.ReadToEnd()
reader.Close()
DataStream.Close()
Response.Close()
If InStr(ServerResponse, "shopid") Then
Dim str() As String = ServerResponse.Split(":")
Dim shopid_picture As String = str(1)
msgMaster.Text = iCount & " | " & lvwMainData.SelectedItems.Count - 1 & " - Shop ID:" & shopid_picture
Dim strFileName() As String = lvwMainData.SelectedItems(iCount).SubItems(3).Text.Split("/")
Dim nvc As New Specialized.NameValueCollection
nvc.Add("modus", "system_upload_file")
nvc.Add("domain_id", My.Settings.SHOPSTE_domain_id)
nvc.Add("benutzername", My.Settings.SHOPSTE_USERNAME)
nvc.Add("domain_pfad", My.Settings.SHOPSTE_domainname)
nvc.Add("shop_id", shopid_picture)
' nvc.Add("picture_name", lvwMainData.Items(iCount).SubItems(3).Text.Replace(" ", "_").Replace(">", "-").Replace("/", "").Replace("\", "").Replace("!", ""))
Dim strBildName As String = lvwMainData.SelectedItems(iCount).SubItems(1).Text.Replace(" ", "_").Replace(">", "-").Replace("/", "").Replace("\", "").Replace("!", "").Replace("*", "").Replace("<", "-") & ".jpg"
nvc.Add("picture_name", strBildName)
'# Externe Bilder - HTTP Link
If Not lvwMainData.SelectedItems(iCount).SubItems(3).Text.LastIndexOf("http://") = -1 Then
Dim client As New WebClient()
Dim strBild As String
Dim strBild_ary() As String
Dim strBildFixed As String = strFileName(strFileName.Length - 1).Replace("\", "-").Replace("/", "").Replace(":", "").Replace("*", "").Replace("?", "").Replace("""", "").Replace("<", "").Replace(">", "").Replace("|", "")
'MessageBox.Show(Application.StartupPath)
' Dim strPath As String = IO.Path.GetDirectoryName(Diagnostics.Process.GetCurrentProcess().MainModule.FileName)
' MessageBox.Show(Application.StartupPath)
If My.Settings.SHOPSTE_domain_id = 43 Then
strBild_ary = strBildName.Split("/")
If strBild_ary.Length = 1 Then
strBild = "https://philafriend.de/eBay/TN_" & strBildFixed
Else
strBild = strBild.Replace(strBild_ary(strBild_ary.Length - 1), "TN_" + strBild_ary(strBild_ary.Length - 1))
strBild = "https://philafriend.de/eBay/TN_" & strBild_ary(strBild_ary.Length - 1)
strBild = lvwMainData.SelectedItems(iCount).SubItems(3).Text.Replace("http://", "https://")
strBild_ary = strBild.Split("/")
strBild = strBild.Replace(strBild_ary(strBild_ary.Length - 1), "TN_" + strBild_ary(strBild_ary.Length - 1))
End If
Else
strBild = lvwMainData.SelectedItems(iCount).SubItems(3).Text
End If
Try
If strBildFixed.Length > 240 Then
strBildFixed = strBildFixed.Substring(0, 240)
End If
client.DownloadFile(strBild, Application.StartupPath & "\bilderexport\" & strBildFixed)
strLokalFile = Application.StartupPath & "\bilderexport\" & strBildFixed
Catch ex As Exception
strLokalFile = "error"
strImportError &= lvwMainData.SelectedItems(iCount).SubItems(3).Text & vbCrLf
End Try
Else
strLokalFile = ""
End If
'HttpUploadFile("http://shopste.com/api.php", "C:\Users\jbludau\Desktop\gelb_katze.jpg", "system_upload", "image/jpeg", nvc)
'MessageBox.Show(ListView1.Items(icount).SubItems(3).Text)
'lvwMainData.Items(iCount).Selected = True
msgMaster.Text = iCount & " | " & lvwMainData.SelectedItems.Count - 1 & " - Lade Bild hoch..."
If strLokalFile = "" Then
strLokalFile = lvwMainData.SelectedItems(iCount).SubItems(3).Text
End If
'# Kein Fehler beim Verarbeiten
If Not strLokalFile = "error" Then
HttpUploadFile(My.Settings.SHOPSTE_API_URL, strLokalFile, "system_upload", "image/jpeg", nvc)
End If
My.Settings.Save()
Else
If MessageBox.Show("Artikel '" & lvwMainData.SelectedItems(0).SubItems(0).Text & "' nicht korrekt eingestellt." + vbCrLf + "Wird Artikel wird fehlen, führe fort...?", "API Import", MessageBoxButtons.YesNo, MessageBoxIcon.Error) = Windows.Forms.DialogResult.No Then
Exit For
End If
End If
lvwMainData.EnsureVisible(iCount)
Application.DoEvents()
Next
msgMaster.Text = "Alle Aufgaben abgeschlossen"
If (strImportError.Length > 0) Then
MessageBox.Show("Es sind Fehler aufgetreten bei:" & vbCrLf & vbCrLf & strImportError)
Else
MessageBox.Show("Alle Produkte wurden importiert", "Import fertig", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Function
Public Sub HttpUploadFile(
ByVal uri As String,
ByVal filePath As String,
ByVal fileParameterName As String,
ByVal contentType As String,
ByVal otherParameters As Specialized.NameValueCollection)
Dim boundary As String = "---------------------------" & DateTime.Now.Ticks.ToString("x")
Dim newLine As String = System.Environment.NewLine
Dim boundaryBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(newLine & "--" & boundary & newLine)
Dim request As HttpWebRequest = WebRequest.Create(uri)
request.ContentType = "multipart/form-data; boundary=" & boundary
request.Method = "POST"
request.KeepAlive = True
request.Credentials = CredentialCache.DefaultCredentials
Using requestStream As IO.Stream = request.GetRequestStream()
Dim formDataTemplate As String = "Content-Disposition: form-data; name=""{0}""{1}{1}{2}"
For Each key As String In otherParameters.Keys
requestStream.Write(boundaryBytes, 0, boundaryBytes.Length)
Dim formItem As String = String.Format(formDataTemplate, key, newLine, otherParameters(key))
Dim formItemBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(formItem)
requestStream.Write(formItemBytes, 0, formItemBytes.Length)
Next key
requestStream.Write(boundaryBytes, 0, boundaryBytes.Length)
Dim headerTemplate As String = "Content-Disposition: form-data; name=""{0}""; filename=""{1}""{2}Content-Type: {3}{2}{2}"
Dim header As String = String.Format(headerTemplate, fileParameterName, filePath, newLine, contentType)
Dim headerBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(header)
requestStream.Write(headerBytes, 0, headerBytes.Length)
Using fileStream As New IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read)
Dim buffer(4096) As Byte
Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)
Do While (bytesRead > 0)
requestStream.Write(buffer, 0, bytesRead)
bytesRead = fileStream.Read(buffer, 0, buffer.Length)
Loop
End Using
Dim trailer As Byte() = System.Text.Encoding.ASCII.GetBytes(newLine & "--" + boundary + "--" & newLine)
requestStream.Write(trailer, 0, trailer.Length)
End Using
Dim response As WebResponse = Nothing
Try
response = request.GetResponse()
Using responseStream As IO.Stream = response.GetResponseStream()
Using responseReader As New IO.StreamReader(responseStream)
Dim responseText = responseReader.ReadToEnd()
Diagnostics.Debug.Write(responseText)
End Using
End Using
Catch exception As WebException
response = exception.Response
If (response IsNot Nothing) Then
Using reader As New IO.StreamReader(response.GetResponseStream())
Dim responseText = reader.ReadToEnd()
MessageBox.Show(responseText)
Diagnostics.Debug.Write(responseText)
End Using
response.Close()
End If
Finally
request = Nothing
End Try
End Sub
Private Sub btnLoadArtikel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnÜbertrage.Click
lvwMainData.Items.Clear()
getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=getSyncStatus&domain_id=" & My.Settings.SHOPSTE_domain_id, mgetUpdaterMessage.getShopsteArtikel, True)
Dim strData As String = My.Computer.FileSystem.ReadAllText("shopste-itemlist.dat")
Dim strData_split() As String
strData_split = strData.Split(vbLf)
Dim iCount As Integer = 0
For iCount = 0 To strData_split.Length - 2
Dim strFields() As String = strData_split(iCount).Split(";")
'0 = ID
'1 = Menge
'2 = Name
'3 = Artikelnummer
clsDB.getSYNC_status(strFields)
Next
MessageBox.Show("Alle Artikel verarbeitet von Domain" & My.Settings.SHOPSTE_domainname)
End Sub
'################################################################
'# >> setTranslateJTLWaWiArtikel
'# - Artikel Übersetzen
'################################################################
Private Function setTranslateJTLWaWiArtikel() As Boolean
Dim i As Integer = 0
Dim strName As String = ""
Dim strKurzbeschreibung As String = ""
Dim strBeschreibung As String = ""
Dim iLengthNext As Integer = 1200
Dim iLengthNext_tmp As Integer = 0
Dim dblTranslationCount As Double = 0
Dim strZielSpracheISO As String = ""
'# Alle selektierten
ToolStripProgressBar1.Value = 0
ToolStripProgressBar1.Maximum = lvwMainData.SelectedItems.Count - 1
ToolStripProgressBar1.Visible = True
btnÜbertrage.Enabled = False
lvwMainData.Enabled = False
strZielSpracheISO = clsDB.getGoogle2TranslationCode(cmbZielSpache.Text)
Try
Dim strSprachenUsed As String
'# Alle Sprachen ausgeben
Dim sqlConn3 As New SqlConnection(clsDB.strConnectionString)
sqlConn3.Open()
strSprachenUsed = "SELECT * FROM tSpracheUsed Where cNameDeu='" & cmbZielSpache.Text & "'"
Dim sqlComm3 As New SqlCommand(strSprachenUsed, sqlConn3)
Dim r2 As SqlDataReader = sqlComm3.ExecuteReader()
Dim strJTLSprachen(0) As String
Dim strJTLSprachen_id(0) As String
Dim iCount As Integer = 0
ReDim Preserve strJTLSprachen(strJTLSprachen.Length)
ReDim Preserve strJTLSprachen_id(strJTLSprachen.Length)
While r2.Read()
strJTLSprachen(iCount) = r2("cNameDeu").ToString
strJTLSprachen_id(iCount) = r2("kSprache").ToString
ReDim Preserve strJTLSprachen(iCount + 1)
ReDim Preserve strJTLSprachen_id(iCount + 1)
iCount += 1
End While
'# Alle Sprachen in einem Durchlauf übersetzen
Dim iSprachenCount As Integer = 0
If My.Settings.chkTranslate_normal_alleSprachen = True Then
iSprachenCount = cmbZielSpache.Items.Count - 1
Else
iSprachenCount = 1
End If
For i = 0 To lvwMainData.SelectedItems.Count - 1
If bAbbruch = True Then
Exit For
End If
For iSprachen = 1 To iSprachenCount
If Not iSprachen = 1 Then
cmbZielSpache.SelectedIndex = iSprachen
Application.DoEvents()
strZielSpracheISO = clsDB.getGoogle2TranslationCode(cmbZielSpache.Text)
End If
msgMaster.Text = i + 1 & " - " & lvwMainData.SelectedItems.Count - 1 & " -> " & lvwMainData.SelectedItems(i).SubItems(1).Text & "übersetze Eigenschaften"
If Not lvwMainData.SelectedItems(i).SubItems(8).Text = "0" Then
'clsDB.setSpracheigenschaften_translate(lvwMainData.SelectedItems(i), cmbZielSpache.Text, strJTLSprachen_id(0))
clsDB.setSprachEigenSchaftWert_translate(lvwMainData.SelectedItems(i), cmbZielSpache.Text, strJTLSprachen_id(0))
End If
Application.DoEvents()
If lvwMainData.SelectedItems(i).SubItems(1).Text.Length > 0 Then
strName = getTranslateText(lvwMainData.SelectedItems(i).SubItems(1).Text, "de", strZielSpracheISO).Replace(""", """")
End If
ToolStripProgressBar1.Value = i
lvwMainData.EnsureVisible(i)
msgMaster.Text = strName
Application.DoEvents()
strKurzbeschreibung = lvwMainData.SelectedItems(i).SubItems(3).Text
strKurzbeschreibung = strKurzbeschreibung.Replace(" ", " ").Replace("<P>", "").Replace("</P>", "").Replace("<BR>", "").Replace("ü", "ü").Replace("ä", "ä").Replace("ö", "ö").Replace("Ä", "Ä").Replace("Ö", "Ö").Replace("Ü", "Ü")
If strKurzbeschreibung.Length > 0 Then
strKurzbeschreibung = getTranslateText(strKurzbeschreibung, "de", strZielSpracheISO).Replace("<", "<").Replace(">", ">").Replace(""", """").Replace("</ p>", "</p>").Replace("</ span>", "</span>").Replace("< / div>", "</div>").Replace("</ div>", "</div>").Replace("< br />", "<br/>").Replace("</ font>", "</font>").Replace("</ strong>", "</strong>").Replace("</ div >", "</div>").Replace("</ div>", "</div>").Replace("P>", "").Replace("u>", "").Replace("'", "'")
End If
If strKurzbeschreibung = "<div>" Then
strKurzbeschreibung = ""
End If
strBeschreibung = lvwMainData.SelectedItems(i).SubItems(4).Text
'##################################################################################
'# >> Größere Übersetzung
'##################################################################################
If strBeschreibung.Length > 1200 Then
Dim bStop As Boolean = False
Dim strBeschreibung_tmp As String = ""
iLengthNext_tmp = 0
While bStop = False
strBeschreibung = lvwMainData.SelectedItems(i).SubItems(4).Text
'dblTranslationCount = Math.Round(strBeschreibung.Length / 1200)
' 1203
If iLengthNext > strBeschreibung.Length Then
bStop = True
iLengthNext = strBeschreibung.Length
End If
iLengthNext = strBeschreibung.IndexOf(" ", iLengthNext)
If iLengthNext = -1 Then
iLengthNext = strBeschreibung.Length
End If
If iLengthNext_tmp > iLengthNext Then
Exit While
Else
strBeschreibung = strBeschreibung.Substring(iLengthNext_tmp, iLengthNext - iLengthNext_tmp)
End If
strBeschreibung = strBeschreibung.Replace(" ", " ").Replace("<P>", "").Replace("</P>", "").Replace("<BR>", "").Replace("ü", "ü").Replace("ä", "ä").Replace("ö", "ö").Replace("Ä", "Ä").Replace("Ö", "Ö").Replace("Ü", "Ü").Replace("ß", "ß")
If strBeschreibung.Length > 0 Then
strBeschreibung = getTranslateText(strBeschreibung, "de", strZielSpracheISO).Replace("<", "<").Replace(">", ">").Replace(""", """").Replace("</ p>", "</p>").Replace("</ span>", "</span>").Replace("< / div>", "</div>").Replace("</ div>", "</div>").Replace("< br />", "<br/>").Replace("</ font>", "</font>").Replace("</ strong>", "</strong>").Replace("</ div >", "</div>").Replace("</ div>", "</div>").Replace("P>", "").Replace("u>", "").Replace("'", "'")
End If
iLengthNext_tmp += iLengthNext
iLengthNext += 1200
strBeschreibung_tmp &= strBeschreibung
End While
'MessageBox.Show(strBeschreibung_tmp)
strBeschreibung = strBeschreibung_tmp
Else
'##############################################################################
'# >> Einzel Übersetzung
'##############################################################################
strBeschreibung = strBeschreibung.Replace(" ", " ").Replace("<P>", "").Replace("</P>", "").Replace("<BR>", "").Replace("ü", "ü").Replace("ä", "ä").Replace("ö", "ö").Replace("Ä", "Ä").Replace("Ö", "Ö").Replace("Ü", "Ü").Replace("ß", "ß")
If strBeschreibung.Length > 0 Then
strBeschreibung = getTranslateText(strBeschreibung, "de", strZielSpracheISO).Replace("<", "<").Replace(">", ">").Replace(""", """").Replace("</ p>", "</p>").Replace("</ span>", "</span>").Replace("< / div>", "</div>").Replace("</ div>", "</div>").Replace("< br />", "<br/>").Replace("</ font>", "</font>").Replace("</ strong>", "</strong>").Replace("</ div >", "</div>").Replace("</ div>", "</div>").Replace("P>", "").Replace("u>", "").Replace("'", "'")
End If
End If
'MessageBox.Show(strBeschreibung)
strBeschreibung = strBeschreibung.Replace("'", "''")
strKurzbeschreibung = strKurzbeschreibung.Replace("'", "''")
'# UPDATE oder INSERT
If clsDB.chkIsTranslated(lvwMainData.SelectedItems(i).SubItems(7).Text) = True Then
'# UPDATE
If clsDB.setUPDATE_TextData(lvwMainData.SelectedItems(i).SubItems(7).Text, strName, strKurzbeschreibung, strBeschreibung, lvwMainData, i) = False Then
MessageBox.Show("FEHLER:" & vbCrLf & "Angehalten bei " & vbCrLf & "NAME:" & lvwMainData.SelectedItems(i).SubItems(1).Text)
Exit For
End If
Else
'# INSERT
If clsDB.setINSERT_TextData(lvwMainData.SelectedItems(i).SubItems(7).Text, strName, strKurzbeschreibung, strBeschreibung, lvwMainData, i) = False Then
MessageBox.Show("FEHLER:" & vbCrLf & "Angehalten bei " & vbCrLf & "NAME:" & lvwMainData.SelectedItems(i).SubItems(1).Text)
Exit For
End If
End If
'####################################
'# >> Funktionsattribute übersetzen
'####################################
If My.Settings.chkTranslate_normal_funktionsattribute_aktiv = True Then
clsDB.getFunktionsattribut(lvwMainData.SelectedItems(i).SubItems(7).Text)
End If
'#######################################
'# >> Artikel Merkmale übersetzen
'#######################################
If My.Settings.chkTranslate_normale_merkmale_aktiv = True Then
clsDB.setMerkmale(lvwMainData.SelectedItems(i).SubItems(7).Text)
End If
Next
Next
MessageBox.Show(lvwMainData.SelectedItems.Count & "x Übersetzungen in JTL eingefügt mit (" & clsDB.dblQuellspracheZeichen & " Zeichen)", "Fertig", MessageBoxButtons.OK, MessageBoxIcon.Information)
Dim strServerInfo2() As String = getHTTPResponseMessage("https://api.bludau-media.de//SafeSandy/jtl-translator.php?auth_key=" & gbl_KeyCode & "&zeichen=" & clsDB.dblQuellspracheZeichen & "&modus=update_anzahl", mgetUpdaterMessage.getÜbersetzungGesammtSumme, True)
Zeichenzähler.Text = clsDB.dblQuellspracheZeichen
clsDB.dblQuellspracheZeichen = 0
ToolStripProgressBar1.Visible = False
btnÜbertrage.Enabled = True
lvwMainData.Enabled = True
If bIsKomplettÜbersetzung = False Then
lvwMainData.Items.Clear()
End If
If lvwArtikel_kategorien.SelectedItems.Count > 0 Then
Call clsDB.getKategorie2Artikel(lvwArtikel_kategorien.SelectedItems(0).Text, lvwMainData, lvwArtikel_kategorien)
End If
'clsDB.getArtikelListe(lvwMainData, chkTranslateMissing.Checked)
Catch ex As Exception
btnÜbertrage.Enabled = True
lvwMainData.Enabled = True
ToolStripProgressBar1.Visible = False
Return False
End Try
Return True
End Function
Private Sub ÜbersetzenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÜbersetzenToolStripMenuItem.Click
Call submit2shopste()
End Sub
'#################################################################
'# >> Sortieren
'#################################################################
Public Function setSort(ByRef listview1 As ListView, ByVal e As _
System.Windows.Forms.ColumnClickEventArgs) As Boolean
Try
If bIsLoading = False Then
If col = e.Column Then
If listview1.Sorting = SortOrder.Descending Then
listview1.Sorting = SortOrder.Ascending
Else
listview1.Sorting = SortOrder.Descending
End If
Else
listview1.Sorting = SortOrder.Ascending
End If
col = e.Column
'###########################
'# >> Listviewnamen ermitteln
'###########################
Select Case listview1.Name
Case "lvwMainData"
Select Case col
Case 0
listview1.ListViewItemSorter = New lvsorter(Of Integer)(e.Column)
Case 9
listview1.ListViewItemSorter = New lvsorter(Of Double)(e.Column)
Case 10
listview1.ListViewItemSorter = New lvsorter(Of Double)(e.Column)
Case 15
listview1.ListViewItemSorter = New lvsorter(Of Double)(e.Column)
Case Else
listview1.ListViewItemSorter = New lvsorter(Of String)(e.Column)
End Select
End Select
End If
Return True
Catch ex As Exception
Return False
End Try
End Function
Public Function setPOST(Post As String, strURL As String) As String
Dim Request As HttpWebRequest = CType(WebRequest.Create(strURL), HttpWebRequest)
Request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
Dim byteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(Post)
Request.ContentLength = byteArray.Length
Dim DataStream As System.IO.Stream = Request.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
DataStream = Response.GetResponseStream()
Dim reader As New System.IO.StreamReader(DataStream)
Dim ServerResponse As String = reader.ReadToEnd()
reader.Close()
DataStream.Close()
Response.Close()
End Function
Private Sub submit2shopste()
Dim strLokalFile As String
Dim strLast As String
Dim strImportError As String = ""
Dim iCount As Integer = 0
Dim strBeschreibung As String = ""
Dim strInfo() As String
'If lvwMenue.SelectedItems(0).Text.Length = 0 Then
' MessageBox.Show("Bitte EiSo Shop Menü auswählen", "Artikelauswahl", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
'End If
If lvwMainData.SelectedItems.Count = 0 Then
MessageBox.Show("Bitte Artikel auswählen um diese nach Shopste.com zu übertragen STRG + Artikelklick oder STRG + A", "Artikelauswahl", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Exit Sub
End If
For iCount = 0 To lvwMainData.SelectedItems.Count - 1
Dim strMenue() As String = lvwMainData.SelectedItems(iCount).SubItems(12).Text.Split(",")
getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=get_shopste_kategorie_by_jtlcatid&jtl_cat_id=" & strMenue(0) & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.getEiSo2ShopsteKat, False)
If Not IsNumeric(strHTTPDataStore) = True Then
MessageBox.Show("Es wurde keine gültige Shopste.com Kategorie gefunden.", "ungültige Kategorie", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Continue For
End If
' lvwMainData.Items(iCount).Selected = True
' Application.DoEvents()
Dim Request As HttpWebRequest = CType(WebRequest.Create(My.Settings.SHOPSTE_API_URL), HttpWebRequest)
Request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
' frmMain.master_Message_label.Text = iCount & " | " & lvwMainData.SelectedItems.Count - 1 & " - Bereite einfügen vor..."
Application.DoEvents()
'MessageBox.Show(System.Net.WebUtility.HtmlEncode(ListView1.SelectedItems(0).SubItems(0).Text))
'System.Net.WebUtility.HtmlEncode
' Dim strBeschreibung As String
' If chkImportKeineHTMLBeschreibung.Checked = False Then
strBeschreibung = HttpUtility.UrlEncode(HttpUtility.HtmlEncode(lvwMainData.SelectedItems(iCount).SubItems(4).Text))
' Else
' strBeschreibung = HttpUtility.UrlEncode(lvwMainData.SelectedItems(0).SubItems(0).Text)
' End If
'# Letztes zu importierendes Produkt?
If iCount = lvwMainData.SelectedItems.Count - 1 Then
strLast = "true"
Else
strLast = "false"
End If
Dim Post As String = "modus=system_shop_item_add&submodus=jtl2shopste&domain_id=" & My.Settings.SHOPSTE_domain_id & "&shop_item_beschreibung=" & strBeschreibung & "&shop_item_menge=" & lvwMainData.SelectedItems(iCount).SubItems(10).Text & "&shop_item_price=" & lvwMainData.SelectedItems(iCount).SubItems(9).Text.Replace(",", ".") & "&shop_item_name=" & HttpUtility.UrlEncode(lvwMainData.SelectedItems(iCount).SubItems(1).Text) & "&shop_item_duration=15&shop_item_mwst=" & lvwMainData.SelectedItems(iCount).SubItems(14).Text & "&shop_item_artikelnummer=" & lvwMainData.SelectedItems(iCount).SubItems(13).Text & "&gewicht=" & lvwMainData.SelectedItems(iCount).SubItems(15).Text.Replace(",", ".") & "&bLastItem=" & strLast & "&user=" & My.Settings.SHOPSTE_USERNAME & "&subshop_cat=" & strHTTPDataStore & "&shopste_cat=" & lvwMainData.SelectedItems(iCount).SubItems(16).Text & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD
'1 Eigenschaftname (1x)
'2 Eigenschaftswert (unbestimmt x)
' Clipboard.SetText(WebUtility.HtmlEncode(ListView1.SelectedItems(0).SubItems(5).Text))
'Dim postQuery As Byte() = System.Text.Encoding.ASCII.GetBytes("Post
Dim byteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(Post)
Request.ContentLength = byteArray.Length
Dim DataStream As System.IO.Stream = Request.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
DataStream = Response.GetResponseStream()
Dim reader As New System.IO.StreamReader(DataStream)
Dim ServerResponse As String = reader.ReadToEnd()
reader.Close()
DataStream.Close()
Response.Close()
If InStr(ServerResponse, "shopid") Then
Dim str() As String = ServerResponse.Split(":")
Dim strShopID As String = str(1)
'# Hat Artikel Eigenschaft
If Not lvwMainData.SelectedItems(iCount).SubItems(8).Text = 0 Then
Dim strEigenschaftAry() As String = lvwMainData.SelectedItems(iCount).SubItems(8).Text.Split(",")
Dim iLoop As Integer = 0
Dim bIN As Boolean = False
For iLoop = 0 To strEigenschaftAry.Length - 1
Dim strEigenschaftName As String = clsDB.getEigenschaft(strEigenschaftAry(iLoop))
Dim strEigenschaftWerte() As String = clsDB.getEigenschaft_wert(strEigenschaftAry(iLoop))
bIN = True
Dim iCount_loop As Integer = 0
If iLoop = 0 Then
'# Shopste Attributset anlegen
strInfo = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=setShopItem_eigenschaft_artibuteset&eigenschaftname=" & strEigenschaftName & "&domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.setShopItem_eigenschaft_artibuteset, False)
End If
'# Shopste Attributset mit Attribut verknüpfen
Dim strInfo1() As String = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=setShopItem_eigenschaft_name&attribute_set_id=" & strInfo(0) & "&eigenschaftname=" & strEigenschaftName & "&domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.setShopItem_eigenschaft_name, False)
'# Shopste Attribut dem Eigenschaftswert zuordnen
Dim strInfo2() As String = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=shop_item_eigenschaft&shop_attribute_id=" & strInfo1(0) & "&eigenschaft_name_de=" & strEigenschaftName & "&id_shop_item=" & strShopID & "&domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.shop_item_eigenschaft, False)
For iCount_loop = 0 To strEigenschaftWerte.Length - 1
If Not strEigenschaftWerte(iCount_loop) = Nothing Then
' MessageBox.Show(strEigenschaftWerte(iCount_loop))
'# Shopste Attribute mit Werten füllen
Dim strInfo4() As String = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=setShopItem_eigenschaft_value&shop_attribute_id=" & strInfo1(0) & "&value_de=" & strEigenschaftWerte(iCount_loop) & "&domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.setShopItem_eigenschaft_value, False)
'# Shopste Attribut dem Eigenschaftswert zuordnen
Dim strInfo3() As String = getHTTPResponseMessage(My.Settings.SHOPSTE_API_URL & "?modus=setShopItem_eigenschaftwert&shop_attribute_id=" & strInfo2(0) & "&eigenschaft_name_de=" & strEigenschaftWerte(iCount_loop) & "&id_shop_item=" & strShopID & "&shop_attribut_value_id=" & strInfo4(0) & "&domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD, mgetUpdaterMessage.setShopItem_eigenschaftwert, False)
'# Shopste Variationsartikel anlegen
End If
Next
Next
If bIN = True Then
Dim Post1 As String = "modus=api_attribute_combinations&attributset_id=" & strInfo(0) & "&shop_item_id=" & strShopID & "domain_id=" & My.Settings.SHOPSTE_domain_id & "&txtUsername=" & My.Settings.SHOPSTE_USERNAME & "&txtPasswort=" & My.Settings.SHOPSTE_PASSWORD
'# Kindartikel an Shopste übergeben
Call setPOST(Post1, "https://shopste.com/ACP/acp_shop_attribute_kombination.php")
End If
End If
'clsDatenbank_modul.setEiSoArtikelverwaltung_shopste_summary(lvwMainData.SelectedItems(0).Text, str(1), lvwMainData.SelectedItems(iCount).SubItems(9).Text)
' frmMain.master_Message_label.Text = iCount & " | " & lvwMainData.SelectedItems.Count - 1 & " - Shop ID:" & ServerResponse
If Not lvwMainData.SelectedItems(iCount).SubItems(11).Text.Length = 0 Then
Dim strFileName() As String = lvwMainData.SelectedItems(iCount).SubItems(11).Text.Split("/")
Dim nvc As New Specialized.NameValueCollection
nvc.Add("modus", "system_upload_file")
nvc.Add("domain_id", My.Settings.SHOPSTE_domain_id)
nvc.Add("benutzername", My.Settings.SHOPSTE_USERNAME)
nvc.Add("domain_pfad", My.Settings.SHOPSTE_domainname)