예제 #1
0
        public ActionResult Create(int?candidateId)
        {
            ViewBag.CandidateId   = new SelectList(_candidateRepository.GetAll(o => o.OrderByDescending(c => c.Id), "Person").Select(c => new { c.Id, Name = c.Person.Name + "- [" + c.Code + "]" }), "Id", "Name", candidateId);
            ViewBag.DesignationId = new SelectList(_designationRepository.GetAll(), "Id", "Title");

            return(View());
        }
예제 #2
0
        public JsonResult Index()
        {
            var apiResult = TryExecute(() =>
            {
                return(_designationRepository.GetAll().Select(d => new DesignationModel(d)).ToList());
            }, "Designations Fetched sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        public EmployeeBaseData GetEmployeeData(int?employeeId)
        {
            EmployeeBaseData baseData = new EmployeeBaseData();

            if (employeeId != null)
            {
                var empId = (int)employeeId;
                baseData.Employee      = employeeRepository.Find(empId);
                baseData.EmployeePhoto =
                    documentRepository.GetAllDocumentByRefId(empId, (int)DocumentType.EmployeePhoto).FirstOrDefault();
            }

            baseData.Designation = designationRepository.GetAll();

            baseData.Role = aspNetRoleRepository.GetAll();

            return(baseData);
        }
예제 #4
0
 /// <summary>
 /// Get Base Data
 /// </summary>
 /// <returns></returns>
 public EmployeeBaseResponse GetBaseData()
 {
     return(new EmployeeBaseResponse
     {
         EmpStatuses = empStatusRepository.GetAll(),
         Companies = companyRepository.GetAll(),
         JobTypes = jobTypeRepository.GetAll(),
         Departments = departmentRepository.GetAll(),
         DesigGrades = desigGradeRepository.GetAll(),
         WorkPlaces = workplaceRepository.GetAll(),
         Regions = regionRepository.GetAll(),
         Countries = countryRepository.GetAll(),
         SubRegions = subRegionRepository.GetAll(),
         Cities = cityRepository.GetAll(),
         Areas = areaRepository.GetAll(),
         PhoneTypes = phoneTypeRepository.GetAll(),
         LicenseTypes = licenseTypeRepository.GetAll(),
         Operations = operationRepository.GetAll(),
         OperationsWorkPlaces = operationsWorkPlaceRepository.GetAll(),
         Supervisors = employeeRepository.GetAll(),
         Designations = designationRepository.GetAll(),
         AddressTypes = addressTypeRepository.GetAll()
     });
 }
예제 #5
0
 /// <summary>
 /// Load all Designations
 /// </summary>
 public IEnumerable <Designation> LoadAll()
 {
     return(designationRepository.GetAll());
 }
예제 #6
0
 public IEnumerable <Designation> GetAllDesignations()
 {
     return(DesignationRepository.GetAll());
 }
예제 #7
0
 public ICollection <Designation> GetAll()
 {
     return(_designationRepository.GetAll());
 }
예제 #8
0
        public IEnumerable <Designation> GetAll()
        {
            var entities = repository.GetAll();

            return(entities);
        }
예제 #9
0
 public IActionResult Create()
 {
     ViewBag.DepartmentId  = new SelectList(_departmentManager.GetAll(), "DepartmentId", "DepartmentName");
     ViewBag.DesignationId = new SelectList(_designationRepository.GetAll(), "DesignationId", "DesignationName");
     return(View());
 }
예제 #10
0
 public IEnumerable <Designation> GetDesignations()
 {
     return(Designation_repo.GetAll().OrderByDescending(a => a.DesignationId));
 }
예제 #11
0
        public IActionResult Search()
        {
            var designation = _designationRepository.GetAll();

            return(View(designation));
        }
예제 #12
0
 public IEnumerable <Master_Designation> GetAll(Master_Designation obj, string[] param, string spName)
 {
     return(_designationRepository.GetAll(null, null, ""));
 }
예제 #13
0
        public ActionResult Create(NewUserViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var newUser = new User
                {
                    EmployeeCode        = vm.EmployeeCode,
                    Username            = vm.Username,
                    Password            = HashHelper.Hash(vm.Password),
                    AccessRule          = AccessRule.CreateNewUserAccessRule(true),
                    Person              = vm.Person,
                    DepartmentId        = vm.DepartmentId,
                    LocationId          = vm.LocationId,
                    DesignationId       = vm.DesignationId,
                    ShiftId             = vm.ShiftId,
                    ReportingPersonId   = vm.ReportingPersonId,
                    ManagerId           = vm.ManagerId,
                    Experience          = vm.Experience,
                    DateOfJoin          = vm.DateOfJoin,
                    ConfirmationDate    = vm.ConfirmationDate,
                    DateOfResignation   = vm.DateOfResignation,
                    LastDate            = vm.LastDate,
                    OfficialEmail       = vm.OfficialEmail,
                    OfficialPhone       = vm.OfficialPhone,
                    OfficialMessengerId = vm.OfficialMessengerId,
                    EmployeeStatus      = vm.EmployeeStatus,
                    RequiresTimeSheet   = vm.RequiresTimeSheet,
                    Salary              = vm.Salary,
                    Bank = vm.Bank,
                    BankAccountNumber = vm.BankAccountNumber,
                    PANCard           = vm.PANCard,
                    PaymentMode       = vm.PaymentMode
                };

                _userRepository.Create(newUser);
                _unitOfWork.Commit();

                // Map the Technologies
                if (vm.TechnologyIds != null)
                {
                    foreach (var technologyId in vm.TechnologyIds)
                    {
                        var newMap = new UserTechnologyMap
                        {
                            UserId       = newUser.Id,
                            TechnologyId = technologyId
                        };
                        _userTechnologyMapRepository.Create(newMap);
                    }

                    _unitOfWork.Commit();
                }

                return(RedirectToAction("Index"));
            }

            ViewBag.Roles             = new MultiSelectList(_roleRepository.GetAll(), "Id", "Name", vm.RoleIds);
            ViewBag.Technologies      = new MultiSelectList(_technologyRepository.GetAll(), "Id", "Title", vm.TechnologyIds);
            ViewBag.DepartmentId      = new SelectList(_departmentRepository.GetAll(), "Id", "Title", vm.DepartmentId);
            ViewBag.DesignationId     = new SelectList(_designationRepository.GetAll(), "Id", "Title", vm.DesignationId);
            ViewBag.LocationId        = new SelectList(_locationRepository.GetAll(), "Id", "Title", vm.LocationId);
            ViewBag.ReportingPersonId = new SelectList(_userRepository.GetAll("Person"), "Id", "Person.Name", vm.ReportingPersonId);
            ViewBag.ManagerId         = new SelectList(_userRepository.GetAll("Person"), "Id", "Person.Name", vm.ManagerId);
            ViewBag.ShiftId           = new SelectList(_shiftRepository.GetAll(), "Id", "Title", vm.ShiftId);

            return(View(vm));
        }