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:
Partial Class includes_edit_user_inc
Inherits System.Web.UI.UserControl
Private _user As MembershipUser
Private _userProfile As ProfileCommon
Private _commonFunctions As CommonFunctions = New CommonFunctions()
Private _webWS As New WebWS
Private partnerWS As PartnetWS.Service = New PartnetWS.Service
Private _originator As String
Private _currentUser As MembershipUser
Public Property Originator() As String
Get
Return _originator
End Get
Set(ByVal value As String)
_originator = value
End Set
End Property
Public Property CurrentUser() As MembershipUser
Get
Return _currentUser
End Get
Set(ByVal value As MembershipUser)
_currentUser = value
End Set
End Property
Protected Function PopulateCountryDDL(ByVal ddlName As DropDownList, ByVal firstItemText As String, ByVal selectedItemText As String) As Boolean
Try
Dim _dataSet As New System.Data.DataSet
_dataSet = _webWS.GetCountries()
Dim _tableReader As System.Data.DataTableReader
_tableReader = _dataSet.CreateDataReader()
Dim i As Integer = 0
Dim newListItem As ListItem
newListItem = New ListItem()
newListItem.Text = firstItemText
newListItem.Value = "0"
ddlName.Items.Add(newListItem)
Dim selectedIndex As Integer = 0
While _tableReader.Read()
i = i + 1
newListItem = New ListItem()
newListItem.Text = _tableReader.GetString(0)
newListItem.Value = _tableReader.GetValue(1)
ddlName.Items.Add(newListItem)
If _tableReader.GetString(0) = selectedItemText Then
ddlName.Items.Item(ddlName.Items.Count - 1).Selected = True
End If
End While
Return True
Catch ex As Exception
Return False
End Try
End Function
Protected Function PopulateStateDDL(ByVal ddlName As DropDownList, ByVal firstItemText As String, ByVal selectedItemText As String, ByVal countryId As Integer) As Boolean
Try
Dim _dataSet As New System.Data.DataSet
_dataSet = _webWS.GetStates(countryId)
Dim _tableReader As System.Data.DataTableReader
_tableReader = _dataSet.CreateDataReader()
Dim i As Integer = 0
Dim newListItem As ListItem
newListItem = New ListItem()
newListItem.Text = firstItemText
newListItem.Value = "0"
ddlName.Items.Add(newListItem)
Dim selectedIndex As Integer = 0
While _tableReader.Read()
i = i + 1
newListItem = New ListItem()
newListItem.Text = _tableReader.GetString(0)
newListItem.Value = _tableReader.GetValue(1)
ddlName.Items.Add(newListItem)
If _tableReader.GetString(0) = selectedItemText Then
ddlName.Items.Item(ddlName.Items.Count - 1).Selected = True
End If
End While
Return True
Catch ex As Exception
Return False
End Try
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Page.DataBind()
Dim _dataSet As System.Data.DataSet
Dim _pressType As String = ""
Dim _uid As String = Request.QueryString("uid")
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
CurrentUser = _user
UserNameLabel.Text = _user.UserName
_userProfile = Profile.GetProfile(_user.UserName)
If Not Page.IsPostBack Then
If _userProfile IsNot Nothing Then
'StoreId
If Me.Originator = "Admin" Or Me.Originator = "HeadOffice" Or Session("EditUserFromManagement") Then StoreIdLabel.Text = _userProfile.StoreId
'StoreName
StoreNameTextBox.Text = _userProfile.StoreName
'First Name
FNameTextBox.Text = _userProfile.FName
'Last Name
LNameTextBox.Text = _userProfile.LName
'Address
AddressTextBox.Text = _userProfile.Address
AddressTextBox1.Text = _userProfile.Address1
'City
CityTextBox.Text = _userProfile.City
'Country and State
If Session("EditUserFromManagement") Then
CountryTrAlt.Visible = True
CountryTr.Visible = False
CountryTextBox.Text = _userProfile.Country.ToString
CountryTextBox.Enabled = False
StateTrExist.Visible = True
StateTextBox.Text = _userProfile.State.ToString
StateTextBox.Enabled = False
StoreIdTR.Visible = True
StoreIdHeader.Visible = False
AccountNumber.Visible = True
UserNameTR.Visible = False
Else
If _userProfile.Country.ToString <> "" Then
CountryTrAlt.Visible = True
CountryTr.Visible = False
CountryTextBox.Text = _userProfile.Country
StateTrExist.Visible = True
StateTextBox.Text = _userProfile.State
Else
PopulateCountryDDL(CountryDropDownList, GetLocalResourceObject("SelectCountry"), GetLocalResourceObject("SelectCountry"))
CountryTrAlt.Visible = False
CountryTr.Visible = True
StateTrExist.Visible = False
End If
End If
'Postal code
ZipTextBox.Text = _userProfile.Zip
'Phone
PhoneTextBox.Text = _userProfile.Phone
'Phone Extantion
ExtTextBox.Text = _userProfile.PhoneExt
'Fax
FaxTextBox.Text = _userProfile.Fax
'PressType
If Me.Originator <> "HeadOffice" Then
Try
_pressType = _webWS.GetPressTypeByPressTypeId(_userProfile.PressTypeId).Tables(0).Rows(0).Item("PressType").ToString
Catch ex As Exception
End Try
TypePressLabel.Text = _pressType
TypePressTr.Visible = True
End If
If Me.Originator = "Admin" Then
HeadOfficeTr.Visible = True
'PopulateCountryDDL(CountryDropDownList, GetLocalResourceObject("SelectCountry"), GetLocalResourceObject("SelectCountry"))
'CountryTrAlt.Visible = False
'CountryTr.Visible = True
'StateTrExist.Visible = False
Dim _roles() As String = Roles.GetRolesForUser(_user.UserName)
For Each _role As String In _roles
If _role = "HeadOffice" Then
HeadOfficeCheckBox.Checked = True
End If
Next
End If
'Email
EmailTextBox.Text = _user.Email
If Me.Originator = "Admin" Then
'Expiration Date
If _userProfile.ExpirationDate.ToString() <> "" Then
ExpirationDateTextBox.Text = Format(CType(_userProfile.ExpirationDate, Date), "MM/dd/yyyy").ToString()
End If
_dataSet = _webWS.GetActivationDataSetByUserId(_user.ProviderUserKey)
'Activation Id
If _dataSet.Tables(0).Rows.Count > 0 Then
ActivationIdTextBox.Text = _dataSet.Tables(0).Rows(0).Item("ActivationId").ToString()
Else
ActivationIdTextBox.Text = Guid.NewGuid().ToString()
End If
'StartBillingDate
StartBillingDateTextBox.Text = _userProfile.StartBillingDate
End If
End If
End If
If Me.Originator = "Admin" Then
'btnCancel.OnClientClick = "CancelEdit()"
UserIDTextBox.Text = _user.ProviderUserKey.ToString
UserIdTR.Visible = True
StoreIdTR.Visible = True
ActivationIdTR.Visible = True
ExpirationDateTR.Visible = True
StartBillingDateTR.Visible = True
BreakTR.Visible = True
End If
End Sub
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnUpdate.Click
Dim _isEditAllowed As Boolean = True
If Not Session("PartnerId") Is Nothing Then
Try
Dim _userIdForEdit As String = _user.ProviderUserKey.ToString
Dim _affUserId As String = Session("PartnerId")
_isEditAllowed = partnerWS.isEditAllowed(Session("PartnerId"), _user.ProviderUserKey.ToString)
Catch ex As Exception
_isEditAllowed = False
End Try
End If
Dim _resultMessage As String = ""
Dim _success As Boolean = True
Dim _oldEmail As String = ""
Dim _oldStartBillingDate As Date
If _isEditAllowed Then
'If Session("EditUserFromAdmin") = True Then
' Dim _guid = New Guid(Request.QueryString("uid"))
' _user = Membership.GetUser(_guid)
'Else
' _user = Membership.GetUser()
'End If
If Page.IsValid = True Then
If _userProfile Is Nothing Then
Try
ProfileBase.Create(_user.UserName)
Catch ex As Exception
_resultMessage = "Unable to create User Profile due to the following reason: <br/>" & ex.Message.ToString()
_success = False
End Try
End If
If _success Then
Try
_success = False
_oldStartBillingDate = _userProfile.StartBillingDate
_oldEmail = _user.Email
_user.Email = EmailTextBox.Text
'Membership.UpdateUser(_user)
_webWS.UpdateUserEmailByUserId(_user.ProviderUserKey, _user.Email)
_success = True
_userProfile.StoreName = StoreNameTextBox.Text
_userProfile.FName = FNameTextBox.Text
_userProfile.LName = LNameTextBox.Text
_userProfile.Address = AddressTextBox.Text
If String.IsNullOrEmpty(AddressTextBox1.Text) = False Then _userProfile.Address1 = AddressTextBox1.Text Else _userProfile.Address1 = "--"
_userProfile.City = CityTextBox.Text
If CountryTr.Visible = True Then
_userProfile.Country = CountryDropDownList.SelectedItem.Text
If StateTr.Visible = True Then
_userProfile.State = StateDropDownList.SelectedItem.Text
ElseIf StateTrAlt.Visible = True Then
_userProfile.State = StateTextBoxAlt.Text
End If
End If
_userProfile.Zip = ZipTextBox.Text
_userProfile.Phone = PhoneTextBox.Text
If String.IsNullOrEmpty(ExtTextBox.Text) = False Then _userProfile.PhoneExt = ExtTextBox.Text Else _userProfile.PhoneExt = "--"
If String.IsNullOrEmpty(FaxTextBox.Text) = False Then _userProfile.Fax = FaxTextBox.Text Else _userProfile.Fax = "--"
If Me.Originator = "Admin" Then
_userProfile.ExpirationDate = Format(CType(ExpirationDateTextBox.Text, Date), "MM/dd/yyyy")
_userProfile.StartBillingDate = Format(CType(StartBillingDateTextBox.Text, Date), "MM/dd/yyyy")
End If
_userProfile.Save()
If CountryTrAlt.Visible = False Then 'if user choose Argentina or Urugvai and do not have Affiliate than create a link for Graven
Dim returnCode As String = partnerWS.registerPartnerByCountry(_userProfile.Country, _user.ProviderUserKey.ToString())
CountryTrAlt.Visible = True
If StateTr.Visible = True Then
StateTr.Visible = False
Else
StateTrAlt.Visible = False
End If
End If
'If _webWS.GetActivationDataSetByUserId(_user.ProviderUserKey).Tables(0).Rows.Count > 0 Then
'_webWS.UpdateActivationByUserId(_user.ProviderUserKey, ActivationIdTextBox.Text)
'Else
'_webWS.InsertActivation(_user.ProviderUserKey, Profile.StoreId, ActivationIdTextBox.Text, True)
'End If
_resultMessage = GetLocalResourceObject("UpdateSuccess").ToString()
Catch ex As Exception
If _success = True Then
_user.Email = _oldEmail.ToString() 'if there is an error during update user_profile, then rollback changing e-mail
'Membership.UpdateUser(_user)
_webWS.UpdateUserEmailByUserId(_user.ProviderUserKey, _user.Email)
_userProfile.StartBillingDate = _oldStartBillingDate
_userProfile.Save()
End If
_resultMessage = GetLocalResourceObject("UpdateFailed").ToString() & ex.Message.ToString()
End Try
End If
If _userProfile.Country.ToString <> "" Then ' if user entered and saved UserProfile,make the fields Country and Province not editable
CountryTrAlt.Visible = True
CountryTr.Visible = False
CountryTextBox.Text = _userProfile.Country
StateTrExist.Visible = True
StateTextBox.Text = _userProfile.State
End If
Else
_resultMessage = "The email is already in use!"
End If
If Me.Originator = "Admin" Or Session("EditUserFromManagement") Then
'InjectScript.Text = "<script type='text/javascript'>CloseAndRebind()</" + "script>"
ResultDiv.Visible = True
ResultLabel.Text = _resultMessage
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("user_profile.aspx"))
_headTag.Controls.Add(_metaRefreshTag)
Catch ex As Exception
End Try
End If
If Me.Originator = "Admin" Then
If HeadOfficeCheckBox.Checked Then
If Not Roles.IsUserInRole(_user.UserName, "HeadOffice") Then
Roles.AddUserToRole(_user.UserName, "HeadOffice")
End If
Else
If Roles.IsUserInRole(_user.UserName, "HeadOffice") Then
Roles.RemoveUserFromRole(_user.UserName, "HeadOffice")
End If
End If
End If
Else
_resultMessage = "You are not allowed to edit User Profile"
CompleteFormDiv.Visible = False
ResultDiv.Visible = True
ResultLabel.Text = _resultMessage
End If
End Sub
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnCancel.Click
'If Session("EditUserFromAdmin") = False Then
_userProfile = Profile.GetProfile(_user.UserName)
If _userProfile IsNot Nothing Then
'StoreIdTextBox.Text = _userProfile.StoreId
StoreNameTextBox.Text = _userProfile.StoreName
FNameTextBox.Text = _userProfile.FName
LNameTextBox.Text = _userProfile.LName
AddressTextBox.Text = _userProfile.Address
AddressTextBox1.Text = _userProfile.Address1
CityTextBox.Text = _userProfile.City
If _userProfile.Country.ToString <> "" Then 'if Country empty than clear country and state
CountryTrAlt.Visible = True
CountryTr.Visible = False
CountryTextBox.Text = _userProfile.Country
StateTrExist.Visible = True
StateTextBox.Text = _userProfile.State
Else
'PopulateCountryDDL(CountryDropDownList, GetLocalResourceObject("SelectCountry"), GetLocalResourceObject("SelectCountry"))
CountryTrAlt.Visible = False
CountryTr.Visible = True
CountryDropDownList.SelectedValue = "0"
StateTr.Visible = False
StateTrAlt.Visible = False
StateTrExist.Visible = False
StateTextBoxAlt.Text = ""
End If
ZipTextBox.Text = _userProfile.Zip
PhoneTextBox.Text = _userProfile.Phone
ExtTextBox.Text = _userProfile.PhoneExt
FaxTextBox.Text = _userProfile.Fax
StartBillingDateTextBox.Text = _userProfile.StartBillingDate
End If
EmailTextBox.Text = _user.Email
'End If
If Me.Originator = "Admin" = True Then
If _userProfile.ExpirationDate.ToString() <> "" Then
ExpirationDateTextBox.Text = Format(CType(_userProfile.ExpirationDate, Date), "MM/dd/yyyy").ToString()
End If
Dim _dataSet As System.Data.DataSet = _webWS.GetActivationDataSetByUserId(_user.ProviderUserKey)
If _dataSet.Tables(0).Rows.Count > 0 Then
ActivationIdTextBox.Text = _dataSet.Tables(0).Rows(0).Item("ActivationId").ToString()
Else
ActivationIdTextBox.Text = Guid.NewGuid().ToString()
End If
End If
' InjectScript.Text = "<script type='text/javascript'>CancelEdit()</script>"
'
End Sub
Protected Sub CountryDropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CountryDropDownList.SelectedIndexChanged
' Dim _state As DropDownList = CType((Wizard1.FindControl("StateDropDownList"), DropDownList)
If CountryDropDownList.Items.Item(0).Selected = True Then
StateTr.Visible = False
StateTrAlt.Visible = False
StateTrExist.Visible = False
ElseIf CountryDropDownList.SelectedItem.Text = "Canada" Or CountryDropDownList.SelectedItem.Text = "USA" Then
StateDropDownList.Items.Clear()
PopulateStateDDL(StateDropDownList, GetLocalResourceObject("SelectState"), GetLocalResourceObject("SelectState"), CountryDropDownList.SelectedValue)
StateTr.Visible = True
StateTrAlt.Visible = False
StateTrExist.Visible = False
Else
StateTr.Visible = False
StateTrAlt.Visible = True
StateTrExist.Visible = False
End If
StateTextBoxAlt.Text = "" 'clear State when user change Country
End Sub
End Class