コード例 #1
0
        //[Authorize(Roles = "Employee")]
        public ActionResult IdentificationDetails(string result, DateTime?IssuingDate, DateTime?ValidTill, bool status = false, short IdentificationTypeId = 0, string UserAction = "Add")
        {
            string UserId      = User.Identity.GetUserId();
            var    userdetails = generic.GetUserDetail(UserId);

            ViewData["UserProfile"] = userdetails;
            ViewData["EmpDetails"]  = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault();
            ViewData["CompanyLogo"] = cms.GetCompanyLogo(userdetails.SubscriberId).FirstOrDefault();

            ViewBag.Result = "Failed";
            if (status == true)
            {
                ViewBag.Result = "Succeeded";
            }
            if (result == "Deleted")
            {
                ViewBag.data = "Deleted";
            }
            ViewBag.IdentityType = IdentificationTypeId;
            ViewBag.Action       = UserAction;

            PopulateIdentificationType(IdentificationTypeId);
            var IdentificationList = ems.GetEmployeeIdentificationDetails(UserId);

            ViewData["IdentificationList"] = IdentificationList;
            var identifications = IdentificationList.Where(i => i.IdType == IdentificationTypeId).FirstOrDefault();

            if (identifications != null)
            {
                if (identifications.IssuingDate != null)
                {
                    IssuingDate         = identifications.IssuingDate;
                    ViewBag.issuingDate = IssuingDate.Value.ToString("dd-MM-yyyy");
                }
                if (identifications.ValidTill != null)
                {
                    ValidTill         = identifications.ValidTill;
                    ViewBag.validTill = ValidTill.Value.ToString("dd-MM-yyyy");
                }

                return(View(identifications));
            }
            return(View());
        }