Beispiel #1
0
        public ActionResult EditPersonalDetails(Int64 EmployeeNumber, GetEmployeeModel updateemployee)

        {
            EmployeeService empService = new EmployeeService();
            String          message    = empService.UpdateEmployee(updateemployee);

            return(RedirectToAction("GetAllEmployees", new { message }));
        }
Beispiel #2
0
        public async void InitializeAsync()
        {
            using (StartOperation())
            {
                Clients = await GetClientsOperation.ExecuteAsync();

                var user = SecurityManager.GetCurrentUser();
                _currentEmployee = await GetEmployeeOperation.ExecuteAsync(user.Id);
            }
        }
Beispiel #3
0
        public async void InitializeAsync()
        {
            using (StartOperation())
            {
                Clients = await GetClientsOperation.ExecuteAsync();

                _currentEmployee = await GetEmployeeOpertion.ExecuteAsync(SecurityManager.GetCurrentUser().Id);

                OrderedBooks = new ObservableCollection <SaveOrderedBookModel>();
            }
        }
Beispiel #4
0
        public async Task <CustomResponse> Get(Guid id)
        {
            EmployeeDto employee = await _unitOfWork.EmployeeRepository.FindAsync(id);

            if (employee == null)
            {
                return(_responsMessages.EmployeeNotFound);
            }

            GetEmployeeModel model = _mapper.Map <GetEmployeeModel>(employee);

            return(new OkResponse(model));
        }
Beispiel #5
0
 public String  UpdateEmployeeDetail(GetEmployeeModel Updateemployee)
 {
     try
     {
         string query = string.Empty;
         using (IDbConnection connection = OpenConnection())
         {
             var param = new DynamicParameters();
             if (Updateemployee != null)
             {
                 query = StoredProcedure.UpdateEmployee;
             }
             connection.Execute(query, Updateemployee, commandType: CommandType.StoredProcedure);
             return("Personal Details of 'Employee Number:" + Updateemployee.EmployeeNumber + "'" + " have been Updated");
         }
     }
     catch (Exception ex)
     {
         return("Error Occured");
     }
 }
        public ActionResult GetEmployee(int TrainingID)
        {
            DSRCManagementSystemEntities1 db = new DSRCManagementSystemEntities1();

            GetEmployeeModel obj = new GetEmployeeModel();

            bool IsTimeLimit = db.TrainingNominations.Where(o => o.TrainingId == TrainingID).Select(o => o.CompletionFlag).Any(o => o == true);

            if (IsTimeLimit)
            {
                obj.AttendeesResult = (from p in db.Trainings.Where(x => x.TrainingId == TrainingID)
                                       join t in db.TrainingNominations on p.TrainingId equals t.TrainingId
                                       join u in db.Users on t.UserId equals u.UserID
                                       join d in db.Departments on u.DepartmentId equals d.DepartmentId
                                       where t.UserId == u.UserID && t.NominationFlag == true && t.IsActive == true //&& t.Score > 0
                                       select new DSRCManagementSystem.Models.GetEmployeesModel
                {
                    EmployeeId = t.EmpId,
                    EmployeeName = t.EmpName,
                    Department = d.DepartmentName,
                    score = t.Score,
                    //status = p.StatusId,
                    status = 0,
                    FeedbackStatus = "-"
                }).ToList();

                obj.NonAttendeesResult = (from p in db.Trainings.Where(x => x.TrainingId == TrainingID)
                                          join t in db.TrainingNominations on p.TrainingId equals t.TrainingId
                                          join u in db.Users on t.UserId equals u.UserID
                                          join d in db.Departments on u.DepartmentId equals d.DepartmentId
                                          where t.Score > 0
                                          //join f in db.TrainingFeedBackCalcs on p.TrainingId equals f.TrainingId
                                          //where f.UserId == u.UserID
                                          select new DSRCManagementSystem.Models.GetEmployeesModel
                {
                    EmployeeId = t.EmpId,
                    EmployeeName = t.EmpName,
                    Department = d.DepartmentName,
                    score = 0,
                    status = 0,
                    FeedbackStatus = "-"
                }).ToList();
            }
            else
            {
                obj.AttendeesResult = (from p in db.Trainings.Where(x => x.TrainingId == TrainingID)
                                       join t in db.TrainingNominations on p.TrainingId equals t.TrainingId
                                       join u in db.Users on t.UserId equals u.UserID
                                       join d in db.Departments on u.DepartmentId equals d.DepartmentId
                                       join f in db.TrainingFeedBackCalcs on p.TrainingId equals f.TrainingId
                                       where f.UserId == u.UserID && t.NominationFlag == true && t.IsActive == true && t.Score > 0
                                       // join v in db.TrainingFeedBackCalcs on u.UserID equals v.UserId
                                       select new DSRCManagementSystem.Models.GetEmployeesModel
                {
                    EmployeeId = t.EmpId,
                    EmployeeName = t.EmpName,
                    Department = d.DepartmentName,
                    score = t.Score,
                    status = p.StatusId,

                    FeedbackStatus = f.Flag == true ? "Submitted" : "Pending"
                }).ToList();



                obj.NonAttendeesResult = (from p in db.Trainings.Where(x => x.TrainingId == TrainingID)
                                          join t in db.TrainingNominations on p.TrainingId equals t.TrainingId
                                          join u in db.Users on t.UserId equals u.UserID
                                          join d in db.Departments on u.DepartmentId equals d.DepartmentId
                                          where t.Score <= 0 && t.NominationFlag == true && t.IsActive == true
                                          //join f in db.TrainingFeedBackCalcs on p.TrainingId equals f.TrainingId
                                          //where f.UserId == u.UserID
                                          select new DSRCManagementSystem.Models.GetEmployeesModel
                {
                    EmployeeId = t.EmpId,
                    EmployeeName = t.EmpName,
                    Department = d.DepartmentName,
                    score = 0,
                    status = 0,
                    FeedbackStatus = "-"
                }).ToList();
            }

            return(View(obj));
        }
Beispiel #7
0
        public String UpdateEmployee(GetEmployeeModel Updateemployee)
        {
            String msg = repository.UpdateEmployeeDetail(Updateemployee);

            return(msg);
        }