diff --git a/DigiteonWeb/Areas/Admin/Controllers/CareerController.cs b/DigiteonWeb/Areas/Admin/Controllers/CareerController.cs index 70946f4..955c192 100644 --- a/DigiteonWeb/Areas/Admin/Controllers/CareerController.cs +++ b/DigiteonWeb/Areas/Admin/Controllers/CareerController.cs @@ -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) @@ -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 SaveCareer(Career career) { @@ -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); + } } } diff --git a/DigiteonWeb/Areas/Admin/Controllers/TrainingController.cs b/DigiteonWeb/Areas/Admin/Controllers/TrainingController.cs index 7041974..223b794 100644 --- a/DigiteonWeb/Areas/Admin/Controllers/TrainingController.cs +++ b/DigiteonWeb/Areas/Admin/Controllers/TrainingController.cs @@ -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); diff --git a/DigiteonWeb/Areas/Admin/Views/Career/CareerApplicationList.cshtml b/DigiteonWeb/Areas/Admin/Views/Career/CareerApplicationList.cshtml index befc08b..9ebc57d 100644 --- a/DigiteonWeb/Areas/Admin/Views/Career/CareerApplicationList.cshtml +++ b/DigiteonWeb/Areas/Admin/Views/Career/CareerApplicationList.cshtml @@ -24,7 +24,8 @@
- Add Applicant + Back + @*Add Applicant*@
diff --git a/DigiteonWeb/Areas/Admin/Views/Career/Detail.cshtml b/DigiteonWeb/Areas/Admin/Views/Career/Detail.cshtml index 5bd0ec6..2577b85 100644 --- a/DigiteonWeb/Areas/Admin/Views/Career/Detail.cshtml +++ b/DigiteonWeb/Areas/Admin/Views/Career/Detail.cshtml @@ -34,12 +34,12 @@
- + @**@
- + @* *@
@@ -49,22 +49,22 @@
- + @* *@
- + @* *@
- + @* *@
- + @**@
+
+ Back +
diff --git a/DigiteonWeb/Areas/Admin/Views/Training/TrainingDeatils.cshtml b/DigiteonWeb/Areas/Admin/Views/Training/TrainingDeatils.cshtml index 8b5dd80..48b4495 100644 --- a/DigiteonWeb/Areas/Admin/Views/Training/TrainingDeatils.cshtml +++ b/DigiteonWeb/Areas/Admin/Views/Training/TrainingDeatils.cshtml @@ -60,7 +60,7 @@ - + Cancel
diff --git a/DigiteonWeb/Areas/Admin/Views/Training/_TrainingList.cshtml b/DigiteonWeb/Areas/Admin/Views/Training/_TrainingList.cshtml index 64ddefb..1563ee0 100644 --- a/DigiteonWeb/Areas/Admin/Views/Training/_TrainingList.cshtml +++ b/DigiteonWeb/Areas/Admin/Views/Training/_TrainingList.cshtml @@ -21,6 +21,8 @@   +   + } diff --git a/DigiteonWeb/Common/CommonFunctions.cs b/DigiteonWeb/Common/CommonFunctions.cs index b534f59..03cfc0f 100644 --- a/DigiteonWeb/Common/CommonFunctions.cs +++ b/DigiteonWeb/Common/CommonFunctions.cs @@ -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 diff --git a/DigiteonWeb/Controllers/HomeController.cs b/DigiteonWeb/Controllers/HomeController.cs index 110f34f..6e7e043 100644 --- a/DigiteonWeb/Controllers/HomeController.cs +++ b/DigiteonWeb/Controllers/HomeController.cs @@ -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; @@ -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 { @@ -271,7 +273,7 @@ public IActionResult Enroll(Guid id,string cname) { return null; } - + } [Route("thank-you")] @@ -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) @@ -383,9 +385,27 @@ public async Task 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("info@digiteon.se", "Info"); + //MailAddress to = new MailAddress("info@digiteon.se", "Info"); + //MailMessage message = new MailMessage(from, to); + //message.Subject = "Apply Now "; + //message.Body = "" + + // " " + + // "" + + // "
Application Name : " + application.stName + "
Email : " + application.stEmail + "
Message : " + application.stMessage + "
"; + //message.IsBodyHtml = true; + + //System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("info@digiteon.se", "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) { diff --git a/DigiteonWeb/Models/Career.cs b/DigiteonWeb/Models/Career.cs index 55f717e..2aee467 100644 --- a/DigiteonWeb/Models/Career.cs +++ b/DigiteonWeb/Models/Career.cs @@ -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; } diff --git a/DigiteonWeb/Models/CareerListResult.cs b/DigiteonWeb/Models/CareerListResult.cs index 8734e9d..ed84d1c 100644 --- a/DigiteonWeb/Models/CareerListResult.cs +++ b/DigiteonWeb/Models/CareerListResult.cs @@ -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; } } } diff --git a/DigiteonWeb/wwwroot/Files/Career/218c2d7f-a2b5-4eb8-938c-b46663cbb03d.jpg b/DigiteonWeb/wwwroot/Files/Career/218c2d7f-a2b5-4eb8-938c-b46663cbb03d.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/218c2d7f-a2b5-4eb8-938c-b46663cbb03d.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/3bb67bc4-cd70-4ca4-b0b9-a24cf34e9c00.jpg b/DigiteonWeb/wwwroot/Files/Career/3bb67bc4-cd70-4ca4-b0b9-a24cf34e9c00.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/3bb67bc4-cd70-4ca4-b0b9-a24cf34e9c00.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/69d4335e-2b7b-456d-9fba-fd03ef9c4170.jpg b/DigiteonWeb/wwwroot/Files/Career/69d4335e-2b7b-456d-9fba-fd03ef9c4170.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/69d4335e-2b7b-456d-9fba-fd03ef9c4170.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/706c6345-13d2-4af3-8a7b-8b0106cc0e20.jpg b/DigiteonWeb/wwwroot/Files/Career/706c6345-13d2-4af3-8a7b-8b0106cc0e20.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/706c6345-13d2-4af3-8a7b-8b0106cc0e20.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/70782c82-33cf-4469-93af-d27b8a2304eb.jpg b/DigiteonWeb/wwwroot/Files/Career/70782c82-33cf-4469-93af-d27b8a2304eb.jpg deleted file mode 100644 index 69aee36..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/70782c82-33cf-4469-93af-d27b8a2304eb.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/77c11868-4bc7-4b3d-bf35-edd4b865f397.jpg b/DigiteonWeb/wwwroot/Files/Career/77c11868-4bc7-4b3d-bf35-edd4b865f397.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/77c11868-4bc7-4b3d-bf35-edd4b865f397.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/a674f8f5-7093-442e-bb91-b43bb9aae59d.json b/DigiteonWeb/wwwroot/Files/Career/a674f8f5-7093-442e-bb91-b43bb9aae59d.json deleted file mode 100644 index 83a98cb..0000000 --- a/DigiteonWeb/wwwroot/Files/Career/a674f8f5-7093-442e-bb91-b43bb9aae59d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "DBConnection": "Server=N1NWPLSK12SQL-v03.shr.prod.ams1.secureserver.net; Database=DigiteonDB; User Id=DigiteonUser; Password=Gl!9ae95" - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/DigiteonWeb/wwwroot/Files/Career/d0a44c12-c386-4f2b-b937-76e39616b9ae.jpg b/DigiteonWeb/wwwroot/Files/Career/d0a44c12-c386-4f2b-b937-76e39616b9ae.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/d0a44c12-c386-4f2b-b937-76e39616b9ae.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/e253c5d6-7349-4ad2-8aa3-dc4473924279.jpg b/DigiteonWeb/wwwroot/Files/Career/e253c5d6-7349-4ad2-8aa3-dc4473924279.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/e253c5d6-7349-4ad2-8aa3-dc4473924279.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/e785f839-191c-4243-8184-ad33f92cb720.json b/DigiteonWeb/wwwroot/Files/Career/e785f839-191c-4243-8184-ad33f92cb720.json deleted file mode 100644 index 83a98cb..0000000 --- a/DigiteonWeb/wwwroot/Files/Career/e785f839-191c-4243-8184-ad33f92cb720.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "DBConnection": "Server=N1NWPLSK12SQL-v03.shr.prod.ams1.secureserver.net; Database=DigiteonDB; User Id=DigiteonUser; Password=Gl!9ae95" - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/DigiteonWeb/wwwroot/Files/Career/edf2f075-e33e-4750-aea1-ac833444d579.jpg b/DigiteonWeb/wwwroot/Files/Career/edf2f075-e33e-4750-aea1-ac833444d579.jpg deleted file mode 100644 index d639f0d..0000000 Binary files a/DigiteonWeb/wwwroot/Files/Career/edf2f075-e33e-4750-aea1-ac833444d579.jpg and /dev/null differ diff --git a/DigiteonWeb/wwwroot/Files/Career/f2774caf-79c1-4889-a8ce-cd61ceaddf34.json b/DigiteonWeb/wwwroot/Files/Career/f2774caf-79c1-4889-a8ce-cd61ceaddf34.json deleted file mode 100644 index 83a98cb..0000000 --- a/DigiteonWeb/wwwroot/Files/Career/f2774caf-79c1-4889-a8ce-cd61ceaddf34.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "DBConnection": "Server=N1NWPLSK12SQL-v03.shr.prod.ams1.secureserver.net; Database=DigiteonDB; User Id=DigiteonUser; Password=Gl!9ae95" - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -}