public IViewComponentResult Invoke()
        {
            //var companyId = CurrentUser.companyId;
            var companyId = 1;

            return(View(employeeDetailService.getEmployeeDetail(companyId)));
        }
예제 #2
0
        public HttpResponseMessage Get(int Id)
        {
            EmployeeDetailDTO selectedTitle = service.getEmployeeDetail(Id);

            if (selectedTitle == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, Id + sysLanguage.CompanyTitlesControllerStrings.id_title));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, selectedTitle));
        }
예제 #3
0
        public IActionResult EditEmployee(int id)
        {
            int companyId = (int)CurrentUser.CompanyID;

            ViewBag.AccessType         = new SelectList(accessTypeService.getAll(), "Id", "AccessTypeName");
            ViewBag.BankAccountType    = new SelectList(bankAccountTypeService.getAll(), "Id", "BankAccountTypeName");
            ViewBag.BloodGroup         = new SelectList(bloodGroupService.getAll(), "Id", "BloodKind");
            ViewBag.City               = new SelectList(cityService.getAll(), "Id", "Name");
            ViewBag.ContractType       = new SelectList(contractType.getAll(), "Id", "ContractName");
            ViewBag.Country            = new SelectList(countryService.getAll(), "Id", "CountryName");
            ViewBag.Disability         = new SelectList(disabilitySituationService.getAll(), "Id", "DisabilityName");
            ViewBag.EducationLevel     = new SelectList(educationLevelService.getAll(), "Id", "EducationLevelName");
            ViewBag.EducationStatus    = new SelectList(educationStatusService.getAll(), "Id", "StatusName");
            ViewBag.EmploymentType     = new SelectList(employmentTypeService.getAll(), "Id", "EmploymentTypeName");
            ViewBag.Gender             = new SelectList(genderService.getAll(), "Id", "GenderName");
            ViewBag.MaritalStatus      = new SelectList(maritalStatusService.getAll(), "Id", "StatusName");
            ViewBag.Companies          = new SelectList(companyService.getAll(companyId), "Id", "CompanyName");
            ViewBag.CompanyBranchs     = new SelectList(companyBranchService.getSelectByCompanyId(companyId), "Id", "BranchName");
            ViewBag.CompanyDepartments = new SelectList(companyDepartmentService.getSelectByCompanyId(companyId), "Id", "Name");

            EmployeeModel model = new EmployeeModel();

            //TODO:employeePosition düzelt
            model.Employee = service.getEmployee(id);
            if (model.Employee.EmployeePositions.Count != 0)
            {
                model.Employee.EmployeePositions[0].Position = positionService.getPositions(id);
            }
            //model.Employee.EmployeePositions = positionService.getEmployeePosition(id);
            var empDetail    = employeeDetailService.getEmployeeDetail(id);
            var empOtherInfo = employeeOtherInfoService.getEmployeeOtherInfo(id);

            if (empDetail == null)
            {
                model.EmployeeDetail = new EmployeeDetailDTO();
            }
            else
            {
                model.EmployeeDetail = empDetail;
            }
            if (empOtherInfo == null)
            {
                model.EmployeeOtherInfo = new EmployeeOtherInfoDTO();
            }
            else
            {
                model.EmployeeOtherInfo = empOtherInfo;
            }
            //kullanıcının detayı ve update işlemi

            return(View(model));
        }