-
Notifications
You must be signed in to change notification settings - Fork 20
/
ExportCSV.ascx
110 lines (102 loc) · 4.98 KB
/
ExportCSV.ascx
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<%@ Control Language="C#" CodeBehind="ExportCSV.ascx.cs" Inherits="DotNetNuke.Modules.UserDefinedTable.ExportCsv" AutoEventWireup="false" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnCssInclude runat="server" FilePath="~/Resources/Shared/components/TimePicker/Themes/jquery-ui.css" />
<dnn:DnnCssInclude runat="server" FilePath="~/Resources/Shared/components/TimePicker/Themes/jquery.ui.theme.css" />
<div class="dnnForm">
<div class="dnnFormItem">
<dnn:Label ID="plFolder" runat="server" ControlName="cboFolders" Suffix=":" />
<asp:DropDownList ID="cboFolders" runat="server" CssClass="NormalTextBox" Width="300" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="plFile" runat="server" ControlName="txtFile" Suffix=":" />
<asp:TextBox ID="txtFile" CssClass="NormalTextBox" runat="server" MaxLength="200"
Width="300" />
</div>
<div class="dnnFormItem">
<dnn:label id="plDelimiter" runat="server" controlname="rblDelimiter" suffix=":" />
<asp:RadioButtonList ID="rblDelimiter" runat="server" RepeatDirection="Horizontal"
CssClass="dnnFormRadioButtons ">
<asp:ListItem Selected="True" Value="," resourcekey="comma"></asp:ListItem>
<asp:ListItem Value=";" resourcekey="semicolon"></asp:ListItem>
</asp:RadioButtonList>
</div>
<div class="dnnFormItem">
<dnn:label id="plSystemFields" runat="server" controlname="cbSystemFields" />
<asp:CheckBox ID="cbSystemFields" runat="server" />
</div>
<div class="dnnFormItem">
<dnn:label id="plInitialDate" runat="server" controlname="txtInitialDate" />
<asp:TextBox ID="txtInitialDate" CssClass="NormalTextBox" runat="server" MaxLength="200"
Width="300" onchange="TriggerChanges();" />
</div>
<div>
</div>
<div class="dnnFormItem">
<dnn:label id="plFinalDate" runat="server" controlname="txtFinalDate" />
<asp:TextBox ID="txtFinalDate" CssClass="NormalTextBox" runat="server" MaxLength="200"
Width="300" onchange="TriggerChanges();" />
</div>
<div class="dnnFormItem">
<dnn:label id="plDatesValidator" value="" runat="server" controlname="cvtxtStartDate" />
<asp:CompareValidator id="compareValidatorDates" runat="server"
ControlToCompare="txtInitialDate" cultureinvariantvalues="true"
display="Dynamic" enableclientscript="true"
ControlToValidate="txtFinalDate"
type="Date" Operator="GreaterThanEqual"
CssClass="validator-error" resourcekey="errorDateMessage" >
</asp:CompareValidator>
<asp:CustomValidator id="CustomValidatorDates"
ControlToValidate="txtInitialDate"
ClientValidationFunction="ValidateDatesClient"
Display="Dynamic"
runat="server"
resourcekey="customDateMessage" CssClass="validator-error"/>
</div>
<ul class="dnnActions dnnClear">
<li>
<asp:LinkButton ID="cmdExport" resourcekey="cmdExport" runat="server" CssClass="dnnPrimaryAction"
Text="Export" BorderStyle="none"></asp:LinkButton></li>
<li>
<asp:LinkButton ID="cmdCancel" resourcekey="cmdCancel" runat="server" CssClass="dnnSecondaryAction"
Text="Cancel" BorderStyle="none" CausesValidation="False"></asp:LinkButton></li>
</ul>
</div>
<script>
$(function () {
$("#<%= txtInitialDate.ClientID %>").datepicker({
dateFormat: "yy/mm/dd",
showButtonPanel: true,
closeText: 'Clear',
onClose: function () {
var event = arguments.callee.caller.caller.arguments[0];
if ($(event.delegateTarget).hasClass('ui-datepicker-close')) {
$(this).val('');
TriggerChanges();
}
}
});
$("#<%= txtFinalDate.ClientID %>").datepicker({
dateFormat: "yy/mm/dd",
showButtonPanel: true,
closeText: 'Clear',
onClose: function () {
var event = arguments.callee.caller.caller.arguments[0];
if ($(event.delegateTarget).hasClass('ui-datepicker-close')) {
$(this).val('');
TriggerChanges();
}
}
});
});
function TriggerChanges() {
ValidatorValidate(document.getElementById('<%= CustomValidatorDates.ClientID %>'));
}
function ValidateDatesClient(source, arguments) {
if (($("#<%= txtInitialDate.ClientID %>").val().length == 0 && $("#<%= txtFinalDate.ClientID %>").val().length == 0) || ($("#<%= txtInitialDate.ClientID %>").val().length > 0 && $("#<%= txtFinalDate.ClientID %>").val().length > 0)) {
arguments.IsValid = true;
} else {
arguments.IsValid = false;
}
}
</script>