-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserDefinedFieldView.ascx.cs
More file actions
69 lines (66 loc) · 2.6 KB
/
Copy pathUserDefinedFieldView.ascx.cs
File metadata and controls
69 lines (66 loc) · 2.6 KB
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
/*
' Copyright (c) 2025 Joe Terhune
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/
using DotNetNuke.Abstractions;
using DotNetNuke.Services.Exceptions;
using Microsoft.Extensions.DependencyInjection;
using System;
using tjc.Modules.jacs.Components;
namespace tjc.Modules.jacs
{
/// -----------------------------------------------------------------------------
/// <summary>
/// The View class displays the content
///
/// Typically your view control would be used to display content or functionality in your module.
///
/// View may be the only control you have in your project depending on the complexity of your module
///
/// Because the control inherits from JACSModuleBase you have access to any custom properties
/// defined there, as well as properties from DNN such as PortalId, ModuleId, TabId, UserId and many more.
///
/// </summary>
/// -----------------------------------------------------------------------------
public partial class UserDefinedFieldView : JACSModuleBase
{
private readonly INavigationManager _navigationManager;
public UserDefinedFieldView()
{
_navigationManager = DependencyProvider.GetRequiredService<INavigationManager>();
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
navbar.ModuleContext = this;
navbar.ActiveLink = "lnkCourt";
if (UserId <= 0 || !UserInfo.IsAdmin)
{
Response.Redirect(_navigationManager.NavigateURL(), true);
}
if (!IsPostBack)
{
edit_hdCourtId.Value = CourtId.ToString();
var ctl = new CourtController();
var court=ctl.GetCourt(CourtId);
if (court != null)
{
ltCourtName.Text = court.description;
}
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
}