//[Authorize(Roles = "Employee")] public ActionResult IdentificationDetails(string IdNumber, string IssuingDate, string ValidTill, short IdentificationTypeId = 0, string IdentityType = "0") { string UserId = User.Identity.GetUserId(); if (IdentificationTypeId == 0) { IdentificationTypeId = Convert.ToInt16(IdentityType); } //var issuingDate = Convert.ToDateTime(IssuingDate); //var validTill = Convert.ToDateTime(ValidTill); DateTime?issuingDate = null; if (!String.IsNullOrEmpty(IssuingDate)) { issuingDate = DateTime.ParseExact(IssuingDate, "dd-MM-yyyy", CultureInfo.InvariantCulture); } DateTime?validTill = null; if (!String.IsNullOrEmpty(ValidTill)) { validTill = DateTime.ParseExact(ValidTill, "dd-MM-yyyy", CultureInfo.InvariantCulture); } bool result = ems.AddEmployeeIdentificationDetails(UserId, IdentificationTypeId, IdNumber, issuingDate, validTill); return(RedirectToAction("IdentificationDetails", "Employee", new { area = "EMS", status = result })); }