コード例 #1
0
        //[Authorize(Roles = "Employee")]
        public ActionResult ExperienceDetails(string ProfileName, string result, string useraction = "Add", bool status = false, long ProfileId = 0, Int64 ExperienceId = 0)
        {
            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";
            }
            if (ProfileId == 0 && !string.IsNullOrEmpty(ProfileName))
            {
                ProfileId = (from p in udb.UserProfileTypeDetails.Where(p => p.UserId == UserId && p.ProfileName == ProfileName) select p).FirstOrDefault().ProfileId;
            }

            ViewBag.ProfileId = ProfileId;
            PopulateProfileType(UserId, ProfileId);
            ViewData["Profile"] = ems.GetProfileTypeDetails(UserId);
            var Empexperiencedetails = ems.GetEmployeeExperienceDetails(UserId);

            ViewData["Empexperiencedetails"] = Empexperiencedetails;
            var Experience = Empexperiencedetails.Where(i => i.ExperienceId == ExperienceId).FirstOrDefault();

            if (Experience != null)
            {
                if (Experience.JoiningDate != null)
                {
                    ViewBag.JoiningDate = Experience.JoiningDate.ToString("dd-MM-yyyy");
                }
                if (Experience.LeavingDate != null)
                {
                    ViewBag.LeavingDate = Experience.LeavingDate.Value.ToString("dd-MM-yyyy");
                }
            }
            return(View(Experience));
        }