Commit 19dea4d45dfb309d84d841d004e26f38aa9e1f2f
1 parent
c2e13af5
Sp commit
Showing
28 changed files
with
1608 additions
and
484 deletions
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSubscriptionPlan.sql
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetEditions.sql
0 → 100644
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseById.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | |
2 | +GO | |
3 | +SET ANSI_NULLS ON | |
4 | +GO | |
5 | + | |
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetLicenseById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | |
7 | +drop procedure [dbo].[usp_GetLicenseById] | |
8 | +GO | |
9 | +-- ==================================================== | |
10 | +-- Author: Magic Software | |
11 | +-- Create date: 29-Jan-2018 | |
12 | +-- Description: To get a license information on the basis of LicenseId | |
13 | +-- ==================================================== | |
14 | +create PROCEDURE [dbo].[usp_GetLicenseById] | |
15 | + -- Add the parameters for the stored procedure here | |
16 | + @Id int | |
17 | +AS | |
18 | +BEGIN | |
19 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
20 | + -- interfering with SELECT statements. | |
21 | + SET NOCOUNT ON; | |
22 | + | |
23 | + declare @SubscriptionStartDate datetime, @SubscriptionEndDate datetime, @NoOfImages int, @TotalAmount money, @RenewalDate datetime, | |
24 | + @SiteIp varchar(100), @SiteIpTo varchar(100), @SiteMasterIPTo varchar(100); | |
25 | + declare @UserId int, @Login varchar(100), @Password varchar(100), @SecurityQuestionId int, @Answer varchar(100); | |
26 | + declare @EditionId int, @TotalLogins int; | |
27 | + declare @EditionLoginText varchar(1000); | |
28 | + | |
29 | + declare CurEditionLogin cursor for | |
30 | + select EditionId, TotalLogins from LicenseToEdition where LicenseId = @Id; | |
31 | + | |
32 | + set @EditionLoginText = ''; | |
33 | + open CurEditionLogin | |
34 | + fetch NEXT FROM CurEditionLogin into @EditionId, @TotalLogins | |
35 | + while @@FETCH_STATUS = 0 | |
36 | + begin | |
37 | + set @EditionLoginText = @EditionLoginText + convert(varchar(5), @EditionId) + '-' + convert(varchar(5), @TotalLogins) + '|'; | |
38 | + fetch NEXT FROM CurEditionLogin into @EditionId, @TotalLogins | |
39 | + end | |
40 | + CLOSE CurEditionLogin | |
41 | + DEALLOCATE CurEditionLogin | |
42 | + set @EditionLoginText = SUBSTRING(@EditionLoginText, 1, len(@EditionLoginText) - 1); | |
43 | + | |
44 | + select top 1 | |
45 | + @SubscriptionStartDate = LSD.SubscriptionValidFrom, | |
46 | + @SubscriptionEndDate = LSD.SubscriptionValidThrough, | |
47 | + @RenewalDate = LSD.RenewalDate, | |
48 | + @NoOfImages = LSD.NoofImages, | |
49 | + @TotalAmount = LSD.TotalAmount | |
50 | + from LicenseSubscriptionDetail LSD where LSD.LicenseId = @Id order by LSD.Id desc; | |
51 | + | |
52 | + select top 1 @SiteIp = S.SiteIP, @SiteIpTo = S.SiteIPTo, @SiteMasterIPTo = S.SiteMasterIPTo from Site S | |
53 | + inner join SiteToLicenseEdition SLE ON S.Id = SLE.SiteId | |
54 | + inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id | |
55 | + where LE.LicenseId = @Id and S.IsMaster = 1 AND S.IsActive = 1 order by SLE.SiteId desc; | |
56 | + | |
57 | + select top 1 @UserId = US.Id, @Login = US.LoginId, @Password = US.Password, @SecurityQuestionId = US.SecurityQuestionId, | |
58 | + @Answer = US.SecurityAnswer from AIAUserToLicenseEdition UL inner join LicenseToEdition LE on UL.LicenseEditionId = LE.Id | |
59 | + inner join AIAUser US on UL.UserId = US.Id where LE.LicenseId = @Id order by LE.Id desc; | |
60 | + | |
61 | + select L.Id, L.LicenseTypeId, L.AccountNumber, L.AccountTypeId, L.Address1, L.Address2, L.LicenseeFirstName, L.LicenseeLastName, L.City, | |
62 | + L.CountryId, L.StateId, L.EmailId, L.InstitutionName, L.Phone, L.ProductId, L.Zip, L.TotalLogins, @EditionLoginText as EditionLogins, | |
63 | + @SubscriptionStartDate as SubscriptionStartDate, @SubscriptionEndDate as SubscriptionEndDate, @NoOfImages as NoOfImages, @TotalAmount as Price, | |
64 | + @SiteIp as SiteUrl, @SiteIpTo as SitToUrl, @SiteMasterIPTo as SiteMasterUrl, @UserId as UserId, @Login as Login, @Password as Password, | |
65 | + @SecurityQuestionId as SecurityQuestionId, @Answer as Answer, L.NoOfRenewals as TotalRenewals, @RenewalDate as RenewalDate, L.IsActive | |
66 | + from License L where L.Id = @Id; | |
67 | + | |
68 | +END | |
69 | + | |
70 | +GO | |
71 | +SET QUOTED_IDENTIFIER OFF | |
72 | +GO | |
73 | +SET ANSI_NULLS ON | |
74 | +GO | |
0 | 75 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseTypes.sql
0 → 100644
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql
0 → 100644
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSubscriptionPlans.sql
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertSubscriptionPlan.sql
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateSubscriptionPlan.sql
400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj
... | ... | @@ -135,6 +135,7 @@ |
135 | 135 | </ItemGroup> |
136 | 136 | <ItemGroup> |
137 | 137 | <Folder Include="App_Data\" /> |
138 | + <Folder Include="Views\Report\" /> | |
138 | 139 | </ItemGroup> |
139 | 140 | <ItemGroup> |
140 | 141 | <Compile Include="App_Start\BundleConfig.cs" /> |
... | ... | @@ -156,14 +157,13 @@ |
156 | 157 | <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" /> |
157 | 158 | <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" /> |
158 | 159 | <Compile Include="Constants\AdminConstant.cs" /> |
159 | - <Compile Include="Controllers\AccountTypeController.cs" /> | |
160 | + <Compile Include="Controllers\AccountController.cs" /> | |
160 | 161 | <Compile Include="Controllers\AddLicenseController.cs" /> |
162 | + <Compile Include="Controllers\CommonController.cs" /> | |
161 | 163 | <Compile Include="Controllers\CountryController.cs" /> |
162 | - <Compile Include="Controllers\EditionTypeController.cs" /> | |
163 | - <Compile Include="Controllers\HomeController.cs" /> | |
164 | - <Compile Include="Controllers\LicenseTypeController.cs" /> | |
165 | - <Compile Include="Controllers\SecurityQuestionListController.cs" /> | |
166 | - <Compile Include="Controllers\StateController.cs" /> | |
164 | + <Compile Include="Controllers\EditionController.cs" /> | |
165 | + <Compile Include="Controllers\LicenseController.cs" /> | |
166 | + <Compile Include="Controllers\ReportController.cs" /> | |
167 | 167 | <Compile Include="Controllers\DiscountCodeController.cs" /> |
168 | 168 | <Compile Include="Controllers\SubscriptionPriceController.cs" /> |
169 | 169 | <Compile Include="Controllers\UserController.cs" /> |
... | ... | @@ -716,6 +716,21 @@ |
716 | 716 | <Compile Include="Entity\usp_GetAccountTypeList_Result.cs"> |
717 | 717 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
718 | 718 | </Compile> |
719 | + <Compile Include="Entity\usp_GetEditions_Result.cs"> | |
720 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
721 | + </Compile> | |
722 | + <Compile Include="Entity\usp_GetLicenseById_Result.cs"> | |
723 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
724 | + </Compile> | |
725 | + <Compile Include="Entity\usp_GetLicenses_Result.cs"> | |
726 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
727 | + </Compile> | |
728 | + <Compile Include="Entity\usp_GetLicenseTypes_Result.cs"> | |
729 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
730 | + </Compile> | |
731 | + <Compile Include="Entity\usp_GetManageRights_Result.cs"> | |
732 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
733 | + </Compile> | |
719 | 734 | <Compile Include="Entity\usp_GetProductEditionByLicense_Result.cs"> |
720 | 735 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
721 | 736 | </Compile> |
... | ... | @@ -755,6 +770,10 @@ |
755 | 770 | <Compile Include="Global.asax.cs"> |
756 | 771 | <DependentUpon>Global.asax</DependentUpon> |
757 | 772 | </Compile> |
773 | + <Compile Include="Models\AccountModel.cs" /> | |
774 | + <Compile Include="Models\CommonModel.cs" /> | |
775 | + <Compile Include="Models\EditionModel.cs" /> | |
776 | + <Compile Include="Models\LicenseModel.cs" /> | |
758 | 777 | <Compile Include="Models\SharedModel.cs" /> |
759 | 778 | <Compile Include="Models\AppReponse.cs" /> |
760 | 779 | <Compile Include="Models\DbModel.cs" /> | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/AccountController.cs
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | +using System.Linq; | |
4 | +using System.Net; | |
3 | 5 | using System.Net.Http; |
4 | -using System.Security.Claims; | |
5 | -using System.Security.Cryptography; | |
6 | -using System.Threading.Tasks; | |
7 | -using System.Web; | |
8 | 6 | using System.Web.Http; |
9 | -using System.Web.Http.ModelBinding; | |
10 | -using Microsoft.AspNet.Identity; | |
11 | -using Microsoft.AspNet.Identity.EntityFramework; | |
12 | -using Microsoft.AspNet.Identity.Owin; | |
13 | -using Microsoft.Owin.Security; | |
14 | -using Microsoft.Owin.Security.Cookies; | |
15 | -using Microsoft.Owin.Security.OAuth; | |
16 | -using AIAHTML5.Server.Models; | |
17 | -using AIAHTML5.Server.Providers; | |
18 | -using AIAHTML5.Server.Results; | |
19 | - | |
20 | -namespace AIAHTML5.Server.Controllers | |
7 | +using Newtonsoft.Json; | |
8 | +using Newtonsoft.Json.Linq; | |
9 | +using AIAHTML5.ADMIN.API.Models; | |
10 | +using System.Web.Http.Cors; | |
11 | +using System.Web.Cors; | |
12 | +using AIAHTML5.Server.Constants; | |
13 | +using log4net; | |
14 | +using System.Text; | |
15 | +using AIAHTML5.ADMIN.API.Entity; | |
16 | + | |
17 | +namespace AIAHTML5.ADMIN.API.Controllers | |
21 | 18 | { |
22 | - [Authorize] | |
23 | - [RoutePrefix("api/Account")] | |
19 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | |
20 | + [RoutePrefix("Account")] | |
24 | 21 | public class AccountController : ApiController |
25 | 22 | { |
26 | - private const string LocalLoginProvider = "Local"; | |
27 | - private ApplicationUserManager _userManager; | |
28 | - | |
29 | - public AccountController() | |
30 | - { | |
31 | - } | |
32 | - | |
33 | - public AccountController(ApplicationUserManager userManager, | |
34 | - ISecureDataFormat<AuthenticationTicket> accessTokenFormat) | |
35 | - { | |
36 | - UserManager = userManager; | |
37 | - AccessTokenFormat = accessTokenFormat; | |
38 | - } | |
39 | - | |
40 | - public ApplicationUserManager UserManager | |
41 | - { | |
42 | - get | |
43 | - { | |
44 | - return _userManager ?? Request.GetOwinContext().GetUserManager<ApplicationUserManager>(); | |
45 | - } | |
46 | - private set | |
47 | - { | |
48 | - _userManager = value; | |
49 | - } | |
50 | - } | |
51 | - | |
52 | - public ISecureDataFormat<AuthenticationTicket> AccessTokenFormat { get; private set; } | |
53 | - | |
54 | - // GET api/Account/UserInfo | |
55 | - [HostAuthentication(DefaultAuthenticationTypes.ExternalBearer)] | |
56 | - [Route("UserInfo")] | |
57 | - public UserInfoViewModel GetUserInfo() | |
58 | - { | |
59 | - ExternalLoginData externalLogin = ExternalLoginData.FromIdentity(User.Identity as ClaimsIdentity); | |
60 | - | |
61 | - return new UserInfoViewModel | |
62 | - { | |
63 | - Email = User.Identity.GetUserName(), | |
64 | - HasRegistered = externalLogin == null, | |
65 | - LoginProvider = externalLogin != null ? externalLogin.LoginProvider : null | |
66 | - }; | |
67 | - } | |
68 | - | |
69 | - // POST api/Account/Logout | |
70 | - [Route("Logout")] | |
71 | - public IHttpActionResult Logout() | |
72 | - { | |
73 | - Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType); | |
74 | - return Ok(); | |
75 | - } | |
76 | - | |
77 | - // GET api/Account/ManageInfo?returnUrl=%2F&generateState=true | |
78 | - [Route("ManageInfo")] | |
79 | - public async Task<ManageInfoViewModel> GetManageInfo(string returnUrl, bool generateState = false) | |
80 | - { | |
81 | - IdentityUser user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); | |
82 | - | |
83 | - if (user == null) | |
84 | - { | |
85 | - return null; | |
86 | - } | |
87 | - | |
88 | - List<UserLoginInfoViewModel> logins = new List<UserLoginInfoViewModel>(); | |
89 | - | |
90 | - foreach (IdentityUserLogin linkedAccount in user.Logins) | |
91 | - { | |
92 | - logins.Add(new UserLoginInfoViewModel | |
93 | - { | |
94 | - LoginProvider = linkedAccount.LoginProvider, | |
95 | - ProviderKey = linkedAccount.ProviderKey | |
96 | - }); | |
97 | - } | |
98 | - | |
99 | - if (user.PasswordHash != null) | |
100 | - { | |
101 | - logins.Add(new UserLoginInfoViewModel | |
102 | - { | |
103 | - LoginProvider = LocalLoginProvider, | |
104 | - ProviderKey = user.UserName, | |
105 | - }); | |
106 | - } | |
107 | - | |
108 | - return new ManageInfoViewModel | |
109 | - { | |
110 | - LocalLoginProvider = LocalLoginProvider, | |
111 | - Email = user.UserName, | |
112 | - Logins = logins, | |
113 | - ExternalLoginProviders = GetExternalLogins(returnUrl, generateState) | |
114 | - }; | |
115 | - } | |
116 | - | |
117 | - // POST api/Account/ChangePassword | |
118 | - [Route("ChangePassword")] | |
119 | - public async Task<IHttpActionResult> ChangePassword(ChangePasswordBindingModel model) | |
120 | - { | |
121 | - if (!ModelState.IsValid) | |
122 | - { | |
123 | - return BadRequest(ModelState); | |
124 | - } | |
125 | - | |
126 | - IdentityResult result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, | |
127 | - model.NewPassword); | |
128 | - | |
129 | - if (!result.Succeeded) | |
130 | - { | |
131 | - return GetErrorResult(result); | |
132 | - } | |
133 | - | |
134 | - return Ok(); | |
135 | - } | |
136 | - | |
137 | - // POST api/Account/SetPassword | |
138 | - [Route("SetPassword")] | |
139 | - public async Task<IHttpActionResult> SetPassword(SetPasswordBindingModel model) | |
140 | - { | |
141 | - if (!ModelState.IsValid) | |
142 | - { | |
143 | - return BadRequest(ModelState); | |
144 | - } | |
145 | - | |
146 | - IdentityResult result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword); | |
147 | - | |
148 | - if (!result.Succeeded) | |
149 | - { | |
150 | - return GetErrorResult(result); | |
151 | - } | |
152 | - | |
153 | - return Ok(); | |
154 | - } | |
155 | - | |
156 | - // POST api/Account/AddExternalLogin | |
157 | - [Route("AddExternalLogin")] | |
158 | - public async Task<IHttpActionResult> AddExternalLogin(AddExternalLoginBindingModel model) | |
159 | - { | |
160 | - if (!ModelState.IsValid) | |
161 | - { | |
162 | - return BadRequest(ModelState); | |
163 | - } | |
164 | - | |
165 | - Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie); | |
166 | - | |
167 | - AuthenticationTicket ticket = AccessTokenFormat.Unprotect(model.ExternalAccessToken); | |
168 | - | |
169 | - if (ticket == null || ticket.Identity == null || (ticket.Properties != null | |
170 | - && ticket.Properties.ExpiresUtc.HasValue | |
171 | - && ticket.Properties.ExpiresUtc.Value < DateTimeOffset.UtcNow)) | |
172 | - { | |
173 | - return BadRequest("External login failure."); | |
174 | - } | |
175 | - | |
176 | - ExternalLoginData externalData = ExternalLoginData.FromIdentity(ticket.Identity); | |
177 | - | |
178 | - if (externalData == null) | |
179 | - { | |
180 | - return BadRequest("The external login is already associated with an account."); | |
181 | - } | |
182 | - | |
183 | - IdentityResult result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), | |
184 | - new UserLoginInfo(externalData.LoginProvider, externalData.ProviderKey)); | |
185 | - | |
186 | - if (!result.Succeeded) | |
187 | - { | |
188 | - return GetErrorResult(result); | |
189 | - } | |
190 | - | |
191 | - return Ok(); | |
192 | - } | |
193 | - | |
194 | - // POST api/Account/RemoveLogin | |
195 | - [Route("RemoveLogin")] | |
196 | - public async Task<IHttpActionResult> RemoveLogin(RemoveLoginBindingModel model) | |
197 | - { | |
198 | - if (!ModelState.IsValid) | |
199 | - { | |
200 | - return BadRequest(ModelState); | |
201 | - } | |
202 | - | |
203 | - IdentityResult result; | |
204 | - | |
205 | - if (model.LoginProvider == LocalLoginProvider) | |
206 | - { | |
207 | - result = await UserManager.RemovePasswordAsync(User.Identity.GetUserId()); | |
208 | - } | |
209 | - else | |
210 | - { | |
211 | - result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), | |
212 | - new UserLoginInfo(model.LoginProvider, model.ProviderKey)); | |
213 | - } | |
214 | - | |
215 | - if (!result.Succeeded) | |
216 | - { | |
217 | - return GetErrorResult(result); | |
218 | - } | |
219 | - | |
220 | - return Ok(); | |
221 | - } | |
222 | - | |
223 | - // GET api/Account/ExternalLogin | |
224 | - [OverrideAuthentication] | |
225 | - [HostAuthentication(DefaultAuthenticationTypes.ExternalCookie)] | |
226 | - [AllowAnonymous] | |
227 | - [Route("ExternalLogin", Name = "ExternalLogin")] | |
228 | - public async Task<IHttpActionResult> GetExternalLogin(string provider, string error = null) | |
229 | - { | |
230 | - if (error != null) | |
231 | - { | |
232 | - return Redirect(Url.Content("~/") + "#error=" + Uri.EscapeDataString(error)); | |
233 | - } | |
234 | - | |
235 | - if (!User.Identity.IsAuthenticated) | |
236 | - { | |
237 | - return new ChallengeResult(provider, this); | |
238 | - } | |
239 | - | |
240 | - ExternalLoginData externalLogin = ExternalLoginData.FromIdentity(User.Identity as ClaimsIdentity); | |
241 | - | |
242 | - if (externalLogin == null) | |
243 | - { | |
244 | - return InternalServerError(); | |
245 | - } | |
246 | - | |
247 | - if (externalLogin.LoginProvider != provider) | |
248 | - { | |
249 | - Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie); | |
250 | - return new ChallengeResult(provider, this); | |
251 | - } | |
252 | - | |
253 | - ApplicationUser user = await UserManager.FindAsync(new UserLoginInfo(externalLogin.LoginProvider, | |
254 | - externalLogin.ProviderKey)); | |
255 | - | |
256 | - bool hasRegistered = user != null; | |
257 | - | |
258 | - if (hasRegistered) | |
259 | - { | |
260 | - Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie); | |
261 | - | |
262 | - ClaimsIdentity oAuthIdentity = await user.GenerateUserIdentityAsync(UserManager, | |
263 | - OAuthDefaults.AuthenticationType); | |
264 | - ClaimsIdentity cookieIdentity = await user.GenerateUserIdentityAsync(UserManager, | |
265 | - CookieAuthenticationDefaults.AuthenticationType); | |
266 | - | |
267 | - AuthenticationProperties properties = ApplicationOAuthProvider.CreateProperties(user.UserName); | |
268 | - Authentication.SignIn(properties, oAuthIdentity, cookieIdentity); | |
269 | - } | |
270 | - else | |
271 | - { | |
272 | - IEnumerable<Claim> claims = externalLogin.GetClaims(); | |
273 | - ClaimsIdentity identity = new ClaimsIdentity(claims, OAuthDefaults.AuthenticationType); | |
274 | - Authentication.SignIn(identity); | |
275 | - } | |
276 | - | |
277 | - return Ok(); | |
278 | - } | |
279 | - | |
280 | - // GET api/Account/ExternalLogins?returnUrl=%2F&generateState=true | |
281 | - [AllowAnonymous] | |
282 | - [Route("ExternalLogins")] | |
283 | - public IEnumerable<ExternalLoginViewModel> GetExternalLogins(string returnUrl, bool generateState = false) | |
284 | - { | |
285 | - IEnumerable<AuthenticationDescription> descriptions = Authentication.GetExternalAuthenticationTypes(); | |
286 | - List<ExternalLoginViewModel> logins = new List<ExternalLoginViewModel>(); | |
287 | - | |
288 | - string state; | |
289 | - | |
290 | - if (generateState) | |
291 | - { | |
292 | - const int strengthInBits = 256; | |
293 | - state = RandomOAuthStateGenerator.Generate(strengthInBits); | |
294 | - } | |
295 | - else | |
296 | - { | |
297 | - state = null; | |
298 | - } | |
299 | - | |
300 | - foreach (AuthenticationDescription description in descriptions) | |
301 | - { | |
302 | - ExternalLoginViewModel login = new ExternalLoginViewModel | |
303 | - { | |
304 | - Name = description.Caption, | |
305 | - Url = Url.Route("ExternalLogin", new | |
306 | - { | |
307 | - provider = description.AuthenticationType, | |
308 | - response_type = "token", | |
309 | - client_id = Startup.PublicClientId, | |
310 | - redirect_uri = new Uri(Request.RequestUri, returnUrl).AbsoluteUri, | |
311 | - state = state | |
312 | - }), | |
313 | - State = state | |
314 | - }; | |
315 | - logins.Add(login); | |
316 | - } | |
317 | - | |
318 | - return logins; | |
319 | - } | |
320 | - | |
321 | - // POST api/Account/Register | |
322 | - [AllowAnonymous] | |
323 | - [Route("Register")] | |
324 | - public async Task<IHttpActionResult> Register(RegisterBindingModel model) | |
325 | - { | |
326 | - if (!ModelState.IsValid) | |
327 | - { | |
328 | - return BadRequest(ModelState); | |
329 | - } | |
330 | - | |
331 | - var user = new ApplicationUser() { UserName = model.Email, Email = model.Email }; | |
332 | - | |
333 | - IdentityResult result = await UserManager.CreateAsync(user, model.Password); | |
334 | - | |
335 | - if (!result.Succeeded) | |
336 | - { | |
337 | - return GetErrorResult(result); | |
338 | - } | |
339 | - | |
340 | - return Ok(); | |
341 | - } | |
342 | - | |
343 | - // POST api/Account/RegisterExternal | |
344 | - [OverrideAuthentication] | |
345 | - [HostAuthentication(DefaultAuthenticationTypes.ExternalBearer)] | |
346 | - [Route("RegisterExternal")] | |
347 | - public async Task<IHttpActionResult> RegisterExternal(RegisterExternalBindingModel model) | |
348 | - { | |
349 | - if (!ModelState.IsValid) | |
350 | - { | |
351 | - return BadRequest(ModelState); | |
352 | - } | |
353 | - | |
354 | - var info = await Authentication.GetExternalLoginInfoAsync(); | |
355 | - if (info == null) | |
356 | - { | |
357 | - return InternalServerError(); | |
358 | - } | |
359 | - | |
360 | - var user = new ApplicationUser() { UserName = model.Email, Email = model.Email }; | |
361 | - | |
362 | - IdentityResult result = await UserManager.CreateAsync(user); | |
363 | - if (!result.Succeeded) | |
364 | - { | |
365 | - return GetErrorResult(result); | |
366 | - } | |
367 | - | |
368 | - result = await UserManager.AddLoginAsync(user.Id, info.Login); | |
369 | - if (!result.Succeeded) | |
370 | - { | |
371 | - return GetErrorResult(result); | |
372 | - } | |
373 | - return Ok(); | |
374 | - } | |
375 | - | |
376 | - protected override void Dispose(bool disposing) | |
377 | - { | |
378 | - if (disposing && _userManager != null) | |
379 | - { | |
380 | - _userManager.Dispose(); | |
381 | - _userManager = null; | |
382 | - } | |
383 | - | |
384 | - base.Dispose(disposing); | |
385 | - } | |
386 | - | |
387 | - #region Helpers | |
388 | - | |
389 | - private IAuthenticationManager Authentication | |
390 | - { | |
391 | - get { return Request.GetOwinContext().Authentication; } | |
392 | - } | |
393 | - | |
394 | - private IHttpActionResult GetErrorResult(IdentityResult result) | |
395 | - { | |
396 | - if (result == null) | |
397 | - { | |
398 | - return InternalServerError(); | |
399 | - } | |
23 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | |
400 | 24 | |
401 | - if (!result.Succeeded) | |
402 | - { | |
403 | - if (result.Errors != null) | |
404 | - { | |
405 | - foreach (string error in result.Errors) | |
406 | - { | |
407 | - ModelState.AddModelError("", error); | |
408 | - } | |
409 | - } | |
410 | - | |
411 | - if (ModelState.IsValid) | |
412 | - { | |
413 | - // No ModelState errors are available to send, so just return an empty BadRequest. | |
414 | - return BadRequest(); | |
415 | - } | |
416 | - | |
417 | - return BadRequest(ModelState); | |
418 | - } | |
419 | - | |
420 | - return null; | |
421 | - } | |
422 | - | |
423 | - private class ExternalLoginData | |
25 | + [Route("AccountTypes")] | |
26 | + [HttpGet] | |
27 | + public HttpResponseMessage GetAccountTypes() | |
424 | 28 | { |
425 | - public string LoginProvider { get; set; } | |
426 | - public string ProviderKey { get; set; } | |
427 | - public string UserName { get; set; } | |
428 | - | |
429 | - public IList<Claim> GetClaims() | |
430 | - { | |
431 | - IList<Claim> claims = new List<Claim>(); | |
432 | - claims.Add(new Claim(ClaimTypes.NameIdentifier, ProviderKey, null, LoginProvider)); | |
433 | - | |
434 | - if (UserName != null) | |
435 | - { | |
436 | - claims.Add(new Claim(ClaimTypes.Name, UserName, null, LoginProvider)); | |
437 | - } | |
438 | - | |
439 | - return claims; | |
440 | - } | |
441 | - | |
442 | - public static ExternalLoginData FromIdentity(ClaimsIdentity identity) | |
29 | + List<AccountTypeEntityModel> AccountTypeList = new List<AccountTypeEntityModel>(); | |
30 | + try | |
443 | 31 | { |
444 | - if (identity == null) | |
445 | - { | |
446 | - return null; | |
447 | - } | |
448 | - | |
449 | - Claim providerKeyClaim = identity.FindFirst(ClaimTypes.NameIdentifier); | |
450 | - | |
451 | - if (providerKeyClaim == null || String.IsNullOrEmpty(providerKeyClaim.Issuer) | |
452 | - || String.IsNullOrEmpty(providerKeyClaim.Value)) | |
453 | - { | |
454 | - return null; | |
455 | - } | |
456 | - | |
457 | - if (providerKeyClaim.Issuer == ClaimsIdentity.DefaultIssuer) | |
458 | - { | |
459 | - return null; | |
460 | - } | |
461 | - | |
462 | - return new ExternalLoginData | |
463 | - { | |
464 | - LoginProvider = providerKeyClaim.Issuer, | |
465 | - ProviderKey = providerKeyClaim.Value, | |
466 | - UserName = identity.FindFirstValue(ClaimTypes.Name) | |
467 | - }; | |
32 | + AccountTypeList = AccountTypeEntityModel.GetActiveAccountTypes(dbContext); | |
33 | + return Request.CreateResponse(HttpStatusCode.OK, AccountTypeList); | |
468 | 34 | } |
469 | - } | |
470 | - | |
471 | - private static class RandomOAuthStateGenerator | |
472 | - { | |
473 | - private static RandomNumberGenerator _random = new RNGCryptoServiceProvider(); | |
474 | - | |
475 | - public static string Generate(int strengthInBits) | |
35 | + catch (Exception ex) | |
476 | 36 | { |
477 | - const int bitsPerByte = 8; | |
478 | - | |
479 | - if (strengthInBits % bitsPerByte != 0) | |
480 | - { | |
481 | - throw new ArgumentException("strengthInBits must be evenly divisible by 8.", "strengthInBits"); | |
482 | - } | |
483 | - | |
484 | - int strengthInBytes = strengthInBits / bitsPerByte; | |
485 | - | |
486 | - byte[] data = new byte[strengthInBytes]; | |
487 | - _random.GetBytes(data); | |
488 | - return HttpServerUtility.UrlTokenEncode(data); | |
37 | + // Log exception code goes here | |
38 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
489 | 39 | } |
490 | 40 | } |
491 | 41 | |
492 | - #endregion | |
493 | 42 | } |
494 | 43 | } | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/AddLicenseController.cs
... | ... | @@ -14,7 +14,7 @@ using log4net; |
14 | 14 | |
15 | 15 | namespace AIAHTML5.Server.Controllers |
16 | 16 | { |
17 | - [EnableCors(origins: "http://localhost:92", headers: "*", methods: "*")] | |
17 | + //[EnableCors(origins: "http://localhost:92", headers: "*", methods: "*")] | |
18 | 18 | public class AddLicenseController : ApiController |
19 | 19 | { |
20 | 20 | // GET: api/AddLicense | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Net; | |
5 | +using System.Net.Http; | |
6 | +using System.Web.Http; | |
7 | +using Newtonsoft.Json; | |
8 | +using Newtonsoft.Json.Linq; | |
9 | +using AIAHTML5.ADMIN.API.Models; | |
10 | +using System.Web.Http.Cors; | |
11 | +using System.Web.Cors; | |
12 | +using AIAHTML5.Server.Constants; | |
13 | +using log4net; | |
14 | +using System.Text; | |
15 | +using AIAHTML5.ADMIN.API.Entity; | |
16 | + | |
17 | +namespace AIAHTML5.ADMIN.API.Controllers | |
18 | +{ | |
19 | + | |
20 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | |
21 | + [RoutePrefix("Common")] | |
22 | + public class CommonController : ApiController | |
23 | + { | |
24 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | |
25 | + | |
26 | + [Route("Countries")] | |
27 | + [HttpGet] | |
28 | + public HttpResponseMessage GetCountries() | |
29 | + { | |
30 | + List<CountryModel> CountryList = new List<CountryModel>(); | |
31 | + try | |
32 | + { | |
33 | + CountryList = CountryModel.GetCountries(dbContext); | |
34 | + return Request.CreateResponse(HttpStatusCode.OK, CountryList); | |
35 | + } | |
36 | + catch (Exception ex) | |
37 | + { | |
38 | + // Log exception code goes here | |
39 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
40 | + } | |
41 | + } | |
42 | + | |
43 | + [Route("States")] | |
44 | + [HttpGet] | |
45 | + public HttpResponseMessage GetUsStates() | |
46 | + { | |
47 | + List<StateModel> StateList = new List<StateModel>(); | |
48 | + try | |
49 | + { | |
50 | + StateList = StateModel.GetUsStates(dbContext); | |
51 | + return Request.CreateResponse(HttpStatusCode.OK, StateList); | |
52 | + } | |
53 | + catch (Exception ex) | |
54 | + { | |
55 | + // Log exception code goes here | |
56 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
57 | + } | |
58 | + } | |
59 | + | |
60 | + [Route("SecurityQuestions")] | |
61 | + [HttpGet] | |
62 | + public HttpResponseMessage GetSecurityQuestions() | |
63 | + { | |
64 | + List<SecurityQuestionModel> SecurityQuestionList = new List<SecurityQuestionModel>(); | |
65 | + try | |
66 | + { | |
67 | + SecurityQuestionList = SecurityQuestionModel.GetSecurityQuestions(dbContext); | |
68 | + return Request.CreateResponse(HttpStatusCode.OK, SecurityQuestionList); | |
69 | + } | |
70 | + catch (Exception ex) | |
71 | + { | |
72 | + // Log exception code goes here | |
73 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
74 | + } | |
75 | + } | |
76 | + | |
77 | + [Route("GetEdition")] | |
78 | + [HttpGet] | |
79 | + public IHttpActionResult GetEdition() | |
80 | + { | |
81 | + dbContext.Configuration.ProxyCreationEnabled = false; | |
82 | + List<Edition> lstEdition1 = new List<Edition>(); | |
83 | + var lstEdition = dbContext.Editions.Where(e => e.IsActive == true).OrderBy(e => e.Priority).ToList(); | |
84 | + lstEdition1 = lstEdition.Select(l => new Edition { Id = l.Id, Title = l.Title }).ToList(); | |
85 | + //lstCountry1.Insert(0, new Country { Id = 0, CountryName = "All" }); | |
86 | + return Ok(lstEdition1); | |
87 | + } | |
88 | + [Route("GetDiscountCode")] | |
89 | + [HttpGet] | |
90 | + public IHttpActionResult GetDiscountCode() | |
91 | + { | |
92 | + dbContext.Configuration.ProxyCreationEnabled = false; | |
93 | + List<DiscountCodeModel> lstDiscountCode1 = new List<DiscountCodeModel>(); | |
94 | + string sStartDate = DateTime.MinValue.ToShortDateString(); | |
95 | + string sEndDate = DateTime.MaxValue.ToShortDateString(); | |
96 | + var lstDiscountCode = dbContext.GetDiscountCodes("", "", "").ToList(); | |
97 | + lstDiscountCode1 = lstDiscountCode.Select(l => new DiscountCodeModel { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); | |
98 | + return Ok(lstDiscountCode1); | |
99 | + } | |
100 | + | |
101 | + [Route("GetAccountType")] | |
102 | + [HttpGet] | |
103 | + public IHttpActionResult GetAccountType() | |
104 | + { | |
105 | + List<AccountTypeModel> AccountTypeList = new List<AccountTypeModel>(); | |
106 | + //try | |
107 | + //{ | |
108 | + AccountTypeList = AccountTypeModel.GetAccountTypes(dbContext); | |
109 | + return Ok(AccountTypeList); | |
110 | + //} | |
111 | + //catch (Exception ex) | |
112 | + //{ | |
113 | + // // Log exception code goes here | |
114 | + // //return ex.Message; | |
115 | + //} | |
116 | + } | |
117 | + protected HttpResponseMessage ToJson(dynamic obj) | |
118 | + { | |
119 | + var response = Request.CreateResponse(HttpStatusCode.OK); | |
120 | + response.Content = new StringContent(JsonConvert.SerializeObject(obj), Encoding.UTF8, "application/jsonP"); | |
121 | + return response; | |
122 | + } | |
123 | + | |
124 | + } | |
125 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/EditionController.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Net; | |
5 | +using System.Net.Http; | |
6 | +using System.Web.Http; | |
7 | +using Newtonsoft.Json; | |
8 | +using Newtonsoft.Json.Linq; | |
9 | +using AIAHTML5.ADMIN.API.Models; | |
10 | +using System.Web.Http.Cors; | |
11 | +using System.Web.Cors; | |
12 | +using AIAHTML5.Server.Constants; | |
13 | +using log4net; | |
14 | +using System.Text; | |
15 | +using AIAHTML5.ADMIN.API.Entity; | |
16 | + | |
17 | +namespace AIAHTML5.ADMIN.API.Controllers | |
18 | +{ | |
19 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | |
20 | + [RoutePrefix("Edition")] | |
21 | + public class EditionController : ApiController | |
22 | + { | |
23 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | |
24 | + | |
25 | + [Route("Editions")] | |
26 | + [HttpGet] | |
27 | + public HttpResponseMessage GetEditions() | |
28 | + { | |
29 | + List<EditionModel> EditionList = new List<EditionModel>(); | |
30 | + try | |
31 | + { | |
32 | + EditionList = EditionModel.GetEditions(dbContext); | |
33 | + return Request.CreateResponse(HttpStatusCode.OK, EditionList); | |
34 | + } | |
35 | + catch (Exception ex) | |
36 | + { | |
37 | + // Log exception code goes here | |
38 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
39 | + } | |
40 | + } | |
41 | + | |
42 | + } | |
43 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Net; | |
5 | +using System.Net.Http; | |
6 | +using System.Web.Http; | |
7 | +using Newtonsoft.Json; | |
8 | +using Newtonsoft.Json.Linq; | |
9 | +using AIAHTML5.ADMIN.API.Models; | |
10 | +using System.Web.Http.Cors; | |
11 | +using System.Web.Cors; | |
12 | +using AIAHTML5.Server.Constants; | |
13 | +using log4net; | |
14 | +using System.Text; | |
15 | +using AIAHTML5.ADMIN.API.Entity; | |
16 | + | |
17 | +namespace AIAHTML5.ADMIN.API.Controllers | |
18 | +{ | |
19 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | |
20 | + [RoutePrefix("License")] | |
21 | + public class LicenseController : ApiController | |
22 | + { | |
23 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | |
24 | + | |
25 | + [Route("LicenseTypes")] | |
26 | + [HttpGet] | |
27 | + public HttpResponseMessage GetLicenseTypes() | |
28 | + { | |
29 | + List<LicenseTypeModel> LicenseTypeList = new List<LicenseTypeModel>(); | |
30 | + try | |
31 | + { | |
32 | + LicenseTypeList = LicenseTypeModel.GetLicenseTypes(dbContext); | |
33 | + return Request.CreateResponse(HttpStatusCode.OK, LicenseTypeList); | |
34 | + } | |
35 | + catch (Exception ex) | |
36 | + { | |
37 | + // Log exception code goes here | |
38 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
39 | + } | |
40 | + } | |
41 | + | |
42 | + [Route("Licenses")] | |
43 | + [HttpGet] | |
44 | + public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, | |
45 | + string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, | |
46 | + bool isActive) | |
47 | + { | |
48 | + List<LicenseModel> LicenseList = new List<LicenseModel>(); | |
49 | + try | |
50 | + { | |
51 | + LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName, | |
52 | + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive); | |
53 | + return Request.CreateResponse(HttpStatusCode.OK, LicenseList); | |
54 | + } | |
55 | + catch (Exception ex) | |
56 | + { | |
57 | + // Log exception code goes here | |
58 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
59 | + } | |
60 | + } | |
61 | + | |
62 | + [Route("InsertLicense")] | |
63 | + [HttpPost] | |
64 | + public HttpResponseMessage InsertLicense(JObject jsonData) | |
65 | + { | |
66 | + bool Status = false; | |
67 | + LicenseModel licenseModel = new LicenseModel(); | |
68 | + licenseModel.LicenseId = jsonData["licenseId"].Value<int>(); | |
69 | + licenseModel.AccountNumber = jsonData["accountNumber"].Value<string>(); | |
70 | + licenseModel.LicenseeFirstName = jsonData["licenseeFirstName"].Value<string>(); | |
71 | + licenseModel.LicenseeLastName = jsonData["licenseeLastName"].Value<string>(); | |
72 | + licenseModel.LicenseTypeId = jsonData["licenseTypeId"].Value<byte>(); | |
73 | + licenseModel.AccountTypeId = jsonData["accountTypeId"].Value<byte>(); | |
74 | + licenseModel.InstitutionName = jsonData["institutionName"].Value<string>(); | |
75 | + licenseModel.Address1 = jsonData["address1"].Value<string>(); | |
76 | + licenseModel.Address2 = jsonData["address2"].Value<string>(); | |
77 | + licenseModel.City = jsonData["city"].Value<string>(); | |
78 | + licenseModel.Zip = jsonData["zip"].Value<string>(); | |
79 | + licenseModel.StateId = jsonData["stateId"].Value<int?>(); | |
80 | + licenseModel.CountryId = jsonData["countryId"].Value<int?>(); | |
81 | + licenseModel.Phone = jsonData["phone"].Value<string>(); | |
82 | + licenseModel.EmailId = jsonData["email"].Value<string>(); | |
83 | + licenseModel.TotalLogins = jsonData["totalLogins"].Value<int?>(); | |
84 | + licenseModel.EditionLogins = jsonData["editionLogins"].Value<string>(); | |
85 | + licenseModel.Price = jsonData["price"].Value<decimal>(); | |
86 | + licenseModel.ProductKey = jsonData["productKey"].Value<string>(); | |
87 | + licenseModel.MasterSiteUrl = jsonData["masterSiteUrl"].Value<string>(); | |
88 | + licenseModel.SiteUrlFrom = jsonData["siteFromUrl"].Value<string>(); | |
89 | + licenseModel.SiteUrlTo = jsonData["siteToUrl"].Value<string>(); | |
90 | + licenseModel.NoOfImages = jsonData["noOfImages"].Value<int?>(); | |
91 | + licenseModel.LoginId = jsonData["loginId"].Value<string>(); | |
92 | + licenseModel.Password = jsonData["password"].Value<string>(); | |
93 | + licenseModel.SubscriptionStartDate = jsonData["subscriptionStartDate"].Value<DateTime>(); | |
94 | + licenseModel.SubscriptionEndDate = jsonData["subscriptionEndDate"].Value<DateTime>(); | |
95 | + licenseModel.SecurityQuestionId = jsonData["securityQuestionId"].Value<byte?>(); | |
96 | + licenseModel.Answer = jsonData["answer"].Value<string>(); | |
97 | + licenseModel.TestLicenseEditionId = jsonData["testLicenseEditionId"].Value<byte?>(); | |
98 | + licenseModel.CreatorId = jsonData["creatorId"].Value<int>(); | |
99 | + try | |
100 | + { | |
101 | + Status = LicenseModel.InsertLicense(dbContext, licenseModel); | |
102 | + if (Status) | |
103 | + { | |
104 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | |
105 | + } | |
106 | + else | |
107 | + { | |
108 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | |
109 | + } | |
110 | + } | |
111 | + catch (Exception ex) | |
112 | + { | |
113 | + // Log exception code goes here | |
114 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
115 | + } | |
116 | + } | |
117 | + | |
118 | + [Route("UpdateLicense")] | |
119 | + [HttpPost] | |
120 | + public HttpResponseMessage UpdateLicense(JObject jsonData) | |
121 | + { | |
122 | + bool Status = false; | |
123 | + LicenseModel licenseModel = new LicenseModel(); | |
124 | + licenseModel.LicenseId = jsonData["licenseId"].Value<int>(); | |
125 | + licenseModel.AccountNumber = jsonData["accountNumber"].Value<string>(); | |
126 | + licenseModel.LicenseeFirstName = jsonData["licenseeFirstName"].Value<string>(); | |
127 | + licenseModel.LicenseeLastName = jsonData["licenseeLastName"].Value<string>(); | |
128 | + licenseModel.LicenseTypeId = jsonData["licenseTypeId"].Value<byte>(); | |
129 | + licenseModel.AccountTypeId = jsonData["accountTypeId"].Value<byte>(); | |
130 | + licenseModel.InstitutionName = jsonData["institutionName"].Value<string>(); | |
131 | + licenseModel.Address1 = jsonData["address1"].Value<string>(); | |
132 | + licenseModel.Address2 = jsonData["address2"].Value<string>(); | |
133 | + licenseModel.City = jsonData["city"].Value<string>(); | |
134 | + licenseModel.Zip = jsonData["zip"].Value<string>(); | |
135 | + licenseModel.StateId = jsonData["stateId"].Value<int?>(); | |
136 | + licenseModel.CountryId = jsonData["countryId"].Value<int?>(); | |
137 | + licenseModel.Phone = jsonData["phone"].Value<string>(); | |
138 | + licenseModel.EmailId = jsonData["email"].Value<string>(); | |
139 | + licenseModel.TotalLogins = jsonData["totalLogins"].Value<int?>(); | |
140 | + licenseModel.EditionLogins = jsonData["editionLogins"].Value<string>(); | |
141 | + licenseModel.Price = jsonData["price"].Value<decimal>(); | |
142 | + licenseModel.ProductKey = jsonData["productKey"].Value<string>(); | |
143 | + licenseModel.MasterSiteUrl = jsonData["masterSiteUrl"].Value<string>(); | |
144 | + licenseModel.SiteUrlFrom = jsonData["siteUrlFrom"].Value<string>(); | |
145 | + licenseModel.SiteUrlTo = jsonData["siteUrlTo"].Value<string>(); | |
146 | + licenseModel.NoOfImages = jsonData["noOfImages"].Value<int?>(); | |
147 | + licenseModel.LoginId = jsonData["loginId"].Value<string>(); | |
148 | + licenseModel.Password = jsonData["password"].Value<string>(); | |
149 | + licenseModel.SubscriptionStartDate = jsonData["subscriptionStartDate"].Value<DateTime>(); | |
150 | + licenseModel.SubscriptionEndDate = jsonData["subscriptionEndDate"].Value<DateTime>(); | |
151 | + licenseModel.RenewDate = jsonData["renewDate"].Value<DateTime>(); | |
152 | + licenseModel.SecurityQuestionId = jsonData["securityQuestionId"].Value<byte?>(); | |
153 | + licenseModel.Answer = jsonData["answer"].Value<string>(); | |
154 | + licenseModel.TestLicenseEditionId = jsonData["testLicenseEditionId"].Value<byte?>(); | |
155 | + licenseModel.CreatorId = jsonData["creatorId"].Value<int>(); | |
156 | + licenseModel.IsActive = jsonData["isActive"].Value<bool>(); | |
157 | + licenseModel.IsRenew = jsonData["renew"].Value<bool>(); | |
158 | + try | |
159 | + { | |
160 | + Status = LicenseModel.UpdateLicense(dbContext, licenseModel); | |
161 | + if (Status) | |
162 | + { | |
163 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | |
164 | + } | |
165 | + else | |
166 | + { | |
167 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | |
168 | + } | |
169 | + } | |
170 | + catch (Exception ex) | |
171 | + { | |
172 | + // Log exception code goes here | |
173 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
174 | + } | |
175 | + } | |
176 | + | |
177 | + [Route("GetLicense")] | |
178 | + [HttpGet] | |
179 | + public HttpResponseMessage GetLicense(int LicenseId) | |
180 | + { | |
181 | + LicenseModel LicenseEntity = new LicenseModel(); | |
182 | + try | |
183 | + { | |
184 | + LicenseEntity = LicenseModel.GetLicenseById(dbContext, LicenseId); | |
185 | + return Request.CreateResponse(HttpStatusCode.OK, LicenseEntity); | |
186 | + } | |
187 | + catch (Exception ex) | |
188 | + { | |
189 | + // Log exception code goes here | |
190 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
191 | + } | |
192 | + } | |
193 | + | |
194 | + [Route("DeleteLicense")] | |
195 | + [HttpGet] | |
196 | + public HttpResponseMessage DeleteLicense(int LicenseId) | |
197 | + { | |
198 | + bool Status = false; | |
199 | + try | |
200 | + { | |
201 | + Status = LicenseModel.DeleteLicense(dbContext, LicenseId); | |
202 | + if (Status) | |
203 | + { | |
204 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | |
205 | + } | |
206 | + else | |
207 | + { | |
208 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | |
209 | + } | |
210 | + } | |
211 | + catch (Exception ex) | |
212 | + { | |
213 | + // Log exception code goes here | |
214 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
215 | + } | |
216 | + } | |
217 | + } | |
218 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Net; | |
5 | +using System.Net.Http; | |
6 | +using System.Web.Http; | |
7 | +using Newtonsoft.Json; | |
8 | +using Newtonsoft.Json.Linq; | |
9 | +using AIAHTML5.ADMIN.API.Models; | |
10 | +using System.Web.Http.Cors; | |
11 | +using System.Web.Cors; | |
12 | +using AIAHTML5.Server.Constants; | |
13 | +using log4net; | |
14 | +using System.Text; | |
15 | +using AIAHTML5.ADMIN.API.Entity; | |
16 | +namespace AIAHTML5.ADMIN.API.Controllers | |
17 | +{ | |
18 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | |
19 | + [RoutePrefix("Report")] | |
20 | + public class ReportController : ApiController | |
21 | + { | |
22 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | |
23 | + public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry) | |
24 | + { | |
25 | + var lstUsageReport = dbContext.GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry).ToList(); | |
26 | + return Ok(lstUsageReport); | |
27 | + } | |
28 | + | |
29 | + [Route("Api/GetCustomerSummeryReport")] | |
30 | + [HttpGet] | |
31 | + public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable<decimal> iStartPrice, Nullable<decimal> iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry) | |
32 | + { | |
33 | + var lstCustomerSummeryReport = dbContext.GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry).ToList(); | |
34 | + return Ok(lstCustomerSummeryReport); | |
35 | + } | |
36 | + | |
37 | + | |
38 | + [Route("Api/GetExpiringSubscriptionReport")] | |
39 | + [HttpGet] | |
40 | + public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, Nullable<decimal> iStartPrice, Nullable<decimal> iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) | |
41 | + { | |
42 | + var lstExpiringSubscriptionReport = dbContext.GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); | |
43 | + return Ok(lstExpiringSubscriptionReport); | |
44 | + } | |
45 | + | |
46 | + [Route("Api/GetSubscriptionReport")] | |
47 | + [HttpGet] | |
48 | + public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) | |
49 | + { | |
50 | + | |
51 | + var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); | |
52 | + return Ok(lstExpiringSubscriptionReport); | |
53 | + } | |
54 | + [Route("Api/GetSubscriptionCancellationReport")] | |
55 | + [HttpGet] | |
56 | + public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) | |
57 | + { | |
58 | + | |
59 | + var lstExpiringSubscriptionReport = dbContext.GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); | |
60 | + return Ok(lstExpiringSubscriptionReport); | |
61 | + } | |
62 | + | |
63 | + [Route("Api/GetNetAdSummaryReport")] | |
64 | + [HttpGet] | |
65 | + public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId) | |
66 | + { | |
67 | + try | |
68 | + { | |
69 | + var lstNetAdSummaryReport = dbContext.GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId).ToList(); | |
70 | + return Ok(lstNetAdSummaryReport); | |
71 | + } | |
72 | + catch (Exception ex) | |
73 | + { | |
74 | + return Ok(ex.Message.ToString()); | |
75 | + } | |
76 | + } | |
77 | + | |
78 | + [Route("Api/GetSiteLicenseUsageReport")] | |
79 | + [HttpGet] | |
80 | + public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition) | |
81 | + { | |
82 | + try | |
83 | + { | |
84 | + var lstSiteLicenseUsageReport = dbContext.GetSiteLicenseUsageReport(sFromDate, sToDate, sAccountNumber, (byte)iEdition).ToList(); | |
85 | + return Ok(lstSiteLicenseUsageReport); | |
86 | + } | |
87 | + catch (Exception ex) | |
88 | + { | |
89 | + return Ok(ex.Message.ToString()); | |
90 | + } | |
91 | + } | |
92 | + | |
93 | + [Route("Api/GetDiscountReport")] | |
94 | + [HttpGet] | |
95 | + public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber) | |
96 | + { | |
97 | + try | |
98 | + { | |
99 | + var lstDiscountReport = dbContext.GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber).ToList(); | |
100 | + return Ok(lstDiscountReport); | |
101 | + } | |
102 | + catch (Exception ex) | |
103 | + { | |
104 | + return Ok(ex.Message.ToString()); | |
105 | + } | |
106 | + } | |
107 | + | |
108 | + [Route("Api/GetImageExportReport")] | |
109 | + [HttpGet] | |
110 | + public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber) | |
111 | + { | |
112 | + try | |
113 | + { | |
114 | + if (sAccountNumber == null) | |
115 | + sAccountNumber = string.Empty; | |
116 | + var lstImageExportReport = dbContext.GetExportedImageDetails(sFromDate, sToDate, sAccountNumber).ToList(); | |
117 | + return Ok(lstImageExportReport); | |
118 | + } | |
119 | + catch (Exception ex) | |
120 | + { | |
121 | + return Ok(ex.Message.ToString()); | |
122 | + } | |
123 | + } | |
124 | + } | |
125 | +} | |
0 | 126 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... | ... | @@ -190,6 +190,26 @@ namespace AIAHTML5.ADMIN.API.Controllers |
190 | 190 | return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "We have encountered a technical error and same has been notified to our technical team."); |
191 | 191 | } |
192 | 192 | } |
193 | + | |
194 | + [Route("ManageRight")] | |
195 | + [HttpGet] | |
196 | + public IHttpActionResult UserManageRight(int UserId,string UserType) | |
197 | + { | |
198 | + dbContext.Configuration.ProxyCreationEnabled = false; | |
199 | + try | |
200 | + { | |
201 | + List<usp_GetManageRights_Result> UserRights = dbContext.usp_GetManageRights(UserId, UserType).ToList(); | |
202 | + return Ok(UserRights); | |
203 | + } | |
204 | + catch(Exception ex) | |
205 | + { | |
206 | + var message = new HttpResponseMessage(HttpStatusCode.BadRequest) | |
207 | + { | |
208 | + Content = new StringContent("We have encountered a technical error and same has been notified to our technical team.") | |
209 | + }; | |
210 | + throw new HttpResponseException(message); | |
211 | + } | |
212 | + } | |
193 | 213 | |
194 | 214 | #endregion |
195 | 215 | #region Add User | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... | ... | @@ -3140,5 +3140,86 @@ namespace AIAHTML5.ADMIN.API.Entity |
3140 | 3140 | |
3141 | 3141 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateAIAUser", sLoginIdParameter, sPasswordParameter, sFirstnameParameter, sLastnameParameter, sEmailIdParameter, idParameter, iCreatorIdParameter, isActiveParameter, status); |
3142 | 3142 | } |
3143 | + | |
3144 | + public virtual ObjectResult<usp_GetEditions_Result> usp_GetEditions() | |
3145 | + { | |
3146 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetEditions_Result>("usp_GetEditions"); | |
3147 | + } | |
3148 | + | |
3149 | + public virtual ObjectResult<usp_GetLicenseById_Result> usp_GetLicenseById(Nullable<int> id) | |
3150 | + { | |
3151 | + var idParameter = id.HasValue ? | |
3152 | + new ObjectParameter("Id", id) : | |
3153 | + new ObjectParameter("Id", typeof(int)); | |
3154 | + | |
3155 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenseById_Result>("usp_GetLicenseById", idParameter); | |
3156 | + } | |
3157 | + | |
3158 | + public virtual ObjectResult<usp_GetLicenses_Result> usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable<byte> iLicenseTypeId, string sInstituteName, string sEmail, Nullable<int> iStateId, Nullable<int> iCountryId, Nullable<bool> bisActive) | |
3159 | + { | |
3160 | + var sStartDateParameter = sStartDate != null ? | |
3161 | + new ObjectParameter("sStartDate", sStartDate) : | |
3162 | + new ObjectParameter("sStartDate", typeof(string)); | |
3163 | + | |
3164 | + var sEndDateParameter = sEndDate != null ? | |
3165 | + new ObjectParameter("sEndDate", sEndDate) : | |
3166 | + new ObjectParameter("sEndDate", typeof(string)); | |
3167 | + | |
3168 | + var sAccoutNumberParameter = sAccoutNumber != null ? | |
3169 | + new ObjectParameter("sAccoutNumber", sAccoutNumber) : | |
3170 | + new ObjectParameter("sAccoutNumber", typeof(string)); | |
3171 | + | |
3172 | + var sLicenseeFirstNameParameter = sLicenseeFirstName != null ? | |
3173 | + new ObjectParameter("sLicenseeFirstName", sLicenseeFirstName) : | |
3174 | + new ObjectParameter("sLicenseeFirstName", typeof(string)); | |
3175 | + | |
3176 | + var sLicenseeLastNameParameter = sLicenseeLastName != null ? | |
3177 | + new ObjectParameter("sLicenseeLastName", sLicenseeLastName) : | |
3178 | + new ObjectParameter("sLicenseeLastName", typeof(string)); | |
3179 | + | |
3180 | + var iLicenseTypeIdParameter = iLicenseTypeId.HasValue ? | |
3181 | + new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : | |
3182 | + new ObjectParameter("iLicenseTypeId", typeof(byte)); | |
3183 | + | |
3184 | + var sInstituteNameParameter = sInstituteName != null ? | |
3185 | + new ObjectParameter("sInstituteName", sInstituteName) : | |
3186 | + new ObjectParameter("sInstituteName", typeof(string)); | |
3187 | + | |
3188 | + var sEmailParameter = sEmail != null ? | |
3189 | + new ObjectParameter("sEmail", sEmail) : | |
3190 | + new ObjectParameter("sEmail", typeof(string)); | |
3191 | + | |
3192 | + var iStateIdParameter = iStateId.HasValue ? | |
3193 | + new ObjectParameter("iStateId", iStateId) : | |
3194 | + new ObjectParameter("iStateId", typeof(int)); | |
3195 | + | |
3196 | + var iCountryIdParameter = iCountryId.HasValue ? | |
3197 | + new ObjectParameter("iCountryId", iCountryId) : | |
3198 | + new ObjectParameter("iCountryId", typeof(int)); | |
3199 | + | |
3200 | + var bisActiveParameter = bisActive.HasValue ? | |
3201 | + new ObjectParameter("bisActive", bisActive) : | |
3202 | + new ObjectParameter("bisActive", typeof(bool)); | |
3203 | + | |
3204 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenses_Result>("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter); | |
3205 | + } | |
3206 | + | |
3207 | + public virtual ObjectResult<usp_GetLicenseTypes_Result> usp_GetLicenseTypes() | |
3208 | + { | |
3209 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenseTypes_Result>("usp_GetLicenseTypes"); | |
3210 | + } | |
3211 | + | |
3212 | + public virtual ObjectResult<usp_GetManageRights_Result> usp_GetManageRights(Nullable<int> userId, string roleName) | |
3213 | + { | |
3214 | + var userIdParameter = userId.HasValue ? | |
3215 | + new ObjectParameter("UserId", userId) : | |
3216 | + new ObjectParameter("UserId", typeof(int)); | |
3217 | + | |
3218 | + var roleNameParameter = roleName != null ? | |
3219 | + new ObjectParameter("RoleName", roleName) : | |
3220 | + new ObjectParameter("RoleName", typeof(string)); | |
3221 | + | |
3222 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetManageRights_Result>("usp_GetManageRights", userIdParameter, roleNameParameter); | |
3223 | + } | |
3143 | 3224 | } |
3144 | 3225 | } | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... | ... | @@ -2624,6 +2624,28 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does |
2624 | 2624 | <Function Name="usp_GetAccountTypeList" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2625 | 2625 | <Parameter Name="Id" Type="int" Mode="In" /> |
2626 | 2626 | </Function> |
2627 | + <Function Name="usp_GetEditions" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> | |
2628 | + <Function Name="usp_GetLicenseById" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | |
2629 | + <Parameter Name="Id" Type="int" Mode="In" /> | |
2630 | + </Function> | |
2631 | + <Function Name="usp_GetLicenses" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | |
2632 | + <Parameter Name="sStartDate" Type="varchar" Mode="In" /> | |
2633 | + <Parameter Name="sEndDate" Type="varchar" Mode="In" /> | |
2634 | + <Parameter Name="sAccoutNumber" Type="varchar" Mode="In" /> | |
2635 | + <Parameter Name="sLicenseeFirstName" Type="varchar" Mode="In" /> | |
2636 | + <Parameter Name="sLicenseeLastName" Type="varchar" Mode="In" /> | |
2637 | + <Parameter Name="iLicenseTypeId" Type="tinyint" Mode="In" /> | |
2638 | + <Parameter Name="sInstituteName" Type="varchar" Mode="In" /> | |
2639 | + <Parameter Name="sEmail" Type="varchar" Mode="In" /> | |
2640 | + <Parameter Name="iStateId" Type="int" Mode="In" /> | |
2641 | + <Parameter Name="iCountryId" Type="int" Mode="In" /> | |
2642 | + <Parameter Name="bisActive" Type="bit" Mode="In" /> | |
2643 | + </Function> | |
2644 | + <Function Name="usp_GetLicenseTypes" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> | |
2645 | + <Function Name="usp_GetManageRights" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | |
2646 | + <Parameter Name="UserId" Type="int" Mode="In" /> | |
2647 | + <Parameter Name="RoleName" Type="varchar" Mode="In" /> | |
2648 | + </Function> | |
2627 | 2649 | <Function Name="usp_GetProductEditionByLicense" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2628 | 2650 | <Parameter Name="iLicenseId" Type="int" Mode="In" /> |
2629 | 2651 | </Function> |
... | ... | @@ -6199,6 +6221,28 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin |
6199 | 6221 | <Parameter Name="isActive" Mode="In" Type="Byte" /> |
6200 | 6222 | <Parameter Name="Status" Mode="InOut" Type="Int32" /> |
6201 | 6223 | </FunctionImport> |
6224 | + <FunctionImport Name="usp_GetEditions" ReturnType="Collection(AIADatabaseV5Model.usp_GetEditions_Result)" /> | |
6225 | + <FunctionImport Name="usp_GetLicenseById" ReturnType="Collection(AIADatabaseV5Model.usp_GetLicenseById_Result)"> | |
6226 | + <Parameter Name="Id" Mode="In" Type="Int32" /> | |
6227 | + </FunctionImport> | |
6228 | + <FunctionImport Name="usp_GetLicenses" ReturnType="Collection(AIADatabaseV5Model.usp_GetLicenses_Result)"> | |
6229 | + <Parameter Name="sStartDate" Mode="In" Type="String" /> | |
6230 | + <Parameter Name="sEndDate" Mode="In" Type="String" /> | |
6231 | + <Parameter Name="sAccoutNumber" Mode="In" Type="String" /> | |
6232 | + <Parameter Name="sLicenseeFirstName" Mode="In" Type="String" /> | |
6233 | + <Parameter Name="sLicenseeLastName" Mode="In" Type="String" /> | |
6234 | + <Parameter Name="iLicenseTypeId" Mode="In" Type="Byte" /> | |
6235 | + <Parameter Name="sInstituteName" Mode="In" Type="String" /> | |
6236 | + <Parameter Name="sEmail" Mode="In" Type="String" /> | |
6237 | + <Parameter Name="iStateId" Mode="In" Type="Int32" /> | |
6238 | + <Parameter Name="iCountryId" Mode="In" Type="Int32" /> | |
6239 | + <Parameter Name="bisActive" Mode="In" Type="Boolean" /> | |
6240 | + </FunctionImport> | |
6241 | + <FunctionImport Name="usp_GetLicenseTypes" ReturnType="Collection(AIADatabaseV5Model.usp_GetLicenseTypes_Result)" /> | |
6242 | + <FunctionImport Name="usp_GetManageRights" ReturnType="Collection(AIADatabaseV5Model.usp_GetManageRights_Result)"> | |
6243 | + <Parameter Name="UserId" Mode="In" Type="Int32" /> | |
6244 | + <Parameter Name="RoleName" Mode="In" Type="String" /> | |
6245 | + </FunctionImport> | |
6202 | 6246 | </EntityContainer> |
6203 | 6247 | <ComplexType Name="DA_GetBaseLayer_Result"> |
6204 | 6248 | <Property Type="Int32" Name="Id" Nullable="false" /> |
... | ... | @@ -7044,6 +7088,81 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin |
7044 | 7088 | <Property Type="String" Name="Modifiedby" Nullable="true" MaxLength="50" /> |
7045 | 7089 | <Property Type="DateTime" Name="DeactivationDate" Nullable="true" Precision="23" /> |
7046 | 7090 | </ComplexType> |
7091 | + <ComplexType Name="usp_GetEditions_Result"> | |
7092 | + <Property Type="Byte" Name="Id" Nullable="false" /> | |
7093 | + <Property Type="String" Name="Title" Nullable="false" MaxLength="50" /> | |
7094 | + <Property Type="Byte" Name="Priority" Nullable="false" /> | |
7095 | + <Property Type="Boolean" Name="IsActive" Nullable="false" /> | |
7096 | + </ComplexType> | |
7097 | + <ComplexType Name="usp_GetLicenseById_Result"> | |
7098 | + <Property Type="Int32" Name="Id" Nullable="false" /> | |
7099 | + <Property Type="Byte" Name="LicenseTypeId" Nullable="false" /> | |
7100 | + <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="16" /> | |
7101 | + <Property Type="Byte" Name="AccountTypeId" Nullable="false" /> | |
7102 | + <Property Type="String" Name="Address1" Nullable="true" MaxLength="100" /> | |
7103 | + <Property Type="String" Name="Address2" Nullable="true" MaxLength="100" /> | |
7104 | + <Property Type="String" Name="LicenseeFirstName" Nullable="false" MaxLength="50" /> | |
7105 | + <Property Type="String" Name="LicenseeLastName" Nullable="false" MaxLength="50" /> | |
7106 | + <Property Type="String" Name="City" Nullable="true" MaxLength="50" /> | |
7107 | + <Property Type="Int32" Name="CountryId" Nullable="false" /> | |
7108 | + <Property Type="Int32" Name="StateId" Nullable="false" /> | |
7109 | + <Property Type="String" Name="EmailId" Nullable="true" MaxLength="50" /> | |
7110 | + <Property Type="String" Name="InstitutionName" Nullable="true" MaxLength="100" /> | |
7111 | + <Property Type="String" Name="Phone" Nullable="true" MaxLength="30" /> | |
7112 | + <Property Type="String" Name="ProductId" Nullable="true" MaxLength="50" /> | |
7113 | + <Property Type="String" Name="Zip" Nullable="true" MaxLength="20" /> | |
7114 | + <Property Type="Int32" Name="TotalLogins" Nullable="false" /> | |
7115 | + <Property Type="String" Name="EditionLogins" Nullable="true" MaxLength="1000" /> | |
7116 | + <Property Type="DateTime" Name="SubscriptionStartDate" Nullable="true" Precision="23" /> | |
7117 | + <Property Type="DateTime" Name="SubscriptionEndDate" Nullable="true" Precision="23" /> | |
7118 | + <Property Type="Int32" Name="NoOfImages" Nullable="true" /> | |
7119 | + <Property Type="Decimal" Name="Price" Nullable="true" Precision="19" /> | |
7120 | + <Property Type="String" Name="SiteUrl" Nullable="true" MaxLength="100" /> | |
7121 | + <Property Type="String" Name="SitToUrl" Nullable="true" MaxLength="100" /> | |
7122 | + <Property Type="String" Name="SiteMasterUrl" Nullable="true" MaxLength="100" /> | |
7123 | + <Property Type="Int32" Name="UserId" Nullable="true" /> | |
7124 | + <Property Type="String" Name="Login" Nullable="true" MaxLength="100" /> | |
7125 | + <Property Type="String" Name="Password" Nullable="true" MaxLength="100" /> | |
7126 | + <Property Type="Int32" Name="SecurityQuestionId" Nullable="true" /> | |
7127 | + <Property Type="String" Name="Answer" Nullable="true" MaxLength="100" /> | |
7128 | + <Property Type="Int32" Name="TotalRenewals" Nullable="false" /> | |
7129 | + <Property Type="DateTime" Name="RenewalDate" Nullable="true" Precision="23" /> | |
7130 | + <Property Type="Boolean" Name="IsActive" Nullable="false" /> | |
7131 | + </ComplexType> | |
7132 | + <ComplexType Name="usp_GetLicenses_Result"> | |
7133 | + <Property Type="Int32" Name="LicenseId" Nullable="false" /> | |
7134 | + <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="16" /> | |
7135 | + <Property Type="String" Name="LicenseType" Nullable="false" MaxLength="50" /> | |
7136 | + <Property Type="String" Name="AccountType" Nullable="false" MaxLength="50" /> | |
7137 | + <Property Type="String" Name="InstitutionName" Nullable="true" MaxLength="100" /> | |
7138 | + <Property Type="String" Name="LicenseState" Nullable="false" MaxLength="50" /> | |
7139 | + <Property Type="String" Name="LicenseCountry" Nullable="false" MaxLength="50" /> | |
7140 | + <Property Type="String" Name="EmailId" Nullable="true" MaxLength="50" /> | |
7141 | + <Property Type="Int32" Name="CardNumber" Nullable="true" /> | |
7142 | + <Property Type="String" Name="ProductKey" Nullable="true" MaxLength="50" /> | |
7143 | + <Property Type="String" Name="ClientAdmin" Nullable="true" /> | |
7144 | + <Property Type="String" Name="LicenseeName" Nullable="false" MaxLength="101" /> | |
7145 | + <Property Type="String" Name="ContactAddress" Nullable="false" MaxLength="252" /> | |
7146 | + <Property Type="String" Name="EntryDate" Nullable="true" MaxLength="30" /> | |
7147 | + <Property Type="String" Name="LicenseStatus" Nullable="false" MaxLength="8" /> | |
7148 | + <Property Type="String" Name="ModifyDate" Nullable="false" MaxLength="30" /> | |
7149 | + <Property Type="String" Name="StartDate" Nullable="true" MaxLength="30" /> | |
7150 | + <Property Type="String" Name="RenewDate" Nullable="false" MaxLength="30" /> | |
7151 | + <Property Type="String" Name="EndDate" Nullable="true" MaxLength="30" /> | |
7152 | + <Property Type="Int32" Name="NoofImages" Nullable="true" /> | |
7153 | + </ComplexType> | |
7154 | + <ComplexType Name="usp_GetLicenseTypes_Result"> | |
7155 | + <Property Type="Byte" Name="Id" Nullable="false" /> | |
7156 | + <Property Type="String" Name="Title" Nullable="false" MaxLength="50" /> | |
7157 | + <Property Type="Boolean" Name="IsActive" Nullable="false" /> | |
7158 | + </ComplexType> | |
7159 | + <ComplexType Name="usp_GetManageRights_Result"> | |
7160 | + <Property Type="Int32" Name="Id" Nullable="false" /> | |
7161 | + <Property Type="String" Name="Title" Nullable="false" MaxLength="100" /> | |
7162 | + <Property Type="Int32" Name="ParentId" Nullable="false" /> | |
7163 | + <Property Type="Byte" Name="Priority" Nullable="true" /> | |
7164 | + <Property Type="String" Name="MenuStatus" Nullable="false" MaxLength="1" /> | |
7165 | + </ComplexType> | |
7047 | 7166 | </Schema> |
7048 | 7167 | </edmx:ConceptualModels> |
7049 | 7168 | <!-- C-S mapping content --> |
... | ... | @@ -9410,6 +9529,101 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin |
9410 | 9529 | </ResultMapping> |
9411 | 9530 | </FunctionImportMapping> |
9412 | 9531 | <FunctionImportMapping FunctionImportName="usp_UpdateAIAUser" FunctionName="AIADatabaseV5Model.Store.usp_UpdateAIAUser" /> |
9532 | + <FunctionImportMapping FunctionImportName="usp_GetEditions" FunctionName="AIADatabaseV5Model.Store.usp_GetEditions"> | |
9533 | + <ResultMapping> | |
9534 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetEditions_Result"> | |
9535 | + <ScalarProperty Name="Id" ColumnName="Id" /> | |
9536 | + <ScalarProperty Name="Title" ColumnName="Title" /> | |
9537 | + <ScalarProperty Name="Priority" ColumnName="Priority" /> | |
9538 | + <ScalarProperty Name="IsActive" ColumnName="IsActive" /> | |
9539 | + </ComplexTypeMapping> | |
9540 | + </ResultMapping> | |
9541 | + </FunctionImportMapping> | |
9542 | + <FunctionImportMapping FunctionImportName="usp_GetLicenseById" FunctionName="AIADatabaseV5Model.Store.usp_GetLicenseById"> | |
9543 | + <ResultMapping> | |
9544 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetLicenseById_Result"> | |
9545 | + <ScalarProperty Name="Id" ColumnName="Id" /> | |
9546 | + <ScalarProperty Name="LicenseTypeId" ColumnName="LicenseTypeId" /> | |
9547 | + <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" /> | |
9548 | + <ScalarProperty Name="AccountTypeId" ColumnName="AccountTypeId" /> | |
9549 | + <ScalarProperty Name="Address1" ColumnName="Address1" /> | |
9550 | + <ScalarProperty Name="Address2" ColumnName="Address2" /> | |
9551 | + <ScalarProperty Name="LicenseeFirstName" ColumnName="LicenseeFirstName" /> | |
9552 | + <ScalarProperty Name="LicenseeLastName" ColumnName="LicenseeLastName" /> | |
9553 | + <ScalarProperty Name="City" ColumnName="City" /> | |
9554 | + <ScalarProperty Name="CountryId" ColumnName="CountryId" /> | |
9555 | + <ScalarProperty Name="StateId" ColumnName="StateId" /> | |
9556 | + <ScalarProperty Name="EmailId" ColumnName="EmailId" /> | |
9557 | + <ScalarProperty Name="InstitutionName" ColumnName="InstitutionName" /> | |
9558 | + <ScalarProperty Name="Phone" ColumnName="Phone" /> | |
9559 | + <ScalarProperty Name="ProductId" ColumnName="ProductId" /> | |
9560 | + <ScalarProperty Name="Zip" ColumnName="Zip" /> | |
9561 | + <ScalarProperty Name="TotalLogins" ColumnName="TotalLogins" /> | |
9562 | + <ScalarProperty Name="EditionLogins" ColumnName="EditionLogins" /> | |
9563 | + <ScalarProperty Name="SubscriptionStartDate" ColumnName="SubscriptionStartDate" /> | |
9564 | + <ScalarProperty Name="SubscriptionEndDate" ColumnName="SubscriptionEndDate" /> | |
9565 | + <ScalarProperty Name="NoOfImages" ColumnName="NoOfImages" /> | |
9566 | + <ScalarProperty Name="Price" ColumnName="Price" /> | |
9567 | + <ScalarProperty Name="SiteUrl" ColumnName="SiteUrl" /> | |
9568 | + <ScalarProperty Name="SitToUrl" ColumnName="SitToUrl" /> | |
9569 | + <ScalarProperty Name="SiteMasterUrl" ColumnName="SiteMasterUrl" /> | |
9570 | + <ScalarProperty Name="UserId" ColumnName="UserId" /> | |
9571 | + <ScalarProperty Name="Login" ColumnName="Login" /> | |
9572 | + <ScalarProperty Name="Password" ColumnName="Password" /> | |
9573 | + <ScalarProperty Name="SecurityQuestionId" ColumnName="SecurityQuestionId" /> | |
9574 | + <ScalarProperty Name="Answer" ColumnName="Answer" /> | |
9575 | + <ScalarProperty Name="TotalRenewals" ColumnName="TotalRenewals" /> | |
9576 | + <ScalarProperty Name="RenewalDate" ColumnName="RenewalDate" /> | |
9577 | + <ScalarProperty Name="IsActive" ColumnName="IsActive" /> | |
9578 | + </ComplexTypeMapping> | |
9579 | + </ResultMapping> | |
9580 | + </FunctionImportMapping> | |
9581 | + <FunctionImportMapping FunctionImportName="usp_GetLicenses" FunctionName="AIADatabaseV5Model.Store.usp_GetLicenses"> | |
9582 | + <ResultMapping> | |
9583 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetLicenses_Result"> | |
9584 | + <ScalarProperty Name="LicenseId" ColumnName="LicenseId" /> | |
9585 | + <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" /> | |
9586 | + <ScalarProperty Name="LicenseType" ColumnName="LicenseType" /> | |
9587 | + <ScalarProperty Name="AccountType" ColumnName="AccountType" /> | |
9588 | + <ScalarProperty Name="InstitutionName" ColumnName="InstitutionName" /> | |
9589 | + <ScalarProperty Name="LicenseState" ColumnName="LicenseState" /> | |
9590 | + <ScalarProperty Name="LicenseCountry" ColumnName="LicenseCountry" /> | |
9591 | + <ScalarProperty Name="EmailId" ColumnName="EmailId" /> | |
9592 | + <ScalarProperty Name="CardNumber" ColumnName="CardNumber" /> | |
9593 | + <ScalarProperty Name="ProductKey" ColumnName="ProductKey" /> | |
9594 | + <ScalarProperty Name="ClientAdmin" ColumnName="ClientAdmin" /> | |
9595 | + <ScalarProperty Name="LicenseeName" ColumnName="LicenseeName" /> | |
9596 | + <ScalarProperty Name="ContactAddress" ColumnName="ContactAddress" /> | |
9597 | + <ScalarProperty Name="EntryDate" ColumnName="EntryDate" /> | |
9598 | + <ScalarProperty Name="LicenseStatus" ColumnName="LicenseStatus" /> | |
9599 | + <ScalarProperty Name="ModifyDate" ColumnName="ModifyDate" /> | |
9600 | + <ScalarProperty Name="StartDate" ColumnName="StartDate" /> | |
9601 | + <ScalarProperty Name="RenewDate" ColumnName="RenewDate" /> | |
9602 | + <ScalarProperty Name="EndDate" ColumnName="EndDate" /> | |
9603 | + <ScalarProperty Name="NoofImages" ColumnName="NoofImages" /> | |
9604 | + </ComplexTypeMapping> | |
9605 | + </ResultMapping> | |
9606 | + </FunctionImportMapping> | |
9607 | + <FunctionImportMapping FunctionImportName="usp_GetLicenseTypes" FunctionName="AIADatabaseV5Model.Store.usp_GetLicenseTypes"> | |
9608 | + <ResultMapping> | |
9609 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetLicenseTypes_Result"> | |
9610 | + <ScalarProperty Name="Id" ColumnName="Id" /> | |
9611 | + <ScalarProperty Name="Title" ColumnName="Title" /> | |
9612 | + <ScalarProperty Name="IsActive" ColumnName="IsActive" /> | |
9613 | + </ComplexTypeMapping> | |
9614 | + </ResultMapping> | |
9615 | + </FunctionImportMapping> | |
9616 | + <FunctionImportMapping FunctionImportName="usp_GetManageRights" FunctionName="AIADatabaseV5Model.Store.usp_GetManageRights"> | |
9617 | + <ResultMapping> | |
9618 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetManageRights_Result"> | |
9619 | + <ScalarProperty Name="Id" ColumnName="Id" /> | |
9620 | + <ScalarProperty Name="Title" ColumnName="Title" /> | |
9621 | + <ScalarProperty Name="ParentId" ColumnName="ParentId" /> | |
9622 | + <ScalarProperty Name="Priority" ColumnName="Priority" /> | |
9623 | + <ScalarProperty Name="MenuStatus" ColumnName="MenuStatus" /> | |
9624 | + </ComplexTypeMapping> | |
9625 | + </ResultMapping> | |
9626 | + </FunctionImportMapping> | |
9413 | 9627 | </EntityContainerMapping> |
9414 | 9628 | </Mapping> |
9415 | 9629 | </edmx:Mappings> | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetEditions_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class usp_GetEditions_Result | |
15 | + { | |
16 | + public byte Id { get; set; } | |
17 | + public string Title { get; set; } | |
18 | + public byte Priority { get; set; } | |
19 | + public bool IsActive { get; set; } | |
20 | + } | |
21 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseById_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class usp_GetLicenseById_Result | |
15 | + { | |
16 | + public int Id { get; set; } | |
17 | + public byte LicenseTypeId { get; set; } | |
18 | + public string AccountNumber { get; set; } | |
19 | + public byte AccountTypeId { get; set; } | |
20 | + public string Address1 { get; set; } | |
21 | + public string Address2 { get; set; } | |
22 | + public string LicenseeFirstName { get; set; } | |
23 | + public string LicenseeLastName { get; set; } | |
24 | + public string City { get; set; } | |
25 | + public int CountryId { get; set; } | |
26 | + public int StateId { get; set; } | |
27 | + public string EmailId { get; set; } | |
28 | + public string InstitutionName { get; set; } | |
29 | + public string Phone { get; set; } | |
30 | + public string ProductId { get; set; } | |
31 | + public string Zip { get; set; } | |
32 | + public int TotalLogins { get; set; } | |
33 | + public string EditionLogins { get; set; } | |
34 | + public Nullable<System.DateTime> SubscriptionStartDate { get; set; } | |
35 | + public Nullable<System.DateTime> SubscriptionEndDate { get; set; } | |
36 | + public Nullable<int> NoOfImages { get; set; } | |
37 | + public Nullable<decimal> Price { get; set; } | |
38 | + public string SiteUrl { get; set; } | |
39 | + public string SitToUrl { get; set; } | |
40 | + public string SiteMasterUrl { get; set; } | |
41 | + public Nullable<int> UserId { get; set; } | |
42 | + public string Login { get; set; } | |
43 | + public string Password { get; set; } | |
44 | + public Nullable<int> SecurityQuestionId { get; set; } | |
45 | + public string Answer { get; set; } | |
46 | + public int TotalRenewals { get; set; } | |
47 | + public Nullable<System.DateTime> RenewalDate { get; set; } | |
48 | + public bool IsActive { get; set; } | |
49 | + } | |
50 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseTypes_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class usp_GetLicenseTypes_Result | |
15 | + { | |
16 | + public byte Id { get; set; } | |
17 | + public string Title { get; set; } | |
18 | + public bool IsActive { get; set; } | |
19 | + } | |
20 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class usp_GetLicenses_Result | |
15 | + { | |
16 | + public int LicenseId { get; set; } | |
17 | + public string AccountNumber { get; set; } | |
18 | + public string LicenseType { get; set; } | |
19 | + public string AccountType { get; set; } | |
20 | + public string InstitutionName { get; set; } | |
21 | + public string LicenseState { get; set; } | |
22 | + public string LicenseCountry { get; set; } | |
23 | + public string EmailId { get; set; } | |
24 | + public Nullable<int> CardNumber { get; set; } | |
25 | + public string ProductKey { get; set; } | |
26 | + public string ClientAdmin { get; set; } | |
27 | + public string LicenseeName { get; set; } | |
28 | + public string ContactAddress { get; set; } | |
29 | + public string EntryDate { get; set; } | |
30 | + public string LicenseStatus { get; set; } | |
31 | + public string ModifyDate { get; set; } | |
32 | + public string StartDate { get; set; } | |
33 | + public string RenewDate { get; set; } | |
34 | + public string EndDate { get; set; } | |
35 | + public Nullable<int> NoofImages { get; set; } | |
36 | + } | |
37 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetManageRights_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class usp_GetManageRights_Result | |
15 | + { | |
16 | + public int Id { get; set; } | |
17 | + public string Title { get; set; } | |
18 | + public int ParentId { get; set; } | |
19 | + public Nullable<byte> Priority { get; set; } | |
20 | + public string MenuStatus { get; set; } | |
21 | + } | |
22 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/AccountModel.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Web; | |
5 | +using AIAHTML5.ADMIN.API.Entity; | |
6 | + | |
7 | +namespace AIAHTML5.ADMIN.API.Models | |
8 | +{ | |
9 | + | |
10 | + public class AccountTypeEntityModel | |
11 | + { | |
12 | + public int Id { get; set; } | |
13 | + public string Title { get; set; } | |
14 | + public bool IsActive { get; set; } | |
15 | + | |
16 | + public static List<AccountTypeEntityModel> GetActiveAccountTypes(AIADatabaseV5Entities dbContext) | |
17 | + { | |
18 | + List<AccountTypeEntityModel> AccountTypeList = new List<AccountTypeEntityModel>(); | |
19 | + AccountTypeEntityModel AccountTypeModelObj = new AccountTypeEntityModel(); | |
20 | + try | |
21 | + { | |
22 | + var result = dbContext.EC_GetAccountTypeList().ToList(); | |
23 | + if (result.Count > 0) | |
24 | + { | |
25 | + foreach (var item in result) | |
26 | + { | |
27 | + AccountTypeModelObj = new AccountTypeEntityModel(); | |
28 | + AccountTypeModelObj.Id = item.Id; | |
29 | + AccountTypeModelObj.Title = item.Title; | |
30 | + AccountTypeList.Add(AccountTypeModelObj); | |
31 | + } | |
32 | + } | |
33 | + } | |
34 | + catch (Exception ex) { } | |
35 | + return AccountTypeList; | |
36 | + } | |
37 | + | |
38 | + } | |
39 | + | |
40 | +} | |
0 | 41 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/CommonModel.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Web; | |
5 | +using AIAHTML5.ADMIN.API.Entity; | |
6 | + | |
7 | +namespace AIAHTML5.ADMIN.API.Models | |
8 | +{ | |
9 | + public class CountryModel | |
10 | + { | |
11 | + public int Id { get; set; } | |
12 | + public string CountryName { get; set; } | |
13 | + public string CountryCode { get; set; } | |
14 | + | |
15 | + public static List<CountryModel> GetCountries(AIADatabaseV5Entities dbContext) | |
16 | + { | |
17 | + List<CountryModel> CountryList = new List<CountryModel>(); | |
18 | + CountryModel CountryModelObj = new CountryModel(); | |
19 | + try | |
20 | + { | |
21 | + var result = dbContext.EC_GetCountryList().ToList(); | |
22 | + if (result.Count > 0) | |
23 | + { | |
24 | + foreach (var item in result) | |
25 | + { | |
26 | + CountryModelObj = new CountryModel(); | |
27 | + CountryModelObj.Id = item.Id; | |
28 | + CountryModelObj.CountryName = item.CountryName; | |
29 | + CountryList.Add(CountryModelObj); | |
30 | + } | |
31 | + } | |
32 | + } | |
33 | + catch (Exception ex) { } | |
34 | + return CountryList; | |
35 | + } | |
36 | + } | |
37 | + | |
38 | + public class StateModel | |
39 | + { | |
40 | + public int Id { get; set; } | |
41 | + public string StateName { get; set; } | |
42 | + public string StateCode { get; set; } | |
43 | + | |
44 | + public static List<StateModel> GetUsStates(AIADatabaseV5Entities dbContext) | |
45 | + { | |
46 | + List<StateModel> StateList = new List<StateModel>(); | |
47 | + StateModel StateModelObj = new StateModel(); | |
48 | + try | |
49 | + { | |
50 | + var result = dbContext.EC_GetStateList().ToList(); | |
51 | + if (result.Count > 0) | |
52 | + { | |
53 | + foreach (var item in result) | |
54 | + { | |
55 | + StateModelObj = new StateModel(); | |
56 | + StateModelObj.Id = item.Id; | |
57 | + StateModelObj.StateName = item.StateName; | |
58 | + StateList.Add(StateModelObj); | |
59 | + } | |
60 | + } | |
61 | + } | |
62 | + catch (Exception ex) { } | |
63 | + return StateList; | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + public class SecurityQuestionModel | |
68 | + { | |
69 | + public int Id { get; set; } | |
70 | + public string Title { get; set; } | |
71 | + | |
72 | + public static List<SecurityQuestionModel> GetSecurityQuestions(AIADatabaseV5Entities dbContext) | |
73 | + { | |
74 | + List<SecurityQuestionModel> SecurityQuestionList = new List<SecurityQuestionModel>(); | |
75 | + SecurityQuestionModel SecurityQuestionObj = new SecurityQuestionModel(); | |
76 | + try | |
77 | + { | |
78 | + var result = dbContext.EC_GetSecurityQuestionList().ToList(); | |
79 | + if (result.Count > 0) | |
80 | + { | |
81 | + foreach (var item in result) | |
82 | + { | |
83 | + SecurityQuestionObj = new SecurityQuestionModel(); | |
84 | + SecurityQuestionObj.Id = item.Id; | |
85 | + SecurityQuestionObj.Title = item.Title; | |
86 | + SecurityQuestionList.Add(SecurityQuestionObj); | |
87 | + } | |
88 | + } | |
89 | + } | |
90 | + catch (Exception ex) { } | |
91 | + return SecurityQuestionList; | |
92 | + } | |
93 | + } | |
94 | +} | |
0 | 95 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/EditionModel.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Web; | |
5 | +using AIAHTML5.ADMIN.API.Entity; | |
6 | + | |
7 | +namespace AIAHTML5.ADMIN.API.Models | |
8 | +{ | |
9 | + public class EditionModel | |
10 | + { | |
11 | + public int Id { get; set; } | |
12 | + public string Title { get; set; } | |
13 | + public int Priority { get; set; } | |
14 | + public bool IsActive { get; set; } | |
15 | + | |
16 | + public static List<EditionModel> GetEditions(AIADatabaseV5Entities dbContext) | |
17 | + { | |
18 | + List<EditionModel> EditionList = new List<EditionModel>(); | |
19 | + EditionModel EditionObj = new EditionModel(); | |
20 | + int i = 0; | |
21 | + try | |
22 | + { | |
23 | + var result = dbContext.usp_GetEditions().ToList(); | |
24 | + if (result.Count > 0) | |
25 | + { | |
26 | + foreach (var item in result) | |
27 | + { | |
28 | + EditionObj = new EditionModel(); | |
29 | + EditionObj.Id = item.Id; | |
30 | + EditionObj.Title = item.Title; | |
31 | + EditionObj.Priority = item.Priority; | |
32 | + EditionObj.IsActive = item.IsActive; | |
33 | + EditionList.Add(EditionObj); | |
34 | + } | |
35 | + } | |
36 | + } | |
37 | + catch (Exception ex) { } | |
38 | + return EditionList; | |
39 | + } | |
40 | + } | |
41 | + | |
42 | +} | |
0 | 43 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Web; | |
5 | +using AIAHTML5.ADMIN.API.Entity; | |
6 | + | |
7 | +namespace AIAHTML5.ADMIN.API.Models | |
8 | +{ | |
9 | + public class LicenseModel | |
10 | + { | |
11 | + public int LicenseId { get; set; } | |
12 | + public string AccountNumber { get; set; } | |
13 | + public byte AccountTypeId { get; set; } | |
14 | + public string AccountTypeName { get; set; } | |
15 | + public string LicenseeFirstName { get; set; } | |
16 | + public string LicenseeLastName { get; set; } | |
17 | + public string LicenseeName { get; set; } | |
18 | + public byte LicenseTypeId { get; set; } | |
19 | + public string LicenseTypeName { get; set; } | |
20 | + public string InstitutionName { get; set; } | |
21 | + public int? StateId { get; set; } | |
22 | + public int? CountryId { get; set; } | |
23 | + public string LicenseState { get; set; } | |
24 | + public string Address { get; set; } | |
25 | + public string Address1 { get; set; } | |
26 | + public string Address2 { get; set; } | |
27 | + public string City { get; set; } | |
28 | + public string Zip { get; set; } | |
29 | + public string Phone { get; set; } | |
30 | + public string LicenseCountry { get; set; } | |
31 | + public string EmailId { get; set; } | |
32 | + public int? NoOfImages { get; set; } | |
33 | + public string ClientAdmin { get; set; } | |
34 | + public string ProductKey { get; set; } | |
35 | + public int? CardNumber { get; set; } | |
36 | + public DateTime SubscriptionStartDate { get; set; } | |
37 | + public DateTime SubscriptionEndDate { get; set; } | |
38 | + public DateTime EntryDate { get; set; } | |
39 | + public DateTime RenewDate { get; set; } | |
40 | + public DateTime ModifyDate { get; set; } | |
41 | + public bool IsActive { get; set; } | |
42 | + public int? TotalLogins { get; set; } | |
43 | + public string EditionLogins { get; set; } | |
44 | + public decimal Price { get; set; } | |
45 | + public string LoginId { get; set; } | |
46 | + public string Password { get; set; } | |
47 | + public byte? SecurityQuestionId { get; set; } | |
48 | + public string Answer { get; set; } | |
49 | + public int CreatorId { get; set; } | |
50 | + public int TotalRenewals { get; set; } | |
51 | + public string MasterSiteUrl { get; set; } | |
52 | + public string SiteUrlTo { get; set; } | |
53 | + public string SiteUrlFrom { get; set; } | |
54 | + public byte? TestLicenseEditionId { get; set; } | |
55 | + public bool IsRenew { get; set; } | |
56 | + | |
57 | + public static List<LicenseModel> GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, | |
58 | + string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, | |
59 | + DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive) | |
60 | + { | |
61 | + List<LicenseModel> LicenseList = new List<LicenseModel>(); | |
62 | + LicenseModel LicenseObj = new LicenseModel(); | |
63 | + int i = 0; | |
64 | + try | |
65 | + { | |
66 | + var result = dbContext.usp_GetLicenses( | |
67 | + (subscriptionStartDate > DateTime.MinValue ? subscriptionStartDate.ToShortDateString() : "01/01/01"), | |
68 | + (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"), | |
69 | + (accountNumber == null ? "" : accountNumber), (licenseeFirstName == null ? "" : licenseeFirstName), | |
70 | + (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), | |
71 | + (emailId == null ? "" : emailId), stateId, countryId, isActive).ToList(); | |
72 | + if (result.Count > 0) | |
73 | + { | |
74 | + foreach (var item in result) | |
75 | + { | |
76 | + LicenseObj = new LicenseModel(); | |
77 | + LicenseObj.LicenseId = item.LicenseId; | |
78 | + LicenseObj.AccountNumber = item.AccountNumber; | |
79 | + LicenseObj.AccountTypeName = item.AccountType; | |
80 | + LicenseObj.LicenseeName = item.LicenseeName; | |
81 | + LicenseObj.LicenseState = item.LicenseState; | |
82 | + LicenseObj.LicenseCountry = item.LicenseCountry; | |
83 | + LicenseObj.Address = item.ContactAddress; | |
84 | + LicenseObj.InstitutionName = item.InstitutionName; | |
85 | + LicenseObj.LicenseTypeName = item.LicenseType; | |
86 | + LicenseObj.EmailId = item.EmailId; | |
87 | + LicenseObj.NoOfImages = item.NoofImages; | |
88 | + LicenseObj.ClientAdmin = item.ClientAdmin; | |
89 | + LicenseObj.CardNumber = item.CardNumber; | |
90 | + LicenseObj.ProductKey = item.ProductKey; | |
91 | + LicenseObj.SubscriptionStartDate = DateTime.ParseExact(item.StartDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); | |
92 | + LicenseObj.SubscriptionEndDate = DateTime.ParseExact(item.EndDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); | |
93 | + LicenseObj.EntryDate = DateTime.ParseExact(item.EntryDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); | |
94 | + LicenseObj.RenewDate = DateTime.ParseExact((item.RenewDate == "" ? "01/01/0001" : item.RenewDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); | |
95 | + LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); | |
96 | + LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false); | |
97 | + LicenseList.Add(LicenseObj); | |
98 | + i++; | |
99 | + if (i >= 100) break; | |
100 | + } | |
101 | + } | |
102 | + } | |
103 | + catch (Exception ex) { } | |
104 | + return LicenseList; | |
105 | + } | |
106 | + | |
107 | + public static LicenseModel GetLicenseById(AIADatabaseV5Entities dbContext, int LicenseId) | |
108 | + { | |
109 | + LicenseModel LicenseObj = new LicenseModel(); | |
110 | + try | |
111 | + { | |
112 | + var result = dbContext.usp_GetLicenseById(LicenseId).ToList(); | |
113 | + if (result.Count > 0) | |
114 | + { | |
115 | + LicenseObj.LicenseId = result[0].Id; | |
116 | + LicenseObj.LicenseTypeId = result[0].LicenseTypeId; | |
117 | + LicenseObj.AccountNumber = result[0].AccountNumber; | |
118 | + LicenseObj.AccountTypeId = result[0].AccountTypeId; | |
119 | + LicenseObj.LicenseeFirstName = result[0].LicenseeFirstName; | |
120 | + LicenseObj.LicenseeLastName = result[0].LicenseeLastName; | |
121 | + LicenseObj.EditionLogins = result[0].EditionLogins; | |
122 | + LicenseObj.TotalLogins = result[0].TotalLogins; | |
123 | + LicenseObj.Address1 = result[0].Address1; | |
124 | + LicenseObj.Address2 = result[0].Address2; | |
125 | + LicenseObj.City = result[0].City; | |
126 | + LicenseObj.CountryId = result[0].CountryId; | |
127 | + LicenseObj.StateId = result[0].StateId; | |
128 | + LicenseObj.InstitutionName = result[0].InstitutionName; | |
129 | + LicenseObj.EmailId = result[0].EmailId; | |
130 | + LicenseObj.Zip = result[0].Zip; | |
131 | + LicenseObj.Phone = result[0].Phone; | |
132 | + LicenseObj.TotalLogins = result[0].TotalLogins; | |
133 | + LicenseObj.ProductKey = result[0].ProductId; | |
134 | + LicenseObj.Price = result[0].Price.Value; | |
135 | + LicenseObj.NoOfImages = result[0].NoOfImages; | |
136 | + LicenseObj.MasterSiteUrl = result[0].SiteUrl; | |
137 | + LicenseObj.SiteUrlTo = result[0].SitToUrl; | |
138 | + LicenseObj.SiteUrlFrom = result[0].SiteMasterUrl; | |
139 | + LicenseObj.LoginId = result[0].Login; | |
140 | + LicenseObj.Password = result[0].Password; | |
141 | + LicenseObj.SecurityQuestionId = (byte?)result[0].SecurityQuestionId; | |
142 | + LicenseObj.Answer = result[0].Answer; | |
143 | + LicenseObj.IsActive = result[0].IsActive; | |
144 | + LicenseObj.TotalRenewals = result[0].TotalRenewals; | |
145 | + LicenseObj.SubscriptionStartDate = (result[0].SubscriptionStartDate == null ? DateTime.MinValue : result[0].SubscriptionStartDate.Value); | |
146 | + LicenseObj.SubscriptionEndDate = (result[0].SubscriptionEndDate == null ? DateTime.MinValue : result[0].SubscriptionEndDate.Value); | |
147 | + LicenseObj.RenewDate = (result[0].RenewalDate == null ? DateTime.MinValue : result[0].RenewalDate.Value); | |
148 | + } | |
149 | + } | |
150 | + catch (Exception ex) { } | |
151 | + return LicenseObj; | |
152 | + } | |
153 | + | |
154 | + public static bool InsertLicense(AIADatabaseV5Entities dbContext, LicenseModel licenseModel) | |
155 | + { | |
156 | + bool status = false; | |
157 | + try | |
158 | + { | |
159 | + switch (licenseModel.LicenseTypeId) | |
160 | + { | |
161 | + case 1: | |
162 | + var result = dbContext.InsertNewLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, | |
163 | + licenseModel.LicenseTypeId, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, | |
164 | + licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, | |
165 | + licenseModel.TotalLogins, licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
166 | + licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.SiteUrlTo, | |
167 | + licenseModel.SiteUrlFrom, licenseModel.NoOfImages); | |
168 | + if (result.Count() > 0) | |
169 | + { | |
170 | + status = true; | |
171 | + } | |
172 | + break; | |
173 | + case 2: | |
174 | + result = dbContext.InsertSingleLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, licenseModel.AccountTypeId, | |
175 | + licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, licenseModel.City, licenseModel.Zip, | |
176 | + licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, licenseModel.TotalLogins, | |
177 | + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
178 | + licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.LoginId, licenseModel.Password, | |
179 | + licenseModel.SecurityQuestionId, licenseModel.Answer, licenseModel.CreatorId, licenseModel.NoOfImages); | |
180 | + if (result.Count() > 0) | |
181 | + { | |
182 | + status = true; | |
183 | + } | |
184 | + break; | |
185 | + case 3: | |
186 | + result = dbContext.InsertNewLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, | |
187 | + licenseModel.LicenseTypeId, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, | |
188 | + licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, | |
189 | + licenseModel.TotalLogins, licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
190 | + licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.SiteUrlTo, | |
191 | + licenseModel.SiteUrlFrom, licenseModel.NoOfImages); | |
192 | + if (result.Count() > 0) | |
193 | + { | |
194 | + status = true; | |
195 | + } | |
196 | + break; | |
197 | + case 4: | |
198 | + var result1 = dbContext.InsertResellerLicenseAccount(licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, licenseModel.LicenseTypeId, | |
199 | + licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, | |
200 | + licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, | |
201 | + licenseModel.TotalLogins, licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
202 | + licenseModel.EditionLogins, licenseModel.Price, licenseModel.CreatorId, licenseModel.ProductKey, licenseModel.NoOfImages); | |
203 | + if (result1.Count() > 0) | |
204 | + { | |
205 | + status = true; | |
206 | + } | |
207 | + break; | |
208 | + case 5: | |
209 | + result = dbContext.InsertTestLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, | |
210 | + licenseModel.LoginId, licenseModel.Password, licenseModel.EmailId, licenseModel.AccountTypeId, licenseModel.TestLicenseEditionId, | |
211 | + licenseModel.Address1, licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, | |
212 | + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
213 | + licenseModel.CreatorId, licenseModel.NoOfImages); | |
214 | + if (result.Count() > 0) | |
215 | + { | |
216 | + status = true; | |
217 | + } | |
218 | + break; | |
219 | + } | |
220 | + return status; | |
221 | + } | |
222 | + catch (Exception ex) | |
223 | + { | |
224 | + return false; | |
225 | + } | |
226 | + } | |
227 | + | |
228 | + public static bool UpdateLicense(AIADatabaseV5Entities dbContext, LicenseModel licenseModel) | |
229 | + { | |
230 | + bool status = false; | |
231 | + try | |
232 | + { | |
233 | + var result = dbContext.UpdateLicenseAccount(licenseModel.LicenseId, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, | |
234 | + licenseModel.LicenseTypeId, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, | |
235 | + licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, | |
236 | + (byte)(licenseModel.IsActive == false ? 0 : 1), licenseModel.TotalLogins, (byte)(licenseModel.IsRenew == false ? 0 : 1), | |
237 | + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), | |
238 | + licenseModel.RenewDate.ToString("MM/dd/yyyy"), licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, | |
239 | + licenseModel.ProductKey, licenseModel.SiteUrlTo, licenseModel.SiteUrlFrom, licenseModel.NoOfImages); | |
240 | + if (result.Count() > 0) | |
241 | + { | |
242 | + status = true; | |
243 | + } | |
244 | + return status; | |
245 | + } | |
246 | + catch (Exception ex) | |
247 | + { | |
248 | + return false; | |
249 | + } | |
250 | + } | |
251 | + | |
252 | + public static bool DeleteLicense(AIADatabaseV5Entities dbContext, int LicenseId) | |
253 | + { | |
254 | + try | |
255 | + { | |
256 | + var spStatus = dbContext.DeleteLicense(LicenseId); | |
257 | + if (spStatus.Count() > 0) | |
258 | + { | |
259 | + return true; | |
260 | + } | |
261 | + else | |
262 | + { | |
263 | + return false; | |
264 | + } | |
265 | + } | |
266 | + catch (Exception ex) | |
267 | + { | |
268 | + return false; | |
269 | + } | |
270 | + } | |
271 | + } | |
272 | + | |
273 | + public class LicenseTypeModel | |
274 | + { | |
275 | + public int Id { get; set; } | |
276 | + public string Title { get; set; } | |
277 | + public bool IsActive { get; set; } | |
278 | + | |
279 | + public static List<LicenseTypeModel> GetLicenseTypes(AIADatabaseV5Entities dbContext) | |
280 | + { | |
281 | + List<LicenseTypeModel> LicenseTypeList = new List<LicenseTypeModel>(); | |
282 | + LicenseTypeModel LicenseTypeModelObj = new LicenseTypeModel(); | |
283 | + try | |
284 | + { | |
285 | + var result = dbContext.usp_GetLicenseTypes().ToList(); | |
286 | + if (result.Count > 0) | |
287 | + { | |
288 | + foreach (var item in result) | |
289 | + { | |
290 | + LicenseTypeModelObj = new LicenseTypeModel(); | |
291 | + LicenseTypeModelObj.Id = item.Id; | |
292 | + LicenseTypeModelObj.Title = item.Title; | |
293 | + LicenseTypeModelObj.IsActive = item.IsActive; | |
294 | + LicenseTypeList.Add(LicenseTypeModelObj); | |
295 | + } | |
296 | + } | |
297 | + } | |
298 | + catch (Exception ex) { } | |
299 | + return LicenseTypeList; | |
300 | + } | |
301 | + | |
302 | + } | |
303 | + | |
304 | +} | |
0 | 305 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SharedModel.cs
... | ... | @@ -7,6 +7,10 @@ namespace AIAHTML5.ADMIN.API.Models |
7 | 7 | { |
8 | 8 | public class AccountTypeModel |
9 | 9 | { |
10 | + public int Id { get; set; } | |
11 | + public string Title { get; set; } | |
12 | + public bool isActive { get; set; } | |
13 | + | |
10 | 14 | public static List<AccountType> GetAccountTypeList(AIADatabaseV5Entities dbContext, int Id) |
11 | 15 | { |
12 | 16 | var accountTypeEntity = dbContext.usp_GetAccountTypeList(Id).ToList(); |
... | ... | @@ -14,5 +18,27 @@ namespace AIAHTML5.ADMIN.API.Models |
14 | 18 | //AccountTypelist.Insert(0, new AccountType { Id = 0, Title = "All" }); |
15 | 19 | return AccountTypelist; |
16 | 20 | } |
21 | + | |
22 | + public static List<AccountTypeModel> GetAccountTypes(AIADatabaseV5Entities dbContext) | |
23 | + { | |
24 | + List<AccountTypeModel> AccountTypeList = new List<AccountTypeModel>(); | |
25 | + AccountTypeModel AccountTypeModelObj = new AccountTypeModel(); | |
26 | + try | |
27 | + { | |
28 | + var result = dbContext.EC_GetAccountTypeList().ToList(); | |
29 | + if (result.Count > 0) | |
30 | + { | |
31 | + foreach (var item in result) | |
32 | + { | |
33 | + AccountTypeModelObj = new AccountTypeModel(); | |
34 | + AccountTypeModelObj.Id = item.Id; | |
35 | + AccountTypeModelObj.Title = item.Title; | |
36 | + AccountTypeList.Add(AccountTypeModelObj); | |
37 | + } | |
38 | + } | |
39 | + } | |
40 | + catch (Exception ex) { } | |
41 | + return AccountTypeList; | |
42 | + } | |
17 | 43 | } |
18 | 44 | } |
19 | 45 | \ No newline at end of file | ... | ... |