Skip to content

Commit f9b51a5

Browse files
committed
huh
2 parents 52f36e5 + e8ef2b7 commit f9b51a5

File tree

8 files changed

+99
-214
lines changed

8 files changed

+99
-214
lines changed

InternshipsManagmentProject.Data/StudentInternship.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@ namespace InternshipsManagmentProject.Data
1111
{
1212
using System;
1313
using System.Collections.Generic;
14-
14+
using System.ComponentModel;
15+
1516
public partial class StudentInternship
1617
{
1718
public string StudentId { get; set; }
1819
public string InternshipId { get; set; }
1920
public string StudentUserId { get; set; }
2021
public Nullable<System.DateTime> DateCreated { get; set; }
2122
public Nullable<bool> Completed { get; set; }
23+
24+
[DisplayName("Observatii")]
2225
public string Updates { get; set; }
26+
27+
[DisplayName("CV")]
2328
public string SubmitedResume { get; set; }
2429
public Nullable<bool> StatusOfApplication { get; set; }
2530
public string StudentResumeId { get; set; }

InternshipsManagmentProject/Controllers/ManageController.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ public async Task<ActionResult> Index(ManageMessageId? message)
7575
return View(model);
7676
}
7777

78+
public async Task<ActionResult> Index2()
79+
{
80+
var userId = User.Identity.GetUserId();
81+
var model = new IndexViewModel
82+
{
83+
HasPassword = HasPassword(),
84+
PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
85+
TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
86+
Logins = await UserManager.GetLoginsAsync(userId),
87+
BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
88+
};
89+
return View(model);
90+
}
7891
//
7992
// POST: /Manage/RemoveLogin
8093
[HttpPost]

InternshipsManagmentProject/Controllers/StudentController.cs

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,35 @@ public StudentController() {
110110
[HttpGet]
111111
public ActionResult StudentProfile(string idStudent=null, int selection = 0, string imagePath = "")
112112
{
113-
string UserId = Session["UserId"].ToString();
114-
if (idStudent != null)
115-
{
116-
student = entities.Students.Find(idStudent);
117-
}
118-
if (idStudent == null)
113+
if (Session != null && Session["UserId"] != null)
119114
{
120115

121-
student = entities.Students.Where(user => user.UserId == UserId).ToList().FirstOrDefault() ;
116+
string UserId = Session["UserId"].ToString();
117+
if (idStudent != null)
118+
{
119+
student = entities.Students.Find(idStudent);
120+
}
121+
if (idStudent == null)
122+
{
123+
124+
student = entities.Students.Where(user => user.UserId == UserId).ToList().FirstOrDefault();
125+
}
126+
if (imagePath.Length > 0)
127+
{
128+
//load image pls
129+
}
130+
131+
ViewBag.Selection = selection;
132+
//if (createOrUpdateStudent.Name!=null) {
133+
// student = createOrUpdateStudent;
134+
//}
135+
return View(student);
136+
122137
}
123-
if (imagePath.Length>0) {
124-
//load image pls
138+
else
139+
{
140+
return View("~/Shared/Error.cshtml");
125141
}
126-
127-
ViewBag.Selection = selection;
128-
//if (createOrUpdateStudent.Name!=null) {
129-
// student = createOrUpdateStudent;
130-
//}
131-
return View(student);
132142
}
133143

134144
public ActionResult StudentRegister()

InternshipsManagmentProject/Views/Home/Index.cshtml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<h2>Detalii</h2>
4343

4444
<div>
45+
4546
<hr />
4647
<dl class="dl-horizontal">
4748
<dt>
@@ -100,39 +101,45 @@
100101
@{
101102
if (User.Identity.IsAuthenticated)
102103
{
103-
if (Session["Role"].ToString() == "Recruiter")
104+
if (Session != null)
104105
{
106+
if (Session["Role"] != null)
107+
{
108+
109+
if (Session["Role"].ToString() == "Recruiter")
110+
{
105111
<td>
106112
<div>@Html.ActionLink("Editeaza", "Edit", new { id = item.InternshipId }, new { @class = "btn btn-warning" })</div>
107113
</td>
108114
<td>
109115
<div>
110-
@Html.ActionLink("Gestioneaza Aplicanti", "Index", "StudentInternships", new { id = item.InternshipId}, new { @class = "btn btn-primary" })
116+
@Html.ActionLink("Gestioneaza Aplicanti", "Index", "StudentInternships", new { id = item.InternshipId }, new { @class = "btn btn-primary" })
111117
</div>
112118
</td>
113119

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

118-
}
119-
if (Session["Role"].ToString() == "Student")
120-
{
124+
}
125+
if (Session["Role"].ToString() == "Student")
126+
{
121127
@*apply to be worked on*@
122128
<td>
123129
<div>@Html.ActionLink("Aplica internship", "Create", "StudentInternships", new { internshipId = item.InternshipId }, new { @class = "btn primary" })</div>
124130
</td>
131+
}
132+
}
125133
}
126134
}
127-
128135
else
129136
{
130137
@*apply to be worked on*@
131138
<td>
132139
<div> @Html.ActionLink("Aplica internship", "Login", "Account", new { internshipId = item.InternshipId }, new { @class = "btn primary" })</div>
133140
</td>
141+
}
134142
}
135-
}
136143

137144
</tr>
138145
}

InternshipsManagmentProject/Views/Manage/Index.cshtml

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ViewBag.Title = "Manage";
44
}
55

6-
<h2>@ViewBag.Title.</h2>
6+
<h2>@ViewBag.Title</h2>
77

88
<p class="text-success">@ViewBag.StatusMessage</p>
99
<div>
@@ -23,65 +23,6 @@
2323
}
2424
]
2525
</dd>
26-
<dt>External Logins:</dt>
27-
<dd>
28-
@Model.Logins.Count [
29-
@Html.ActionLink("Manage", "ManageLogins") ]
30-
</dd>
31-
@*
32-
Phone Numbers can used as a second factor of verification in a two-factor authentication system.
33-
34-
See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
35-
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
36-
37-
Uncomment the following block after you have set up two-factor authentication
38-
*@
39-
@*
40-
<dt>Phone Number:</dt>
41-
<dd>
42-
@(Model.PhoneNumber ?? "None")
43-
@if (Model.PhoneNumber != null)
44-
{
45-
<br />
46-
<text>[&nbsp;&nbsp;@Html.ActionLink("Change", "AddPhoneNumber")&nbsp;&nbsp;]</text>
47-
using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
48-
{
49-
@Html.AntiForgeryToken()
50-
<text>[<input type="submit" value="Remove" class="btn-link" />]</text>
51-
}
52-
}
53-
else
54-
{
55-
<text>[&nbsp;&nbsp;@Html.ActionLink("Add", "AddPhoneNumber")
56-
}
57-
</dd>
58-
*@
59-
<dt>Two-Factor Authentication:</dt>
60-
<dd>
61-
<p>
62-
There are no two-factor authentication providers configured. See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
63-
for details on setting up this ASP.NET application to support two-factor authentication.
64-
</p>
65-
@*@if (Model.TwoFactor)
66-
{
67-
using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
68-
{
69-
@Html.AntiForgeryToken()
70-
<text>Enabled
71-
<input type="submit" value="Disable" class="btn btn-link" />
72-
</text>
73-
}
74-
}
75-
else
76-
{
77-
using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
78-
{
79-
@Html.AntiForgeryToken()
80-
<text>Disabled
81-
<input type="submit" value="Enable" class="btn btn-link" />
82-
</text>
83-
}
84-
}*@
85-
</dd>
26+
8627
</dl>
8728
</div>

InternshipsManagmentProject/Views/Student/StudentProfile.cshtml

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
<ul id="menu">
1919
<li class="">Aplicarile Mele</li>
20-
<li>Notificari</li>
21-
<li>Setari</li>
2220
<li>Editare Cont</li>
23-
<li>Log out</li>
2421
</ul>
2522
</div>
2623
</td>
@@ -131,49 +128,12 @@
131128
}
132129
}
133130
</div>
134-
<div>
135-
<h3>Notificari</h3>
136-
</div>
137-
<div>
138-
<h3>Setari</h3>
139-
140-
@Html.ActionLink("Manage", "Index","Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
141-
142-
@*<form action="/Student/StudentProfile" method="get" class="form_student">
143-
<input type="hidden" name="selection" value="2" />
144-
<input type="hidden" name="createOrUpdateStudent" value=@Model />
145-
<table id="form_table">
146-
<tr>
147-
<td>Email:</td>
148-
<td><input type="text" id="input_email" name="Email" value=""></td>
149-
</tr>
150-
<tr>
151-
<td>New Password:</td>
152-
<td><input type="text" id="input_password" name="Password"></td>
153-
</tr>
154-
<tr>
155-
<td>New Password Confirm:</td>
156-
<td><input type="text" id="input_password_confirm" name="Password_Confirm"></td>
157-
</tr>
158-
<tr>
159-
<td>Old Password:</td>
160-
<td><input type="text" id="input_password_old" name="Password_Old"></td>
161-
</tr>
162-
</table>
163-
<input id="settings_submit" type="submit" value="Save Changes">
164-
</form>*@
165-
166-
</div>
167131
<div>
168132
<h3>Editare Cont</h3>
169133
<div id="partialTest">
170-
@Html.Partial("StudentRegister", Model);
134+
@Html.Partial("StudentRegister", Model)
171135
</div>
172136
</div>
173-
<div>
174-
<h3>Log out</h3>
175-
</div>
176-
177137
</div>
178138
</td>
179139
</tr>
@@ -193,8 +153,8 @@
193153
}
194154
$(()=> {
195155
RefreshMenu();
196-
$("#form_button").val("Save Changes");
197-
$("#form_submit").val("Save Changes");
156+
$("#form_button").val("Salveaza modificarile");
157+
$("#form_submit").val("Salveaza modificarile");
198158
$(".internship>div").slideUp(0);
199159
$("#menu>li").click(function () {
200160
$("#menu>li:nth-child(" + (sel + 1) + ")").attr("class", "menu_grayed");

0 commit comments

Comments
 (0)