Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,038 changes: 1,038 additions & 0 deletions TestAPP/.vs/TestAPP/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added TestAPP/.vs/TestAPP/v16/.suo
Binary file not shown.
Binary file modified TestAPP/TestAPP/App_Data/aspnet-TestAPP-20181007080429.mdf
Binary file not shown.
Binary file modified TestAPP/TestAPP/App_Data/aspnet-TestAPP-20181007080429_log.ldf
Binary file not shown.
39 changes: 26 additions & 13 deletions TestAPP/TestAPP/Controllers/PeopleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,39 @@ public class PeopleController : Controller
[Authorize]
public ActionResult Index()
{
//To get person's added by relevent user
//get user id
string user = User.Identity.GetUserId();
ViewBag.FirstName = user;
var people = db.People.Where(t => t.AddedBy == user).ToList();
//var people = db.People.ToList();
return View(people);
try
{
//To get person's added by relevent user
//get user id
string user = User.Identity.GetUserId();
ViewBag.FirstName = user;
var people = db.People.Where(t => t.AddedBy == user).ToList();
//var people = db.People.ToList();
return View(people);
} catch {
return View();
}
}
// For Dsahboard
[Authorize]
public ActionResult Dashboard()
{
List<Person> list = new List<Person>();
string user = User.Identity.GetUserId();
var persons = db.People.Where(p => p.AddedBy == user).ToList();
foreach (var per in persons)
try
{
List<Person> list = new List<Person>();
string user = User.Identity.GetUserId();
var persons = db.People.Where(p => p.AddedBy == user).ToList();
foreach (var per in persons)
{
list.Add(per);
}
ViewBag.message = "yes";
return View(list);
} catch
{
list.Add(per);
ViewBag.message = "No list Found";
return View();
}
return View(list);
}
// GET: People/Details/5
public ActionResult Details(int? id)
Expand Down
1 change: 1 addition & 0 deletions TestAPP/TestAPP/TestAPP.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<WebStackScaffolding_IsViewGenerationSelected>True</WebStackScaffolding_IsViewGenerationSelected>
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
Expand Down
220 changes: 113 additions & 107 deletions TestAPP/TestAPP/Views/People/Dashboard.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,131 +3,137 @@
@{
ViewBag.Title = "Dashboard";
}
@{
<h2>Dashboard</h2>
<div class="row"></div>
<h4>Number of Added Persons: @Model.Count()</h4>
<div class="row"></div>
}

@{
List<Person> list1 = new List<Person>();
List<Person> list2 = new List<Person>();
var date = DateTime.Now.Date;
var day = 0;
var month = 0;
foreach (var person in Model)
{
string dob = person.DateOfBirth.Value.ToShortDateString();
if (dob.Length == 9)
@if (ViewBag.message == "yes")
{

<h2>Dashboard</h2>
<div class="row"></div>
<h4>Number of Added Persons: @Model.Count()</h4>
<div class="row"></div>



List<Person> list1 = new List<Person>();
List<Person> list2 = new List<Person>();
var date = DateTime.Now.Date;
var day = 0;
var month = 0;
foreach (var person in Model)
{
if (dob.Substring(1, 1) == "/")
string dob = person.DateOfBirth.Value.ToShortDateString();
if (dob.Length == 9)
{
day = Convert.ToInt32(dob.Substring(2, 2));
if (dob.Substring(1, 1) == "/")
{
day = Convert.ToInt32(dob.Substring(2, 2));
month = Convert.ToInt32(dob.Substring(0, 1));
}
else
{
day = Convert.ToInt32(dob.Substring(3, 1));
month = Convert.ToInt32(dob.Substring(0, 2));
}
}
else if (dob.Length == 8)
{
day = Convert.ToInt32(dob.Substring(2, 1));
month = Convert.ToInt32(dob.Substring(0, 1));
}
else
else if (dob.Length == 10)
{
day = Convert.ToInt32(dob.Substring(3, 1));
day = Convert.ToInt32(dob.Substring(3, 2));
month = Convert.ToInt32(dob.Substring(0, 2));
}
}
else if (dob.Length == 8)
{
day = Convert.ToInt32(dob.Substring(2, 1));
month = Convert.ToInt32(dob.Substring(0, 1));
}
else if (dob.Length == 10)
{
day = Convert.ToInt32(dob.Substring(3, 2));
month = Convert.ToInt32(dob.Substring(0, 2));
}
for (int i = 1; i <= 10; i++)
{
if (date.AddDays(i).Day == day && date.AddDays(i).Month == month)
for (int i = 1; i <= 10; i++)
{
list1.Add(person);
if (date.AddDays(i).Day == day && date.AddDays(i).Month == month)
{
list1.Add(person);
}
}
}
for (int i = 1; i < 8; i++)
{
if (date.AddDays(-i).Date == person.UpdateOn)
for (int i = 1; i < 8; i++)
{
list2.Add(person);
if (date.AddDays(-i).Date == person.UpdateOn)
{
list2.Add(person);
}
}
}
}
}

@{
<h4>Persons Who have Birthday in Next 10 Days:</h4>
<div class="row"></div>
int counter = 1;
foreach (var item in list1)
{
<div>
<h5>Person @counter</h5>

<h4>Persons Who have Birthday in Next 10 Days:</h4>
<div class="row"></div>
int counter = 1;
foreach (var item in list1)
{
<div>
<h5>Person @counter</h5>

<div class="row">
<div class="col-sm-6">
<table class="table table-responsive">
<tr>
<td>@Html.DisplayNameFor(model => model.FirstName)</td>
<td>@Html.DisplayFor(model => item.FirstName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.MiddleName)</td>
<td>@Html.DisplayFor(model => item.MiddleName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.LastName)</td>
<td>@Html.DisplayFor(model => item.LastName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.DateOfBirth)</td>
<td>@Html.DisplayFor(model => item.DateOfBirth)</td>
</tr>
</table>
<div class="row">
<div class="col-sm-6">
<table class="table table-responsive">
<tr>
<td>@Html.DisplayNameFor(model => model.FirstName)</td>
<td>@Html.DisplayFor(model => item.FirstName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.MiddleName)</td>
<td>@Html.DisplayFor(model => item.MiddleName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.LastName)</td>
<td>@Html.DisplayFor(model => item.LastName)</td>
</tr>
<tr>
<td>@Html.DisplayNameFor(model => model.DateOfBirth)</td>
<td>@Html.DisplayFor(model => item.DateOfBirth)</td>
</tr>
</table>
</div>
</div>
</div>
</div>
counter++;
}
}
counter++;
}


@{
<div class="row"></div>
<h4>Person's Who's data has been updated in las 7 Day's</h4>
<div class="row"></div>

<div class="container">
<div class="col-md-4">
<table class="table table-condensed table-bordered table-hover small">
<thead>
<tbody>
@if (!list2.Any())
{
<tr>
No Person in the List
</tr>
<td>
Updated in last 7 days
</td>
}
@foreach (var person in list2)
{
<tr>
<td>
@(person.FirstName + " " + person.MiddleName + " " + person.LastName)
</td>
<td>
@person.UpdateOn.Value.ToShortDateString()
</td>
</tr>
<div class="row"></div>
<h4>Person's Who's data has been updated in las 7 Day's</h4>
<div class="row"></div>

<div class="container">
<div class="col-md-4">
<table class="table table-condensed table-bordered table-hover small">
<thead>
<tbody>
@if (!list2.Any())
{
<tr>
No Person in the List
</tr>
<td>
Updated in last 7 days
</td>
}
</tbody>
</thead>
</table>
@foreach (var person in list2)
{
<tr>
<td>
@(person.FirstName + " " + person.MiddleName + " " + person.LastName)
</td>
<td>
@person.UpdateOn.Value.ToShortDateString()
</td>
</tr>
}
</tbody>
</thead>
</table>
</div>
</div>
</div>

} else {
<h2>
@ViewBag.message
</h2>
}
Binary file modified TestAPP/TestAPP/bin/TestAPP.dll
Binary file not shown.
Binary file modified TestAPP/TestAPP/bin/TestAPP.pdb
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
acab1ca4df88a389dc849ded7371a07523d32c36
84 changes: 84 additions & 0 deletions TestAPP/TestAPP/obj/Debug/TestAPP.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,87 @@ C:\Users\adeel\OneDrive\Desktop\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Micr
C:\Users\adeel\OneDrive\Desktop\TestAPP\TestAPP\obj\Debug\TestAPP.dll
C:\Users\adeel\OneDrive\Desktop\TestAPP\TestAPP\obj\Debug\TestAPP.pdb
C:\Users\adeel\OneDrive\Desktop\TestAPP\TestAPP\obj\Debug\TestAPP.csprojResolveAssemblyReference.cache
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\ApplicationInsights.config
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\csc.exe
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.CodeAnalysis.CSharp.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.CodeAnalysis.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.CodeAnalysis.VisualBasic.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.CSharp.Core.targets
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\Microsoft.VisualBasic.Core.targets
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\System.Collections.Immutable.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\System.Reflection.Metadata.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\vbc.exe
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\VBCSCompiler.exe
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\roslyn\VBCSCompiler.exe.config
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\TestAPP.dll.config
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\TestAPP.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\TestAPP.pdb
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Antlr3.Runtime.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\EntityFramework.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\EntityFramework.SqlServer.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.Agent.Intercept.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.DependencyCollector.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.PerfCounterCollector.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.ServerTelemetryChannel.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.Web.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.WindowsServer.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.ApplicationInsights.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.Core.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.EntityFramework.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.Owin.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Host.SystemWeb.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Cookies.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Facebook.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Google.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.MicrosoftAccount.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.OAuth.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Twitter.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Web.Infrastructure.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Newtonsoft.Json.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Owin.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Helpers.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Mvc.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Optimization.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Razor.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.Deployment.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.Razor.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\WebGrease.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.DependencyCollector.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.ServerTelemetryChannel.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.Web.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AI.WindowsServer.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.ApplicationInsights.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Helpers.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Mvc.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Optimization.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.Razor.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.Deployment.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\System.Web.WebPages.Razor.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Antlr3.Runtime.pdb
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Newtonsoft.Json.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\EntityFramework.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\EntityFramework.SqlServer.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.Core.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.Owin.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.AspNet.Identity.EntityFramework.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Host.SystemWeb.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Facebook.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Cookies.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.OAuth.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Google.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.Twitter.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\bin\Microsoft.Owin.Security.MicrosoftAccount.xml
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\obj\Debug\TestAPP.csprojAssemblyReference.cache
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\obj\Debug\TestAPP.csproj.CoreCompileInputs.cache
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\obj\Debug\TestAPP.csproj.CopyComplete
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\obj\Debug\TestAPP.dll
C:\Users\Usman\Desktop\MiniPhoneBook\TestAPP\TestAPP\obj\Debug\TestAPP.pdb
Binary file not shown.
Binary file modified TestAPP/TestAPP/obj/Debug/TestAPP.dll
Binary file not shown.
Binary file modified TestAPP/TestAPP/obj/Debug/TestAPP.pdb
Binary file not shown.
Binary file added TestAPP/packages/bootstrap.3.4.1/.signature.p7s
Binary file not shown.
Loading