ReportController.cs
5.51 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
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
{
[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)
{
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
var lstUsageReport = dbContext.GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, 1, 5, spRecordCount).ToList();
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)
{
var lstCustomerSummeryReport = dbContext.GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry).ToList();
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)
{
var lstExpiringSubscriptionReport = dbContext.GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList();
return Ok(lstExpiringSubscriptionReport);
}
[Route("GetSubscriptionReport")]
[HttpGet]
public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId)
{
var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList();
return Ok(lstExpiringSubscriptionReport);
}
[Route("GetSubscriptionCancellationReport")]
[HttpGet]
public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId)
{
var lstExpiringSubscriptionReport = dbContext.GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList();
return Ok(lstExpiringSubscriptionReport);
}
[Route("GetNetAdSummaryReport")]
[HttpGet]
public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId)
{
try
{
var lstNetAdSummaryReport = dbContext.GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId).ToList();
return Ok(lstNetAdSummaryReport);
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetSiteLicenseUsageReport")]
[HttpGet]
public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition)
{
try
{
var lstSiteLicenseUsageReport = dbContext.GetSiteLicenseUsageReport(sFromDate, sToDate, sAccountNumber, (byte)iEdition).ToList();
return Ok(lstSiteLicenseUsageReport);
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetDiscountReport")]
[HttpGet]
public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber)
{
try
{
var lstDiscountReport = dbContext.GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber).ToList();
return Ok(lstDiscountReport);
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
[Route("GetImageExportReport")]
[HttpGet]
public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber)
{
try
{
if (sAccountNumber == null)
sAccountNumber = string.Empty;
var lstImageExportReport = dbContext.GetExportedImageDetails(sFromDate, sToDate, sAccountNumber).ToList();
return Ok(lstImageExportReport);
}
catch (Exception ex)
{
return Ok(ex.Message.ToString());
}
}
}
}