Skip to content

Commit

Permalink
Some issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Qutubhaider committed Aug 6, 2022
1 parent bbbf0cc commit 707dc3b
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 73 deletions.
22 changes: 20 additions & 2 deletions DigiteonWeb/Areas/Admin/Controllers/CareerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class CareerController : Controller
{
private readonly DatabaseContext moDatabaseContext;
private readonly IWebHostEnvironment _env;

private readonly static int miPageSize = 10;

public CareerController(DatabaseContext foDatabaseContext, IWebHostEnvironment env)
Expand Down Expand Up @@ -91,6 +92,21 @@ public IActionResult Detail(Guid? id)
return RedirectToAction("Index", "Error");
}
}


public IActionResult DeleteCareer(Guid id)
{
SqlParameter loSuccess = new SqlParameter("@inSuccess", SqlDbType.Int) { Direction = ParameterDirection.Output };
moDatabaseContext.Database.ExecuteSqlInterpolated($"EXEC deleteCareer @unCareerId={id},@inSuccess={loSuccess} OUT");
if(Convert.ToInt32(loSuccess.Value)==103)
{
TempData["ResultCode"] = CommonFunctions.ActionResponse.Delete;
TempData["Message"] = string.Format(AlertMessage.DeleteData);
return RedirectToAction("Index");
}
return RedirectToAction("Error");
}

[HttpPost]
public async Task<IActionResult> SaveCareer(Career career)
{
Expand Down Expand Up @@ -257,8 +273,10 @@ public IActionResult GetCreerApplicationListData(string applicantName, int inCar

}



public IActionResult DownloadFile(string filename)
{
return File(System.IO.File.ReadAllBytes(Path.Combine(_env.WebRootPath, "Files/Career", filename)), "application/octet-stream", filename);
}
}
}

14 changes: 14 additions & 0 deletions DigiteonWeb/Areas/Admin/Controllers/TrainingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ public IActionResult Detail(Guid id)
return View("~/Areas/Admin/Views/Training/TrainingDeatils.cshtml");
}


public IActionResult DeleteTraining(Guid id)
{
SqlParameter loSuccess = new SqlParameter("@inSuccess", SqlDbType.Int) { Direction = ParameterDirection.Output };
moDatabaseContext.Database.ExecuteSqlInterpolated($"EXEC deleteTraining @unTrainingId={id},@inSuccess={loSuccess} OUT");
if (Convert.ToInt32(loSuccess.Value) == 103)
{
TempData["ResultCode"] = CommonFunctions.ActionResponse.Delete;
TempData["Message"] = string.Format(AlertMessage.DeleteData);
return RedirectToAction("Index");
}
return RedirectToAction("Error");
}

public IActionResult EnquiryList(Guid id)
{
return View("~/Areas/Admin/Views/Training/EnquiryList.cshtml", id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
</div>
</div>
<div class="col-4" style="float:right;">
<a class="btn btn-info" style="float: right;" asp-area="Admin" asp-controller="Career" asp-action="ApplicationDetail">Add Applicant</a>
<a class="btn btn-danger" style="float: right;" asp-area="Admin" asp-controller="Career" asp-action="Index">Back</a>
@*<a class="btn btn-info" style="float: right;" asp-area="Admin" asp-controller="Career" asp-action="ApplicationDetail">Add Applicant</a>*@
</div>
</div>
<div class="row">
Expand Down
20 changes: 10 additions & 10 deletions DigiteonWeb/Areas/Admin/Views/Career/Detail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<div class="mb-3">
<label class="form-label">Job Code</label>
<input type="text" asp-for="stJobCode" class="form-control" placeholder="Job Code">
<span class="text-danger" asp-validation-for="stJobCode"></span>
@*<span class="text-danger" asp-validation-for="stJobCode"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Type</label>
<input type="text" asp-for="stJobType" class="form-control" placeholder="Job Type">
<span class="text-danger" asp-validation-for="stJobType"></span>
@* <span class="text-danger" asp-validation-for="stJobType"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Description</label>
Expand All @@ -49,22 +49,22 @@
<div class="mb-3">
<label class="form-label">Job Responsiblities</label>
<textarea asp-for="stJobResponsiblities" class="form-control" placeholder="Job Responsiblities"></textarea>
<span class="text-danger" asp-validation-for="stJobResponsiblities"></span>
@* <span class="text-danger" asp-validation-for="stJobResponsiblities"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Required Skills</label>
<textarea asp-for="stJobSkills" class="form-control" placeholder="Job Required Skills"></textarea>
<span class="text-danger" asp-validation-for="stJobSkills"></span>
@* <span class="text-danger" asp-validation-for="stJobSkills"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Offer</label>
<textarea asp-for="stOfferDescription" class="form-control" placeholder="Job Offer"></textarea>
<span class="text-danger" asp-validation-for="stOfferDescription"></span>
@* <span class="text-danger" asp-validation-for="stOfferDescription"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Advantages</label>
<textarea asp-for="stJobAdvantages" class="form-control" placeholder="Job Advantages"></textarea>
<span class="text-danger" asp-validation-for="stJobAdvantages"></span>
@*<span class="text-danger" asp-validation-for="stJobAdvantages"></span>*@
</div>
<div class="mb-3" style="display:none;">
<label class="form-label">CV</label>
Expand All @@ -74,17 +74,17 @@
<div class="mb-3">
<label class="form-label">Salary</label>
<input type="text" asp-for="stSalary" class="form-control" placeholder="Salary">
<span class="text-danger" asp-validation-for="stJobResponsiblities"></span>
@* <span class="text-danger" asp-validation-for="stJobResponsiblities"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Salary Type</label>
<input type="text" asp-for="stSalaryType" class="form-control" placeholder="Salary type">
<span class="text-danger" asp-validation-for="stSalaryType"></span>
@* <span class="text-danger" asp-validation-for="stSalaryType"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Duration</label>
<input type="text" asp-for="stJobDuration" class="form-control" placeholder="Job Duration">
<span class="text-danger" asp-validation-for="stJobDuration"></span>
@*<span class="text-danger" asp-validation-for="stJobDuration"></span>*@
</div>
<div class="mb-3">
<label class="form-label">Job Start Date</label>
Expand All @@ -96,7 +96,7 @@
<button type="submit" class="btn btn-primary waves-effect waves-light me-1">
Submit
</button>
<a class="btn btn-secondary waves-effect" asp-area="Admin" asp-controller="Department" asp-action="Index">
<a class="btn btn-secondary waves-effect" asp-area="Admin" asp-controller="Career" asp-action="Index">
Cancel
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


<td class="text-center">
<a asp-area="Admin" asp-controller="Career" asp-action="CreerApplicationList" asp-route-id="@applicant.stUnFileName" class="btn btn-outline-secondary btn-sm edit">Download CV</a>
<a asp-area="Admin" asp-controller="Career" asp-action="DownloadFile" asp-route-filename="@applicant.stUnFileName" class="btn btn-outline-secondary btn-sm edit">Download CV</a>
</td>
</tr>
}
Expand Down
9 changes: 5 additions & 4 deletions DigiteonWeb/Areas/Admin/Views/Career/_CareerList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
DateTime dtStartDate = Convert.ToDateTime(career.dtStartDate);
}
<td>@dtStartDate.ToString("dd-MMM-yyyy").ToString()</td>


<td class="text-center">
<a asp-area="Admin" asp-controller="Career" asp-action="Detail" asp-route-id="@career.unCareerId" class="btn btn-outline-secondary btn-sm edit"><i class="fas fa-pencil-alt"></i> </a>
@*<a asp-area="Admin" asp-controller="Career" asp-action="ApplyNow" asp-route-id="@career.unCareerId" class="btn btn-outline-secondary btn-sm edit">Apply</a>*@
&nbsp;
<a asp-area="Admin" asp-controller="Career" asp-action="DeleteCareer" asp-route-id="@career.unCareerId" class="btn btn-outline-secondary btn-sm edit" onclick="return confirm('Are you sure you want to delete?');"><i class="fas fa-trash"></i> </a>
&nbsp;
<a asp-area="Admin" asp-controller="Career" asp-action="CreerApplicationList" asp-route-id="@career.unCareerId" class="btn btn-outline-secondary btn-sm edit">Applicant List</a>

</td>
</tr>
}
Expand Down
3 changes: 3 additions & 0 deletions DigiteonWeb/Areas/Admin/Views/Training/EnquiryList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<h4 class="mb-sm-0">Enquiry List</h4>
</div>
</div>
<div class="col-4" style="float:right;">
<a class="btn btn-danger" style="float: right;" asp-area="Admin" asp-controller="Training" asp-action="Index">Back</a>
</div>
</div>
<div class="row">
<div class="col-12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<button type="submit" class="btn btn-primary waves-effect waves-light me-1">
Submit
</button>
<a class="btn btn-secondary waves-effect" asp-area="Admin" asp-controller="Department" asp-action="Index">
<a class="btn btn-secondary waves-effect" asp-area="Admin" asp-controller="Training" asp-action="Index">
Cancel
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions DigiteonWeb/Areas/Admin/Views/Training/_TrainingList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<a asp-area="Admin" asp-controller="Training" asp-action="Detail" asp-route-id="@loTraining.unTrainingId" class="btn btn-outline-secondary btn-sm edit"><i class="fas fa-pencil-alt"></i> </a>
&nbsp;
<a asp-area="Admin" asp-controller="Training" asp-action="EnquiryList" asp-route-id="@loTraining.unTrainingId" class="btn btn-outline-secondary btn-sm edit"><i class="fas fa-eye"></i> </a>
&nbsp;
<a asp-area="Admin" asp-controller="Training" asp-action="DeleteTraining" asp-route-id="@loTraining.unTrainingId" class="btn btn-outline-secondary btn-sm edit" onclick="return confirm('Are you sure you want to delete?');"><i class="fas fa-trash"></i> </a>
</td>
</tr>
}
Expand Down
1 change: 1 addition & 0 deletions DigiteonWeb/Common/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static class AlertMessage
#region SaveAlert

public const string SaveData = "Saved successfully.";
public const string DeleteData = "Deleted successfully.";

#endregion
#region Login
Expand Down
34 changes: 27 additions & 7 deletions DigiteonWeb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Security.Claims;
using System.Threading.Tasks;
using static DigiteonWeb.Common.CommonFunctions;
Expand Down Expand Up @@ -255,7 +257,7 @@ public IActionResult GetTraining(int? sort_column, string sort_order, int? pg, i
}

[Route("training-calendar/{cname}/{id}")]
public IActionResult Enroll(Guid id,string cname)
public IActionResult Enroll(Guid id, string cname)
{
try
{
Expand All @@ -271,7 +273,7 @@ public IActionResult Enroll(Guid id,string cname)
{
return null;
}

}

[Route("thank-you")]
Expand Down Expand Up @@ -342,13 +344,13 @@ public IActionResult GetCareerListData(string jobTitle, int? sort_column, string
}

[Route("careers/apply-now/{jname}/{id}")]
public IActionResult ApplyNow(Guid id,string jname)
public IActionResult ApplyNow(Guid id, string jname)
{
try
{
CareerApplication application = new CareerApplication();
application.unCareerId = id;
application.stJobName= jname;
application.stJobName = jname;
return View("~/Views/Home/ApplicationDetail.cshtml", application);
}
catch (Exception ex)
Expand Down Expand Up @@ -383,9 +385,27 @@ public async Task<IActionResult> SaveCareerApplication(CareerApplication applica
int fiSuccess = Convert.ToInt32(loSuccess.Value);
if (fiSuccess == 101)
{
TempData["ResultCode"] = CommonFunctions.ActionResponse.Add;
TempData["Message"] = string.Format(AlertMessage.SaveData);
return RedirectToAction("Index");
//MailAddress from = new MailAddress("[email protected]", "Info");
//MailAddress to = new MailAddress("[email protected]", "Info");
//MailMessage message = new MailMessage(from, to);
//message.Subject = "Apply Now ";
//message.Body = "<table><tr><td>Application Name : </td><td>" + application.stName + "</td></tr>" +
// "<tr><td>Email : </td><td>" + application.stEmail + "</td></tr> " +
// "<tr><td>Message : </td><td>" + application.stMessage + "</td></tr>" +
// "</table>";
//message.IsBodyHtml = true;

//System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("[email protected]", "Ranchi@12345");

//System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.zoho.com", 587);
//mailClient.EnableSsl = true;
//mailClient.UseDefaultCredentials = false;
//mailClient.Credentials = mailAuthentication;

//message.IsBodyHtml = true;
//mailClient.Send(message);

return RedirectToAction("ThankYou");
}
else if (fiSuccess == 102)
{
Expand Down
16 changes: 9 additions & 7 deletions DigiteonWeb/Models/Career.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,30 @@ public class Career
public string stJobTitle { get; set; }
[Required(ErrorMessage = "Job Category is required.")]
public string stJobCategory { get; set; }
[Required(ErrorMessage = "Job Code is required.")]
//[Required(ErrorMessage = "Job Code is required.")]
public string stJobCode { get; set; }
[Required(ErrorMessage = "Job Type is required.")]
//[Required(ErrorMessage = "Job Type is required.")]
public string stJobType { get; set; }
[Required(ErrorMessage = "Job Description is required.")]
public string stJobDescription { get; set; }
[Required(ErrorMessage = "Job Responsiblities is required.")]
//[Required(ErrorMessage = "Job Responsiblities is required.")]
public string stJobResponsiblities { get; set; }
[Required(ErrorMessage = "Job skills is required.")]
//[Required(ErrorMessage = "Job skills is required.")]
public string stJobSkills { get; set; }
[Required(ErrorMessage = "Offer Description is required.")]
//[Required(ErrorMessage = "Offer Description is required.")]
public string stOfferDescription { get; set; }
[Required(ErrorMessage = "Job Advantages is required.")]
//[Required(ErrorMessage = "Job Advantages is required.")]
public string stJobAdvantages { get; set; }
[NotMapped]
[Required(ErrorMessage = "Please upload your CV.")]
//[Required(ErrorMessage = "Please upload your CV.")]
public IFormFile CV { get; set; }
public string stUniqueFileName { get; set; }
public string stFileName { get; set; }
public string stSalary { get; set; }
public string stSalaryType { get; set; }
public string stJobDuration { get; set; }

[Required(ErrorMessage = "Please enter start date.")]
public DateTime? dtStartDate { get; set; }


Expand Down
2 changes: 1 addition & 1 deletion DigiteonWeb/Models/CareerListResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class CareerListResult
public string stJobCode { get; set; }
public string stJobType { get; set; }
public string stSalary { get; set; }
public DateTime dtStartDate { get; set; }
public DateTime? dtStartDate { get; set; }
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

0 comments on commit 707dc3b

Please sign in to comment.