//[Authorize(Roles = "Employee")]
        public ActionResult BasicDetails(DateTime?DOB, bool status = false)
        {
            string        UserId      = User.Identity.GetUserId();
            UserViewModel userdetails = generic.GetUserDetail(User.Identity.GetUserId());

            ViewData["UserProfile"] = userdetails;
            ViewBag.Result          = "Failed";
            if (status == true)
            {
                ViewBag.Result = "Succeeded";
            }
            ViewData["Reporting"]   = ems.GetSubscriberWiseEmployeeList(userdetails.SubscriberId).Where(r => r.UserId == UserId).FirstOrDefault();
            ViewData["CompanyLogo"] = cms.GetCompanyLogo(userdetails.SubscriberId).FirstOrDefault();
            var plandetail = admin.GetUserplanDetails(userdetails.SubscriberId).Where(c => c.AddOnId == 3).FirstOrDefault();

            ViewData["plandetail"] = plandetail;
            var empdetails = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault();

            ViewData["EmpDetails"] = empdetails;
            if (empdetails != null)
            {
                PopulateMaritalStatus(empdetails.MaritalStatus);
                PopulateGenderStatus(empdetails.Gender);
                PopulateNationality(empdetails.Nationality);
                if (empdetails.DOB != null)
                {
                    ViewBag.dob = empdetails.DOB.Value.ToString("dd-MM-yyyy");
                }
                //PopulateEmployementStatus(empdetails.Status);
                //PopulateGrade(empdetails.GradeId);
                //if (empdetails.DOB != null)
                //{
                //    ViewBag.dob = empdetails.DOB.Value.ToString("dd-MM-yyyy");
                //}
                //if (empdetails.DateofJoining != null)
                //{
                //    ViewBag.doj = empdetails.DateofJoining.Value.ToString("dd-MM-yyyy");
                //}
                //if (empdetails.DateofConfirmation != null)
                //{
                //    ViewBag.doc = empdetails.DateofConfirmation.Value.ToString("dd-MM-yyyy");
                //}
            }
            else
            {
                PopulateMaritalStatus();
                PopulateGenderStatus();
                PopulateNationality();
                ViewBag.dob = DOB.Value.ToString("dd-MM-yyyy");
                PopulateEmployementStatus();
                //PopulateGrade();
            }
            ///Achal Jha For Payroll Date : 17-05-2017 Reason : For PAyroll

            return(View(empdetails));
        }
        private void PopulateEmployee(string SubscriberId, object selectedValue = null)
        {
            EMSManager emsMgr = new EMSManager();
            var        query  = emsMgr.GetSubscriberWiseEmployeeList(SubscriberId).Where(e => e.DepartmentId != "ADI").ToList();

            ViewBag.Name = new SelectList(query, "UserId", "Name", selectedValue);
        }
Beispiel #3
0
        private void PopulateEmployee(string SubscriberId, object selectedValue = null)
        {
            EMSManager emsMgr    = new EMSManager();
            var        TrainerId = emsMgr.GetSubscriberWiseEmployeeList(SubscriberId).Where(e => e.DepartmentId == "ADI" || e.DepartmentId == "FAC" || e.DepartmentId == "VFA").ToList();

            ViewBag.TrainerId = new SelectList(TrainerId, "UserId", "Name", selectedValue);
        }
Beispiel #4
0
        public ActionResult Record(string AtendenceDate, DateTime?AttendenceDate, string Id, bool Status = false)
        {
            ViewBag.Status = Status;

            string        UserId      = User.Identity.GetUserId();
            UserViewModel UserDetails = generic.GetUserDetail(UserId);

            ViewData["userprofile"] = UserDetails;
            ViewData["EmpDetails"]  = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault();
            ViewData["CompanyLogo"] = cms.GetCompanyLogo(UserDetails.SubscriberId).FirstOrDefault();
            //var plandetail = admin.GetUserplanDetails(UserDetails.SubscriberId).Where(c => c.AddOnId == 3).FirstOrDefault();
            //ViewData["plandetail"] = plandetail;
            PopulateAttedanceSessions();
            if (!String.IsNullOrEmpty(AtendenceDate))
            {
                AttendenceDate = DateTime.ParseExact(AtendenceDate, "dd-MM-yyyy", CultureInfo.InvariantCulture);
                var attendance = db.CandidateAttendance.Where(a => a.AttendenceDate == AttendenceDate && a.TrainingId == Id).ToList();
                ViewData["attendancerecord"] = attendance;
                ViewBag.date = AtendenceDate;
            }
            var trainingDetail = db.TrainingSchedule.Find(Id);

            ViewBag.BatchId = trainingDetail.BatchId;
            var date = db.CourseBatch.Find(trainingDetail.BatchId);

            ViewBag.StartDate  = date.FromDate;
            ViewBag.Enddate    = date.ToDate;
            ViewBag.TrainingId = Id;
            //ViewData["CourseBatch"] = db.CourseBatch.Find(trainingDetail.BatchId);

            ViewData["TrainerDetail"] = ems.GetSubscriberWiseEmployeeList(UserDetails.SubscriberId).Where(e => e.UserId == trainingDetail.TrainerId).FirstOrDefault();
            var candidate = student.GetSubscriberWiseCandidateList(UserDetails.SubscriberId, trainingDetail.BatchId).OrderBy(c => c.Name).ToList();

            ViewBag.CandidateCount = candidate.Count;
            ViewData["Candidate"]  = candidate;

            return(View());
        }