From 86e5a95cb6e04a250374974893511bb8d9f7f426 Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Thu, 20 Jul 2017 19:42:36 +0530 Subject: [PATCH] Committed updated files --- 400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs | 61 +++++++++++++++++++++++++++++++++++++++++++++++-------------- 400-SOURCECODE/AIAHTML5.API/Models/User.cs | 2 +- 400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll | Bin 51200 -> 0 bytes 400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb | Bin 60928 -> 0 bytes 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 98c5a92..a663e70 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -133,8 +133,13 @@ namespace AIAHTML5.API.Models objUser.CreationDate = Convert.ToDateTime(dr[dc]); if (dc.ColumnName == "DeactivationDate") { - DateTime ddDate; - objUser.DeactivationDate = DateTime.TryParse(dr[dc].ToString(), out ddDate) ? ddDate : (DateTime?)null; + DateTime? date; + if (dr[dc] == DBNull.Value) + date = null; + else + date = (DateTime)dr[dc]; + + objUser.DeactivationDate = date; } if (dc.ColumnName == "ModifierId") { @@ -143,8 +148,13 @@ namespace AIAHTML5.API.Models } if (dc.ColumnName == "ModifiedDate") { - DateTime mdDate; - objUser.ModifiedDate = DateTime.TryParse(dr[dc].ToString(), out mdDate) ? mdDate : (DateTime?)null; + DateTime? date; + if (dr[dc] == DBNull.Value) + date = null; + else + date = (DateTime)dr[dc]; + + objUser.ModifiedDate = date; } if (dc.ColumnName == "UserTypeId") objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); @@ -185,7 +195,7 @@ namespace AIAHTML5.API.Models if (objUser.LicenseSubscriptions != null) { DateTime? subscriptionValidThrough = objUser.LicenseSubscriptions.SubscriptionValidThrough; - if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date > DateTime.Now.Date) + if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date >= DateTime.Now.Date) { ArrayList allModulesList = objModel.GetUserModules(); ArrayList licensedModulesList = objModel.GetModuleStatusByLicenseId(licenseId); @@ -376,7 +386,10 @@ namespace AIAHTML5.API.Models if (dc.ColumnName == "SecurityAnswer") objUser.SecurityAnswer = dr[dc].ToString(); if (dc.ColumnName == "CreatorId") - objUser.CreatorId = Convert.ToInt32(dr[dc]); + { + int tempVal; + objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; + } if (dc.ColumnName == "CreationDate") objUser.CreationDate = Convert.ToDateTime(dr[dc]); if (dc.ColumnName == "DeactivationDate") @@ -390,9 +403,20 @@ namespace AIAHTML5.API.Models objUser.DeactivationDate = date; } if (dc.ColumnName == "ModifierId") - objUser.ModifierId = Convert.ToInt32(dr[dc]); + { + int tempVal; + objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; + } if (dc.ColumnName == "ModifiedDate") - objUser.ModifiedDate = Convert.ToDateTime(dr[dc]); + { + DateTime? date; + if (dr[dc] == DBNull.Value) + date = null; + else + date = (DateTime)dr[dc]; + + objUser.ModifiedDate = date; + } if (dc.ColumnName == "UserTypeId") objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); if (dc.ColumnName == "IsActive") @@ -463,13 +487,23 @@ namespace AIAHTML5.API.Models } if (dc.ColumnName == "SubscriptionValidFrom") { - DateTime date; - lsd.SubscriptionValidFrom = DateTime.TryParse(dr[dc].ToString(), out date) ? date : (DateTime?)null; + DateTime? date; + if (dr[dc] == DBNull.Value) + date = null; + else + date = (DateTime)dr[dc]; + + lsd.SubscriptionValidFrom = date; } if (dc.ColumnName == "SubscriptionValidThrough") { - DateTime date; - lsd.SubscriptionValidThrough = DateTime.TryParse(dr[dc].ToString(), out date) ? date : (DateTime?)null; + DateTime? date; + if (dr[dc] == DBNull.Value) + date = null; + else + date = (DateTime)dr[dc]; + + lsd.SubscriptionValidThrough = date; } if (dc.ColumnName == "RenewelDate") { @@ -479,7 +513,7 @@ namespace AIAHTML5.API.Models else date = (DateTime)dr[dc]; - lsd.RenewelDate = date; + lsd.RenewalDate = date; } if (dc.ColumnName == "PaymentMode") lsd.PaymentMode = dr[dc].ToString(); @@ -578,7 +612,6 @@ namespace AIAHTML5.API.Models lic.ModifiedDate = date; } - if (dc.ColumnName == "NoOfRenewals") lic.NoOfRenewals = Convert.ToInt32(dr[dc]); if (dc.ColumnName == "IsTermAccepted") diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index 657fdbf..b67ae98 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -80,7 +80,7 @@ namespace AIAHTML5.API.Models public int? SubscriptionPlanId { get; set; } public DateTime? SubscriptionValidFrom { get; set; } public DateTime? SubscriptionValidThrough { get; set; } - public DateTime? RenewelDate { get; set; } + public DateTime? RenewalDate { get; set; } public string PaymentMode { get; set; } public double TotalAmount { get; set; } public double AmountPaid { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll index 43c7c9b..e5bae69 100644 Binary files a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll and b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll differ diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb index 196688b..e462f03 100644 Binary files a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb and b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb differ -- libgit2 0.21.4