You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.0 KiB
101 lines
3.0 KiB
Imports System.IO
|
|
Public Class Dokumente
|
|
Inherits System.Web.UI.Page
|
|
|
|
Dim doknr As Integer
|
|
Dim dh As New clsDatahandling
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
Try
|
|
Update_Dokument()
|
|
Catch ex As Exception
|
|
End Try
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub btnNeu_Click(sender As Object, e As EventArgs) Handles btnNeu.Click
|
|
doknr = dh.Insert_Dokument(Me.txtBezeichnung.Text)
|
|
Me.RadComboBox1.DataBind()
|
|
|
|
End Sub
|
|
|
|
Private Sub RadComboBox1_DataBound(sender As Object, e As System.EventArgs) Handles RadComboBox1.DataBound
|
|
'Me.RadComboBox1.SelectedIndex = 0
|
|
Update_Dokument()
|
|
End Sub
|
|
|
|
Protected Sub RadComboBox1_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
|
|
Update_Dokument()
|
|
End Sub
|
|
Sub Update_Dokument()
|
|
Dim filename As String = Me.RadComboBox1.SelectedValue.ToString + ".rtf"
|
|
Dim ds As New DataSet
|
|
ds = dh.Get_Tabledata("select * from Web_Dokumenttexte where eintragnr=" + Me.RadComboBox1.SelectedValue.ToString, False, True)
|
|
Me.txtDokumenttitel.Text = ds.Tables(0).Rows(0).Item("Beschreibung")
|
|
Dim path As String = Server.MapPath("~/temp/")
|
|
filename = path + filename
|
|
If Not File.Exists(filename) Then
|
|
Try
|
|
File.Copy(path + "empty.rtf", filename, True)
|
|
Catch ex As Exception
|
|
Exit Sub
|
|
End Try
|
|
End If
|
|
Me.Editor1.LoadRTF(filename)
|
|
End Sub
|
|
|
|
|
|
Private Sub Editor1_PostBackCommand(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) Handles Editor1.PostBackCommand
|
|
Select Case e.CommandName
|
|
Case "Save"
|
|
Dim filename As String = Me.RadComboBox1.SelectedValue.ToString + ".rtf"
|
|
Dim path As String = Server.MapPath("~/temp/")
|
|
filename = path + filename
|
|
Me.Editor1.SaveRTF(filename)
|
|
' Me.Editor1.LoadRTF(filename)
|
|
dh.Save_rtf(Me.RadComboBox1.SelectedValue, filename, "")
|
|
dh.UpdateTable("Web_Dokumenttexte", "Beschreibung", Me.txtDokumenttitel.Text, True, "Eintragnr", Me.RadComboBox1.SelectedValue.ToString)
|
|
End Select
|
|
End Sub
|
|
|
|
' Hi
|
|
|
|
|
|
|
|
'I have follwing problem:
|
|
|
|
'I write a Text in the editor and change the font to Arial size 10.
|
|
|
|
|
|
|
|
'Souce
|
|
|
|
'<span style="font-family: Arial; font-size: 10pt;">Font Arial 10</span>
|
|
|
|
|
|
|
|
'After that I save it as an RTF-File and after I load the rtf-File, the size of the font chage to 13
|
|
|
|
|
|
|
|
'Result:
|
|
|
|
'<span style="font-family: arial; font-size: 13px;">Font Arial 10</span>
|
|
|
|
|
|
|
|
'Code to save and load - nothing between the two lines:
|
|
'Me.Editor1.SaveRTF(filename)
|
|
|
|
'Me.Editor1.LoadRTF(filename)
|
|
|
|
|
|
|
|
'Where is my mistake?
|
|
|
|
|
|
|
|
'Tank you very much.
|
|
|
|
'Kind Regards
|
|
End Class |