Current Directory:
\\10.5.0.10\iis\Sites\goprint2.com\www\
Contents:
Directories:
App_Code
App_Data
App_GlobalResources
App_LocalResources
App_WebReferences
articles
aspnet_client
Bin
common
designer
dillners
images
img
includes
kwikkopy
order_centre
printthree
RadControls
update
WebServices
Files:
about_us.aspx | Download
about_us.aspx.vb | Download
contact_us.aspx | Download
contact_us.aspx.vb | Download
create_user.aspx | Download
create_user.aspx.vb | Download
Default.aspx | Download
Default.aspx.vb | Download
discount.aspx | Download
discount.aspx.vb | Download
domain_activation.aspx | Download
domain_activation.aspx.vb | Download
downloadPD.aspx | Download
downloadPD.aspx.vb | Download
download_error.aspx | Download
download_error.aspx.vb | Download
email_policy.aspx | Download
email_policy.aspx.vb | Download
error_page.aspx | Download
error_page.aspx.vb | Download
faq.aspx | Download
faq.aspx.vb | Download
favicon.ico | Download
FileNotFound.htm | Download
generate_print_driver_step1.aspx | Download
generate_print_driver_step1.aspx.vb | Download
generate_print_driver_step2.aspx | Download
generate_print_driver_step2.aspx.vb | Download
generate_print_driver_step3.aspx | Download
generate_print_driver_step3.aspx.vb | Download
Global.asax | Download
header.fla | Download
header.swf | Download
home.aspx | Download
home.aspx.vb | Download
jsincluding.js | Download
login.aspx | Download
login.aspx.vb | Download
marcelito.txt | Download
packages.aspx | Download
packages.aspx.vb | Download
password_recovery.aspx | Download
password_recovery.aspx.vb | Download
PrintIt.master | Download
PrintIt.master.vb | Download
PrintIt.sitemap | Download
PrintItEs.sitemap | Download
PrintItFr.sitemap | Download
PrintIt_CreateUser.master | Download
PrintIt_CreateUser.master.vb | Download
PrintIt_OutSide.master | Download
PrintIt_OutSide.master.vb | Download
privacy_policy.aspx | Download
privacy_policy.aspx.vb | Download
proba.aspx | Download
proba.aspx.vb | Download
robots.txt | Download
sample.txt | Download
show_sess_par.aspx | Download
show_sess_par.aspx.vb | Download
site_map.aspx | Download
site_map.aspx.vb | Download
site_map.xml | Download
sRacadUploader.jar | Download
sRacadUploader_last.jar | Download
terms_and_conditions.aspx | Download
terms_and_conditions.aspx.vb | Download
terms_of_service.aspx | Download
terms_of_service.aspx.vb | Download
test.txt | Download
testimonials.aspx | Download
testimonials.aspx.vb | Download
TextDraw.html | Download
udraw-designer-widescreen-ui.zip | Download
web.config | Download
websites-for-printers.aspx | Download
websites-for-printers.aspx.vb | Download
File Preview:
Imports Telerik.WebControls
Partial Class includes_print_driver_interface_inc
Inherits System.Web.UI.UserControl
Private _webWS As New WebWS
Private _commonFunctions As CommonFunctions = New CommonFunctions()
Private _user As MembershipUser
Private _userProfile As ProfileCommon
Public _selectedLanguage As String = System.Threading.Thread.CurrentThread.CurrentUICulture.Name
Private _originator As String
Public Property Originator() As String
Get
Return _originator
End Get
Set(ByVal value As String)
_originator = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Session("lang") = _selectedLanguage
Me.Page.DataBind()
Dim script As String = "<SCRIPT LANGUAGE='JavaScript'>window.onload=function(){document.getElementById('PreviwLogoDiv').style.display = 'none';}</SCRIPT>"
Me.Page.RegisterClientScriptBlock("ClientScript", script)
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Or Session("EditUserFromManagement") Then
Dim _guid As Guid = New Guid(Request.QueryString("uid"))
_user = Membership.GetUser(_guid)
Else
_user = Membership.GetUser()
End If
_userProfile = Profile.GetProfile(_user.UserName)
If Not Page.IsPostBack Then
'dynamically fillThemeDropDownList according to current language
Dim ThemeDataSource As New SqlDataSource
ThemeDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("PrintItConnectionString").ConnectionString
ThemeDataSource.SelectCommandType = SqlDataSourceCommandType.Text
ThemeDataSource.SelectCommand = "select t.Theme, tl.ThemeName from PrintIT.dbo.PI_ThemePerLang tl, PrintIT.dbo.PI_Theme t " & _
" where tl.IDTheme=t.IDTheme and Language='" & _selectedLanguage & "'"
ThemeDropDownList.DataSource = ThemeDataSource
ThemeDropDownList.DataTextField = "ThemeName"
ThemeDropDownList.DataValueField = "Theme"
ThemeDropDownList.DataBind()
Try
Dim _dataSet As New System.Data.DataSet
_dataSet = _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId)
' if there is a record in the database
If _dataSet.Tables(0).Rows.Count > 0 Then
FrameTitleTextBox.Text = _dataSet.Tables(0).Rows(0).Item("FrameTitle")
ThankYouMessageTextBox.Text = _dataSet.Tables(0).Rows(0).Item("ThankYouMessage")
CompanyNameTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyName")
CompanyAddressTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyAddress")
CompanyPhoneTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyPhone")
CompanyEmailTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyEmail")
ThemeDropDownList.SelectedValue = _dataSet.Tables(0).Rows(0).Item("Theme").ToString().ToLower()
' if user is HeadOffice user - he is not allowed to upload logo
' TODO : eventually Head Office user will be able upload logo
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Then
CompanyLogoTR.Visible = False
Else ' user is not Head Office user
CompanyLogoTR.Visible = True
' check database record
If _dataSet.Tables(0).Rows(0).Item("CompanyLogo").ToString() = "" Then
PreviewLogoLabel.Visible = True
PreviewLogoLabel.Text = GetLocalResourceObject("NoLogoUploadedYet")
'PreviewLogoHyperLink.Visible = False
ShowHideLogo.Visible = False
WarnLabel.Visible = False
Else
PreviewLogoLabel.Visible = False
'PreviewLogoHyperLink.Visible = True
'PreviewLogoHyperLink.NavigateUrl = _dataSet.Tables(0).Rows(0).Item("CompanyLogo")
LogoImage.ImageUrl = _dataSet.Tables(0).Rows(0).Item("CompanyLogo")
ShowHideLogo.Visible = True
'Session("CompanyLogoTemp") = _dataSet.Tables(0).Rows(0).Item("CompanyLogo")
WarnLabel.Visible = False
'Dim _url = _dataSet.Tables(0).Rows(0).Item("CompanyLogo")
Dim _logoLocation As String = ConfigurationManager.AppSettings("PrintItStoreDataPath") & "\" & _userProfile.StoreId & "\" & _
_commonFunctions.GetDocumentName(_dataSet.Tables(0).Rows(0).Item("CompanyLogo").ToString.Split("//")(5), True, "/")
Dim imgObj As System.Drawing.Image = System.Drawing.Image.FromFile(_logoLocation)
Dim _width As Integer = imgObj.Width
If CType(_width, Integer) > 400 Then
LogoImage.Width = 400
End If
imgObj.Dispose()
End If
End If
Else ' if there is no record in data base
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Then
CompanyLogoTR.Visible = False
Else ' user is not Head Office user
CompanyLogoTR.Visible = True
PreviewLogoLabel.Visible = True
PreviewLogoLabel.Text = GetLocalResourceObject("NoLogoUploadedYet")
'PreviewLogoHyperLink.Visible = False
ShowHideLogo.Visible = False
WarnLabel.Visible = False
End If
End If
Catch ex As Exception
'Response.Write(ex.Message.ToString())
End Try
'Dim _logoLocation = ConfigurationManager.AppSettings("PrintItStoreDataPath") & "\" & _userProfile.StoreId & "\" & _
' _commonFunctions.GetDocumentName(Session("CompanyLogoTemp"), True, "\\")
'If System.IO.File.Exists(_logoLocation) Then
' LogoImage.ImageUrl = Session("CompanyLogoTemp")
' Dim imgObj As System.Drawing.Image = System.Drawing.Image.FromFile(_logoLocation)
' Dim _width = imgObj.Width
' If CType(_width, Integer) > 400 Then
' LogoImage.Width = 400
' End If
' imgObj.Dispose()
'End If
End If
End Sub
Protected Sub UpdateImageButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles UpdateImageButton.Click
Dim _resultMessage As String = ""
Try
Dim _companyLogo As String = ""
Dim inval As Integer = RadUpload2.InvalidFiles.Count 'check if there is invalid file
If inval > 0 Then
Exit Try
End If
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Or Session("EditUserFromManagement") Then
If _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows.Count > 0 Then
_companyLogo = _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows(0).Item("CompanyLogo").ToString()
End If
Else
If RadUpload2.UploadedFiles.Count > 0 Then
Dim _directory As String = ConfigurationManager.AppSettings("PrintItStoreDataPath") & "\" & _userProfile.StoreId
If System.IO.Directory.Exists(_directory) = False Then
Try
System.IO.Directory.CreateDirectory(_directory)
Catch ex As Exception
End Try
End If
Try
Dim _logoFile As String
For Each _logoFile In System.IO.Directory.GetFiles(_directory)
If (_logoFile.StartsWith(_directory & "\logo")) Then
'logFile.WriteLine("[Removing] " & _logoFile)
Try
System.IO.File.Delete(_logoFile)
Catch ex As Exception
End Try
End If
Next _logoFile
Catch ex As Exception
'logFile.WriteLine("[EXCEPTION] " & ex.Message)
Finally
'logFile.Close()
'logFile.Dispose()
End Try
Dim _file As UploadedFile
_file = RadUpload2.UploadedFiles.Item(0)
Dim _filename As String = "logo." & _commonFunctions.GetDocumentName(_file.GetName, True, "\\").ToString().Split(".")(1)
'_file.SaveAs(_directory & "\" & _file.GetName, True)
If System.IO.Directory.Exists(_directory) = True Then
Try
_file.SaveAs(_directory & "\" & _filename, True)
RadUpload2.UploadedFiles.Clear()
_companyLogo = Request.Url.ToString().Split("//")(0) & "/" & _
Request.Url.ToString().Split("//")(1) & "/" & _
(Request.Url.ToString().Split("//")(2).ToString()).Split(":")(0) & "/" & _
ConfigurationManager.AppSettings("PrintItStoreDataVirtualDirectory") & "/" & _
_userProfile.StoreId & "/" & _
_filename
_file = Nothing
' Now Head Office user can not upload image as a Company Logo
' The following condition added for future using
Catch ex As Exception
'Session.Remove("CompanyLogoTemp")
End Try
Else
' Session.Remove("CompanyLogoTemp")
End If
Else
If _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows.Count > 0 Then
_companyLogo = _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows(0).Item("CompanyLogo").ToString()
End If
End If
End If
If _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows.Count > 0 Then
_webWS.UpdatePrintDriverInterfaceByStoreId(_userProfile.StoreId, FrameTitleTextBox.Text, ThankYouMessageTextBox.Text, _
CompanyNameTextBox.Text, CompanyAddressTextBox.Text, CompanyPhoneTextBox.Text, CompanyEmailTextBox.Text, _
_companyLogo, ThemeDropDownList.SelectedValue.ToString().ToLower())
Else
'_companyLogo need to be fill if radupload is not empty
_webWS.InsertPrintDriverInterface(_userProfile.StoreId, FrameTitleTextBox.Text, ThankYouMessageTextBox.Text, _
CompanyNameTextBox.Text, CompanyAddressTextBox.Text, CompanyPhoneTextBox.Text, CompanyEmailTextBox.Text, _
_companyLogo, ThemeDropDownList.SelectedValue.ToString().ToLower())
End If
_resultMessage = GetLocalResourceObject("UpdateSuccess").ToString()
Catch ex As Exception
_resultMessage = GetLocalResourceObject("UpdateFailed").ToString() & " <br/>" & ex.Message.ToString()
Finally
If RadUpload2.InvalidFiles.Count > 0 Then _resultMessage = GetLocalResourceObject("UpdateFailed").ToString() & " <br/>" & GetLocalResourceObject("UploadLogo").ToString()
End Try
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Or Session("EditUserFromManagement") Then
Else
CompleteFormDiv.Visible = False
ResultDiv.Visible = True
ResultLabel.Text = _resultMessage
Try
Dim _headTag As New HtmlGenericControl
_headTag = CType(Me.Page.Master.FindControl("MasterHeadTag"), HtmlGenericControl)
Dim _metaRefreshTag As LiteralControl = New LiteralControl(_commonFunctions.MetaTag("print_driver_interface.aspx"))
_headTag.Controls.Add(_metaRefreshTag)
Catch ex As Exception
End Try
End If
End Sub
Protected Sub CancelImageButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles CancelImageButton.Click
Try
Dim _dataSet As New System.Data.DataSet
_dataSet = _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId)
If _webWS.GetPrintDriverInterfaceByStoreId(_userProfile.StoreId).Tables(0).Rows.Count > 0 Then
FrameTitleTextBox.Text = _dataSet.Tables(0).Rows(0).Item("FrameTitle")
ThankYouMessageTextBox.Text = _dataSet.Tables(0).Rows(0).Item("ThankYouMessage")
CompanyNameTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyName")
CompanyAddressTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyAddress")
CompanyPhoneTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyPhone")
CompanyEmailTextBox.Text = _dataSet.Tables(0).Rows(0).Item("CompanyEmail")
ThemeDropDownList.SelectedValue = _dataSet.Tables(0).Rows(0).Item("Theme").ToString().ToLower()
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Or Session("EditUserFromManagement") Then
CompanyLogoTR.Visible = False
Else
CompanyLogoTR.Visible = True
If _dataSet.Tables(0).Rows(0).Item("CompanyLogo").ToString() = "" Then
PreviewLogoLabel.Visible = True
PreviewLogoLabel.Text = GetLocalResourceObject("NoLogoUploadedYet")
ShowHideLogo.Visible = False
Else
LogoImage.ImageUrl = _dataSet.Tables(0).Rows(0).Item("CompanyLogo")
PreviewLogoLabel.Visible = False
ShowHideLogo.Visible = True
End If
End If
Else
FrameTitleTextBox.Text = ""
ThankYouMessageTextBox.Text = ""
CompanyNameTextBox.Text = ""
CompanyAddressTextBox.Text = ""
CompanyPhoneTextBox.Text = ""
CompanyEmailTextBox.Text = ""
ThemeDropDownList.SelectedIndex = 0
RadUpload2.UploadedFiles.Clear()
End If
Catch ex As Exception
End Try
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Session.Remove("lang")
End Sub
End Class