I am calling Report/Index from User/Index
Here is my code
Report Controller
[Authorize]
public ActionResult Index()
{
ZipcodesDataHelper zipData = new ZipcodesDataHelper();
ViewBag.ZipList = new SelectList(zipData.xperdev_scanner().Distinct(), "zip", "primary_city");
TourDataHelper tourData = new TourDataHelper();
ViewBag.TourList = new SelectList(tourData.RetrieveDefaultTourData().OrderBy(m=>m.Tour_Name), "Tour_ID", "Tour_Name");
EventDataHelper eventData = new EventDataHelper();
ViewBag.EventList = new SelectList(eventData.GetEventListwithDefaultAll(tourData.RetrieveDefaultTourData().OrderBy(m => m.Tour_Name).FirstOrDefault().Tour_Id).OrderBy(m=>m.Event_Name), "Event_Id", "Event_Name");
return View();
}
Index View
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
$(document).ready(function () {
$('#datetimepicker2').datepicker({
dateFormat: 'dd-mm-yy',
altField: '#thealtdate',
altFormat: 'yy-mm-dd'
});
$('#datetimepicker1').datepicker({
dateFormat: 'dd-mm-yy',
altField: '#thealtdate',
altFormat: 'yy-mm-dd'
});
var value = 0
$("#myimg").click(function () {
$("#showorhide").toggle();
value +=180;
$(this).rotate({ animateTo:value});
});
});
function getRegisterationView() {
// selectedEvent when event option is selected
if ($('#eventList :selected').length > 0) {
var selectednumbers = [];
var selectedEvent;
$('#eventList :selected').each(function (i, selected) {
selectednumbers.push($(selected).val());
});
selectedEvent = selectednumbers.join(",");
}
// selectedtour when All event in selected tour option is selected
if ($('#TourList :selected').length > 0) {
var selectedtournumbers = [];
var selectedtour;
$('#TourList :selected').each(function (i, selected) {
selectedtournumbers.push($(selected).val());
});
selectedtour = selectedtournumbers.join(",");
}
var dupCnt = $('#txtDup').val();
// startDate = $('#datetimepicker1').val();
// endDate = $('#datetimepicker2').val();
$.ajax({
url: getUrlForRegisteration,
contentType: "application/html; charset=utf-8",
data: {
eventid: selectedEvent,
tourid: selectedtour,
dupCount: dupCnt
},
type: "GET",
dataType: "html"
})
.success(function (result) {
$('#dvRegisteration').html(result);
})
.error(function () {
});
}
function myfun() {
$(".my_spinner").show("my_spinner");
}
.my_spinner {
text-align: center;
display: none;
padding: 80px 0px 0px 0px;
transition: all 0.4s ease-out;
}
.my_spinner img {
width: 6%;
}
img#myimg {
border: 1px solid #2d8dff;
padding: 5px;
min-height: 20px !important;
max-width: 25px;
max-height: 25px;
margin: 15px 0 0 16px;
}
.search_btn button#btnsearch {
padding: 10px 50px;
}
.search_btn {
text-align: center;
}
.content_tab_div_lable_div {
column-count: 5;
column-gap: 10px;
border: 1px solid #ccc;
margin: 16px;
border-radius: 5px;
padding: 10px;
line-height: 2;
}
.content_tab_div_lable_div label:first-child {
position: relative;
left: 10px;
}
span.fa.fa-check {
border: 1px solid #a0a0a0;
margin-right: 5px;
}
.page-breadcrumbs {
display: none;
}
nav.navbar.navbar-default {
display: none;
}
var getUrlForRegisteration = "@(Url.Action("Registeration","Report"))";
var eventUrl = "@(Url.Action("getEventList", "Report"))";
var tourUrl = "@(Url.Action("getTourList", "Report"))";
$(document).on('click', '#btnsearch', function () {
// alert(1);
getRegisterationView();
this.disabled = true;
});
Event Reporting
@*
Click to select a tour based on the available list. once a tour is selected the below table is populated with the information
*@Duplicate Threshold
@*
Click to select a tour based on the available list. once a tour is selected the below table is populated with the information
*@Tour
@Html.DropDownList("TourList", (IEnumerable)ViewBag.TourList, new { @class = " form-control", @onChange = "fillEvent();" })
@*
From Date
To Date
Event
@Html.DropDownList("eventList", (IEnumerable)ViewBag.EventList, new { @class = "report_filter_tour_list form-control ", @id = "eventList" })
@**@
Report Type
Preset
@*
*@
@**@
Include Pre-Registrations
Include Opt-Ins
Include Multi-Lingual Data
Include Pre-Registrations
Include Handraisers
Include Paper Lead-Data
Include Brochure Counts
Include Error Record Count
Number of Unique Leads Requesting Brochure
Include Non-Verified Emails
Include Handraisers
Include Avg. Brochure Requests Per Lead
Include Test Leads

function fillEvent() {
// alert(1);
var selText = $("#TourList option:selected").val();
// alert(selText);
$.ajax({
url: eventUrl,
type: "GET",
data: { tourCode: selText },
dataType: "JSON",
success: function (country) {
//var data = JSON.parse(country);
//alert(data);
$("#eventList").html("");
// clear before appending new list
$.each(country, function (i, ctry) {
$("#eventList").append(
$('').val(ctry.event_id).html(ctry.event_name));
});
// getIntercallInfo();
}
});
}
function fillTour() {
// alert(1);
//var selText = $("#ZipList option:selected").val();
// alert(selText);
$.ajax({
url: tourUrl,
type: "GET",
//data: { zipCode: selText },
dataType: "JSON",
success: function (tour) {
//var data = JSON.parse(country);
//alert(data);
$("#tourList").html("");
// clear before appending new list
$.each(tour, function (i, tur) {
$("#tourList").append(
$('').val(tur.tour_id).html(tur.tour_name));
});
// getIntercallInfo();
}
});
}

Vincent Maverick DuranoPosted May 23, 2018, 4:17 PM
Nilesh PatilPosted May 23, 2018, 4:44 AM
Vincent Maverick DuranoPosted May 23, 2018, 4:19 AM