ReportController.cs
7.74 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using AIAHTML5.ADMIN.API.Models;
using System.Web.Http.Cors;
using System.Web.Cors;
using AIAHTML5.Server.Constants;
using log4net;
using System.Text;
using AIAHTML5.ADMIN.API.Entity;
namespace AIAHTML5.ADMIN.API.Controllers
{
//[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")]
[RoutePrefix("Report")]
public class ReportController : ApiController
{
AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities();
[Route("GetUsageReport")]
[HttpGet]
public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstUsageReport = dbContext.usp_GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { UserUsage = lstUsageReport, RecordCount = spRecordCount.Value });
//return Ok(lstUsageReport);
}
[Route("GetCustomerSummeryReport")]
[HttpGet]
public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable<decimal> iStartPrice, Nullable<decimal> iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstCustomerSummeryReport = dbContext.usp_GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { CustomerSummery = lstCustomerSummeryReport, RecordCount = spRecordCount.Value });
//return Ok(lstCustomerSummeryReport);
}
[Route("GetExpiringSubscriptionReport")]
[HttpGet]
public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstExpiringSubscriptionReport = dbContext.usp_GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { ExpiringSubscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value });
}
[Route("GetSubscriptionReport")]
[HttpGet]
public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { Subscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value });
}
[Route("GetSubscriptionCancellationReport")]
[HttpGet]
public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstExpiringSubscriptionReport = dbContext.usp_GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { SubscriptionCancel = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value });
}
[Route("GetNetAdSummaryReport")]
[HttpGet]
public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int pageNo, int pageLength)
{
try
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstNetAdSummaryReport = dbContext.usp_GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { NetAdSubscriptionList = lstNetAdSummaryReport, RecordCount = spRecordCount.Value });
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetSiteLicenseUsageReport")]
[HttpGet]
public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition, int iloginTypeId, int pageNo, int pageLength)
{
try
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, (byte)iloginTypeId, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { SiteLicenseUsageList = lstSiteLicenseUsageReport, RecordCount = spRecordCount.Value });
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetDiscountReport")]
[HttpGet]
public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber, int pageNo, int pageLength)
{
try
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstDiscountReport = dbContext.usp_GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { DiscountReportList = lstDiscountReport, RecordCount = spRecordCount.Value });
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetImageExportReport")]
[HttpGet]
public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber, string sortColumn, string sortOrder, int pageNo, int pageLength)
{
try
{
if (sAccountNumber == null) sAccountNumber = string.Empty;
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstImageExportReport = dbContext.usp_GetExportedImageDetails(sFromDate, sToDate, sAccountNumber, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList();
return Ok(new { ImageExportList = lstImageExportReport, RecordCount = spRecordCount.Value });
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
}
}