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 | 133 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); |
134 | 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 | 144 | if (dc.ColumnName == "ModifierId") |
140 | 145 | { |
... | ... | @@ -143,8 +148,13 @@ namespace AIAHTML5.API.Models |
143 | 148 | } |
144 | 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 | 159 | if (dc.ColumnName == "UserTypeId") |
150 | 160 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); |
... | ... | @@ -185,7 +195,7 @@ namespace AIAHTML5.API.Models |
185 | 195 | if (objUser.LicenseSubscriptions != null) |
186 | 196 | { |
187 | 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 | 200 | ArrayList allModulesList = objModel.GetUserModules(); |
191 | 201 | ArrayList licensedModulesList = objModel.GetModuleStatusByLicenseId(licenseId); |
... | ... | @@ -376,7 +386,10 @@ namespace AIAHTML5.API.Models |
376 | 386 | if (dc.ColumnName == "SecurityAnswer") |
377 | 387 | objUser.SecurityAnswer = dr[dc].ToString(); |
378 | 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 | 393 | if (dc.ColumnName == "CreationDate") |
381 | 394 | objUser.CreationDate = Convert.ToDateTime(dr[dc]); |
382 | 395 | if (dc.ColumnName == "DeactivationDate") |
... | ... | @@ -390,9 +403,20 @@ namespace AIAHTML5.API.Models |
390 | 403 | objUser.DeactivationDate = date; |
391 | 404 | } |
392 | 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 | 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 | 420 | if (dc.ColumnName == "UserTypeId") |
397 | 421 | objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); |
398 | 422 | if (dc.ColumnName == "IsActive") |
... | ... | @@ -463,13 +487,23 @@ namespace AIAHTML5.API.Models |
463 | 487 | } |
464 | 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 | 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 | 508 | if (dc.ColumnName == "RenewelDate") |
475 | 509 | { |
... | ... | @@ -479,7 +513,7 @@ namespace AIAHTML5.API.Models |
479 | 513 | else |
480 | 514 | date = (DateTime)dr[dc]; |
481 | 515 | |
482 | - lsd.RenewelDate = date; | |
516 | + lsd.RenewalDate = date; | |
483 | 517 | } |
484 | 518 | if (dc.ColumnName == "PaymentMode") |
485 | 519 | lsd.PaymentMode = dr[dc].ToString(); |
... | ... | @@ -578,7 +612,6 @@ namespace AIAHTML5.API.Models |
578 | 612 | |
579 | 613 | lic.ModifiedDate = date; |
580 | 614 | } |
581 | - | |
582 | 615 | if (dc.ColumnName == "NoOfRenewals") |
583 | 616 | lic.NoOfRenewals = Convert.ToInt32(dr[dc]); |
584 | 617 | if (dc.ColumnName == "IsTermAccepted") | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... | ... | @@ -80,7 +80,7 @@ namespace AIAHTML5.API.Models |
80 | 80 | public int? SubscriptionPlanId { get; set; } |
81 | 81 | public DateTime? SubscriptionValidFrom { get; set; } |
82 | 82 | public DateTime? SubscriptionValidThrough { get; set; } |
83 | - public DateTime? RenewelDate { get; set; } | |
83 | + public DateTime? RenewalDate { get; set; } | |
84 | 84 | public string PaymentMode { get; set; } |
85 | 85 | public double TotalAmount { get; set; } |
86 | 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