بخش هفتم: https://aparat.com/v/OtYvE
بخش هشتم: https://aparat.com/v/n0CQy
Dictionary 08.jpg
Dim TranslateIDs As String = ""
Select Case selectedLanguage
Case "en"
Dim EnRow As DictionaryDataSet.enRow = Me.ListBox1.SelectedItem
Dim faRow As DictionaryDataSet.faRow = Me.ListBox3.SelectedItem
TranslateIDs = Me.EnTableAdapter1.GetTranslateIDs(EnRow.ID)
If TranslateIDs.Contains(faRow.ID.ToString) Then
MsgBox("این مفهوم برای کلمه قبلا ثبت شده است!", MsgBoxStyle.Exclamation + MsgBoxStyle.MsgBoxRight)
GoTo NoAdd
End If
TranslateIDs = Me.EnTableAdapter1.GetTranslateIDs(EnRow.ID) + "," + faRow.ID.ToString
Me.EnTableAdapter1.UpdateQuery(TranslateIDs, EnRow.ID, EnRow.Word)
Me.ListBox2.Items.Add(faRow)
NoAdd:
TranslateIDs = Me.FaTableAdapter1.GetTranslateIDs(faRow.ID)
If TranslateIDs.Contains(EnRow.ID.ToString) Then
MsgBox("این مفهوم برای کلمه قبلا ثبت شده است!", MsgBoxStyle.Exclamation + MsgBoxStyle.MsgBoxRight)
Exit Select
End If
TranslateIDs = Me.FaTableAdapter1.GetTranslateIDs(faRow.ID) + "," + EnRow.ID.ToString
With Me.FaTableAdapter1
.UpdateQuery(TranslateIDs, faRow.ID, faRow.Word)
End With
Case "fa"
Dim EnRow As DictionaryDataSet.enRow = Me.ListBox3.SelectedItem
Dim faRow As DictionaryDataSet.faRow = Me.ListBox1.SelectedItem
TranslateIDs = Me.FaTableAdapter1.GetTranslateIDs(faRow.ID)
If TranslateIDs.Contains(EnRow.ID.ToString) Then
MsgBox("این مفهوم برای کلمه قبلا ثبت شده است!", MsgBoxStyle.Exclamation + MsgBoxStyle.MsgBoxRight)
GoTo NoAdd1
End If
TranslateIDs = Me.FaTableAdapter1.GetTranslateIDs(faRow.ID) + "," + EnRow.ID.ToString
With Me.FaTableAdapter1
.UpdateQuery(TranslateIDs, faRow.ID, faRow.Word)
End With
Me.ListBox2.Items.Add(EnRow)
NoAdd1:
TranslateIDs = Me.EnTableAdapter1.GetTranslateIDs(EnRow.ID)
If TranslateIDs.Contains(faRow.ID.ToString) Then
MsgBox("این مفهوم برای کلمه قبلا ثبت شده است!", MsgBoxStyle.Exclamation + MsgBoxStyle.MsgBoxRight)
Exit Select
End If
TranslateIDs = Me.EnTableAdapter1.GetTranslateIDs(EnRow.ID) + "," + faRow.ID.ToString
Me.EnTableAdapter1.UpdateQuery(TranslateIDs, EnRow.ID, EnRow.Word)
End Select