Skip to content

Commit

Permalink
huh
Browse files Browse the repository at this point in the history
  • Loading branch information
mkterhov committed Jan 18, 2019
2 parents 52f36e5 + e8ef2b7 commit f9b51a5
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 214 deletions.
7 changes: 6 additions & 1 deletion InternshipsManagmentProject.Data/StudentInternship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ namespace InternshipsManagmentProject.Data
{
using System;
using System.Collections.Generic;

using System.ComponentModel;

public partial class StudentInternship
{
public string StudentId { get; set; }
public string InternshipId { get; set; }
public string StudentUserId { get; set; }
public Nullable<System.DateTime> DateCreated { get; set; }
public Nullable<bool> Completed { get; set; }

[DisplayName("Observatii")]
public string Updates { get; set; }

[DisplayName("CV")]
public string SubmitedResume { get; set; }
public Nullable<bool> StatusOfApplication { get; set; }
public string StudentResumeId { get; set; }
Expand Down
13 changes: 13 additions & 0 deletions InternshipsManagmentProject/Controllers/ManageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ public async Task<ActionResult> Index(ManageMessageId? message)
return View(model);
}

public async Task<ActionResult> Index2()
{
var userId = User.Identity.GetUserId();
var model = new IndexViewModel
{
HasPassword = HasPassword(),
PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
Logins = await UserManager.GetLoginsAsync(userId),
BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
};
return View(model);
}
//
// POST: /Manage/RemoveLogin
[HttpPost]
Expand Down
40 changes: 25 additions & 15 deletions InternshipsManagmentProject/Controllers/StudentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,35 @@ public StudentController() {
[HttpGet]
public ActionResult StudentProfile(string idStudent=null, int selection = 0, string imagePath = "")
{
string UserId = Session["UserId"].ToString();
if (idStudent != null)
{
student = entities.Students.Find(idStudent);
}
if (idStudent == null)
if (Session != null && Session["UserId"] != null)
{

student = entities.Students.Where(user => user.UserId == UserId).ToList().FirstOrDefault() ;
string UserId = Session["UserId"].ToString();
if (idStudent != null)
{
student = entities.Students.Find(idStudent);
}
if (idStudent == null)
{

student = entities.Students.Where(user => user.UserId == UserId).ToList().FirstOrDefault();
}
if (imagePath.Length > 0)
{
//load image pls
}

ViewBag.Selection = selection;
//if (createOrUpdateStudent.Name!=null) {
// student = createOrUpdateStudent;
//}
return View(student);

}
if (imagePath.Length>0) {
//load image pls
else
{
return View("~/Shared/Error.cshtml");
}

ViewBag.Selection = selection;
//if (createOrUpdateStudent.Name!=null) {
// student = createOrUpdateStudent;
//}
return View(student);
}

public ActionResult StudentRegister()
Expand Down
21 changes: 14 additions & 7 deletions InternshipsManagmentProject/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<h2>Detalii</h2>

<div>

<hr />
<dl class="dl-horizontal">
<dt>
Expand Down Expand Up @@ -100,39 +101,45 @@
@{
if (User.Identity.IsAuthenticated)
{
if (Session["Role"].ToString() == "Recruiter")
if (Session != null)
{
if (Session["Role"] != null)
{

if (Session["Role"].ToString() == "Recruiter")
{
<td>
<div>@Html.ActionLink("Editeaza", "Edit", new { id = item.InternshipId }, new { @class = "btn btn-warning" })</div>
</td>
<td>
<div>
@Html.ActionLink("Gestioneaza Aplicanti", "Index", "StudentInternships", new { id = item.InternshipId}, new { @class = "btn btn-primary" })
@Html.ActionLink("Gestioneaza Aplicanti", "Index", "StudentInternships", new { id = item.InternshipId }, new { @class = "btn btn-primary" })
</div>
</td>

<td>
<div>@Html.ActionLink("Sterge", "Delete", new { id = item.InternshipId }, new { @class = "btn btn-danger" })</div>
</td>

}
if (Session["Role"].ToString() == "Student")
{
}
if (Session["Role"].ToString() == "Student")
{
@*apply to be worked on*@
<td>
<div>@Html.ActionLink("Aplica internship", "Create", "StudentInternships", new { internshipId = item.InternshipId }, new { @class = "btn primary" })</div>
</td>
}
}
}
}

else
{
@*apply to be worked on*@
<td>
<div> @Html.ActionLink("Aplica internship", "Login", "Account", new { internshipId = item.InternshipId }, new { @class = "btn primary" })</div>
</td>
}
}
}

</tr>
}
Expand Down
63 changes: 2 additions & 61 deletions InternshipsManagmentProject/Views/Manage/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ViewBag.Title = "Manage";
}

<h2>@ViewBag.Title.</h2>
<h2>@ViewBag.Title</h2>

<p class="text-success">@ViewBag.StatusMessage</p>
<div>
Expand All @@ -23,65 +23,6 @@
}
]
</dd>
<dt>External Logins:</dt>
<dd>
@Model.Logins.Count [
@Html.ActionLink("Manage", "ManageLogins") ]
</dd>
@*
Phone Numbers can used as a second factor of verification in a two-factor authentication system.
See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
Uncomment the following block after you have set up two-factor authentication
*@
@*
<dt>Phone Number:</dt>
<dd>
@(Model.PhoneNumber ?? "None")
@if (Model.PhoneNumber != null)
{
<br />
<text>[&nbsp;&nbsp;@Html.ActionLink("Change", "AddPhoneNumber")&nbsp;&nbsp;]</text>
using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<text>[<input type="submit" value="Remove" class="btn-link" />]</text>
}
}
else
{
<text>[&nbsp;&nbsp;@Html.ActionLink("Add", "AddPhoneNumber")
}
</dd>
*@
<dt>Two-Factor Authentication:</dt>
<dd>
<p>
There are no two-factor authentication providers configured. See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
for details on setting up this ASP.NET application to support two-factor authentication.
</p>
@*@if (Model.TwoFactor)
{
using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<text>Enabled
<input type="submit" value="Disable" class="btn btn-link" />
</text>
}
}
else
{
using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<text>Disabled
<input type="submit" value="Enable" class="btn btn-link" />
</text>
}
}*@
</dd>

</dl>
</div>
46 changes: 3 additions & 43 deletions InternshipsManagmentProject/Views/Student/StudentProfile.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

<ul id="menu">
<li class="">Aplicarile Mele</li>
<li>Notificari</li>
<li>Setari</li>
<li>Editare Cont</li>
<li>Log out</li>
</ul>
</div>
</td>
Expand Down Expand Up @@ -131,49 +128,12 @@
}
}
</div>
<div>
<h3>Notificari</h3>
</div>
<div>
<h3>Setari</h3>

@Html.ActionLink("Manage", "Index","Manage", routeValues: null, htmlAttributes: new { title = "Manage" })

@*<form action="/Student/StudentProfile" method="get" class="form_student">
<input type="hidden" name="selection" value="2" />
<input type="hidden" name="createOrUpdateStudent" value=@Model />
<table id="form_table">
<tr>
<td>Email:</td>
<td><input type="text" id="input_email" name="Email" value=""></td>
</tr>
<tr>
<td>New Password:</td>
<td><input type="text" id="input_password" name="Password"></td>
</tr>
<tr>
<td>New Password Confirm:</td>
<td><input type="text" id="input_password_confirm" name="Password_Confirm"></td>
</tr>
<tr>
<td>Old Password:</td>
<td><input type="text" id="input_password_old" name="Password_Old"></td>
</tr>
</table>
<input id="settings_submit" type="submit" value="Save Changes">
</form>*@

</div>
<div>
<h3>Editare Cont</h3>
<div id="partialTest">
@Html.Partial("StudentRegister", Model);
@Html.Partial("StudentRegister", Model)
</div>
</div>
<div>
<h3>Log out</h3>
</div>

</div>
</td>
</tr>
Expand All @@ -193,8 +153,8 @@
}
$(()=> {
RefreshMenu();
$("#form_button").val("Save Changes");
$("#form_submit").val("Save Changes");
$("#form_button").val("Salveaza modificarile");
$("#form_submit").val("Salveaza modificarile");
$(".internship>div").slideUp(0);
$("#menu>li").click(function () {
$("#menu>li:nth-child(" + (sel + 1) + ")").attr("class", "menu_grayed");
Expand Down
Loading

0 comments on commit f9b51a5

Please sign in to comment.