Commit 86e5a95cb6e04a250374974893511bb8d9f7f426
1 parent
59ada5fc
Committed updated files
Showing
4 changed files
with
48 additions
and
15 deletions
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
@@ -133,8 +133,13 @@ namespace AIAHTML5.API.Models | @@ -133,8 +133,13 @@ namespace AIAHTML5.API.Models | ||
133 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); | 133 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); |
134 | if (dc.ColumnName == "DeactivationDate") | 134 | if (dc.ColumnName == "DeactivationDate") |
135 | { | 135 | { |
136 | - DateTime ddDate; | ||
137 | - objUser.DeactivationDate = DateTime.TryParse(dr[dc].ToString(), out ddDate) ? ddDate : (DateTime?)null; | 136 | + DateTime? date; |
137 | + if (dr[dc] == DBNull.Value) | ||
138 | + date = null; | ||
139 | + else | ||
140 | + date = (DateTime)dr[dc]; | ||
141 | + | ||
142 | + objUser.DeactivationDate = date; | ||
138 | } | 143 | } |
139 | if (dc.ColumnName == "ModifierId") | 144 | if (dc.ColumnName == "ModifierId") |
140 | { | 145 | { |
@@ -143,8 +148,13 @@ namespace AIAHTML5.API.Models | @@ -143,8 +148,13 @@ namespace AIAHTML5.API.Models | ||
143 | } | 148 | } |
144 | if (dc.ColumnName == "ModifiedDate") | 149 | if (dc.ColumnName == "ModifiedDate") |
145 | { | 150 | { |
146 | - DateTime mdDate; | ||
147 | - objUser.ModifiedDate = DateTime.TryParse(dr[dc].ToString(), out mdDate) ? mdDate : (DateTime?)null; | 151 | + DateTime? date; |
152 | + if (dr[dc] == DBNull.Value) | ||
153 | + date = null; | ||
154 | + else | ||
155 | + date = (DateTime)dr[dc]; | ||
156 | + | ||
157 | + objUser.ModifiedDate = date; | ||
148 | } | 158 | } |
149 | if (dc.ColumnName == "UserTypeId") | 159 | if (dc.ColumnName == "UserTypeId") |
150 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | 160 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); |
@@ -185,7 +195,7 @@ namespace AIAHTML5.API.Models | @@ -185,7 +195,7 @@ namespace AIAHTML5.API.Models | ||
185 | if (objUser.LicenseSubscriptions != null) | 195 | if (objUser.LicenseSubscriptions != null) |
186 | { | 196 | { |
187 | DateTime? subscriptionValidThrough = objUser.LicenseSubscriptions.SubscriptionValidThrough; | 197 | DateTime? subscriptionValidThrough = objUser.LicenseSubscriptions.SubscriptionValidThrough; |
188 | - if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date > DateTime.Now.Date) | 198 | + if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date >= DateTime.Now.Date) |
189 | { | 199 | { |
190 | ArrayList allModulesList = objModel.GetUserModules(); | 200 | ArrayList allModulesList = objModel.GetUserModules(); |
191 | ArrayList licensedModulesList = objModel.GetModuleStatusByLicenseId(licenseId); | 201 | ArrayList licensedModulesList = objModel.GetModuleStatusByLicenseId(licenseId); |
@@ -376,7 +386,10 @@ namespace AIAHTML5.API.Models | @@ -376,7 +386,10 @@ namespace AIAHTML5.API.Models | ||
376 | if (dc.ColumnName == "SecurityAnswer") | 386 | if (dc.ColumnName == "SecurityAnswer") |
377 | objUser.SecurityAnswer = dr[dc].ToString(); | 387 | objUser.SecurityAnswer = dr[dc].ToString(); |
378 | if (dc.ColumnName == "CreatorId") | 388 | if (dc.ColumnName == "CreatorId") |
379 | - objUser.CreatorId = Convert.ToInt32(dr[dc]); | 389 | + { |
390 | + int tempVal; | ||
391 | + objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | ||
392 | + } | ||
380 | if (dc.ColumnName == "CreationDate") | 393 | if (dc.ColumnName == "CreationDate") |
381 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); | 394 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); |
382 | if (dc.ColumnName == "DeactivationDate") | 395 | if (dc.ColumnName == "DeactivationDate") |
@@ -390,9 +403,20 @@ namespace AIAHTML5.API.Models | @@ -390,9 +403,20 @@ namespace AIAHTML5.API.Models | ||
390 | objUser.DeactivationDate = date; | 403 | objUser.DeactivationDate = date; |
391 | } | 404 | } |
392 | if (dc.ColumnName == "ModifierId") | 405 | if (dc.ColumnName == "ModifierId") |
393 | - objUser.ModifierId = Convert.ToInt32(dr[dc]); | 406 | + { |
407 | + int tempVal; | ||
408 | + objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | ||
409 | + } | ||
394 | if (dc.ColumnName == "ModifiedDate") | 410 | if (dc.ColumnName == "ModifiedDate") |
395 | - objUser.ModifiedDate = Convert.ToDateTime(dr[dc]); | 411 | + { |
412 | + DateTime? date; | ||
413 | + if (dr[dc] == DBNull.Value) | ||
414 | + date = null; | ||
415 | + else | ||
416 | + date = (DateTime)dr[dc]; | ||
417 | + | ||
418 | + objUser.ModifiedDate = date; | ||
419 | + } | ||
396 | if (dc.ColumnName == "UserTypeId") | 420 | if (dc.ColumnName == "UserTypeId") |
397 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | 421 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); |
398 | if (dc.ColumnName == "IsActive") | 422 | if (dc.ColumnName == "IsActive") |
@@ -463,13 +487,23 @@ namespace AIAHTML5.API.Models | @@ -463,13 +487,23 @@ namespace AIAHTML5.API.Models | ||
463 | } | 487 | } |
464 | if (dc.ColumnName == "SubscriptionValidFrom") | 488 | if (dc.ColumnName == "SubscriptionValidFrom") |
465 | { | 489 | { |
466 | - DateTime date; | ||
467 | - lsd.SubscriptionValidFrom = DateTime.TryParse(dr[dc].ToString(), out date) ? date : (DateTime?)null; | 490 | + DateTime? date; |
491 | + if (dr[dc] == DBNull.Value) | ||
492 | + date = null; | ||
493 | + else | ||
494 | + date = (DateTime)dr[dc]; | ||
495 | + | ||
496 | + lsd.SubscriptionValidFrom = date; | ||
468 | } | 497 | } |
469 | if (dc.ColumnName == "SubscriptionValidThrough") | 498 | if (dc.ColumnName == "SubscriptionValidThrough") |
470 | { | 499 | { |
471 | - DateTime date; | ||
472 | - lsd.SubscriptionValidThrough = DateTime.TryParse(dr[dc].ToString(), out date) ? date : (DateTime?)null; | 500 | + DateTime? date; |
501 | + if (dr[dc] == DBNull.Value) | ||
502 | + date = null; | ||
503 | + else | ||
504 | + date = (DateTime)dr[dc]; | ||
505 | + | ||
506 | + lsd.SubscriptionValidThrough = date; | ||
473 | } | 507 | } |
474 | if (dc.ColumnName == "RenewelDate") | 508 | if (dc.ColumnName == "RenewelDate") |
475 | { | 509 | { |
@@ -479,7 +513,7 @@ namespace AIAHTML5.API.Models | @@ -479,7 +513,7 @@ namespace AIAHTML5.API.Models | ||
479 | else | 513 | else |
480 | date = (DateTime)dr[dc]; | 514 | date = (DateTime)dr[dc]; |
481 | 515 | ||
482 | - lsd.RenewelDate = date; | 516 | + lsd.RenewalDate = date; |
483 | } | 517 | } |
484 | if (dc.ColumnName == "PaymentMode") | 518 | if (dc.ColumnName == "PaymentMode") |
485 | lsd.PaymentMode = dr[dc].ToString(); | 519 | lsd.PaymentMode = dr[dc].ToString(); |
@@ -578,7 +612,6 @@ namespace AIAHTML5.API.Models | @@ -578,7 +612,6 @@ namespace AIAHTML5.API.Models | ||
578 | 612 | ||
579 | lic.ModifiedDate = date; | 613 | lic.ModifiedDate = date; |
580 | } | 614 | } |
581 | - | ||
582 | if (dc.ColumnName == "NoOfRenewals") | 615 | if (dc.ColumnName == "NoOfRenewals") |
583 | lic.NoOfRenewals = Convert.ToInt32(dr[dc]); | 616 | lic.NoOfRenewals = Convert.ToInt32(dr[dc]); |
584 | if (dc.ColumnName == "IsTermAccepted") | 617 | if (dc.ColumnName == "IsTermAccepted") |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
@@ -80,7 +80,7 @@ namespace AIAHTML5.API.Models | @@ -80,7 +80,7 @@ namespace AIAHTML5.API.Models | ||
80 | public int? SubscriptionPlanId { get; set; } | 80 | public int? SubscriptionPlanId { get; set; } |
81 | public DateTime? SubscriptionValidFrom { get; set; } | 81 | public DateTime? SubscriptionValidFrom { get; set; } |
82 | public DateTime? SubscriptionValidThrough { get; set; } | 82 | public DateTime? SubscriptionValidThrough { get; set; } |
83 | - public DateTime? RenewelDate { get; set; } | 83 | + public DateTime? RenewalDate { get; set; } |
84 | public string PaymentMode { get; set; } | 84 | public string PaymentMode { get; set; } |
85 | public double TotalAmount { get; set; } | 85 | public double TotalAmount { get; set; } |
86 | public double AmountPaid { get; set; } | 86 | public double AmountPaid { get; set; } |
400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll
No preview for this file type
400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb
No preview for this file type