Beispiel #1
0
        private ApplicationActionResult GetData()
        {
            _employeeID = GetIdFromUrl();

            CheckPermissions();

            _listSalaryDeductionsDto = PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(
                WebAPIVariables.salaryDeductions, "?SalaryDeductionsType=" + (int)SalaryDeductionsType.CompanyCar);

            Session[SessionVariables.gvDeductionsElements] = _listSalaryDeductionsDto;

            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = _employeeID
            };

            _employeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(
                WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();
            _directSupervisorDto   = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.employee, "?id=" + _employeeDto.DirectSupervisorID).FirstOrDefault();
            _employeeMembershipDto = PageMethodsHelper.InvokeWebAPI <EmployeeMembershipDto>(WebAPIVariables.employeeMembership, "?id=" + _employeeID).FirstOrDefault();

            if (_employeeDto == null || _employeeMembershipDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.ApplicationsHRMyPortalGetData, SessionUser.Id);
            }

            var cph = (ContentPlaceHolder)Master.Master.FindControl("MainContent");

            ((Image)cph.FindControl("btn_Image")).ImageUrl = @"~\Content\ThumbnailEmployee\" + _employeeID + ".png";

            return(new ApplicationActionResult()
            {
                Success = true
            });
        }
Beispiel #2
0
        private void CommandDelete(GridViewCommandEventArgs e)
        {
            _rowIndex = int.Parse(e.CommandArgument.ToString());
            _gridView.SelectedIndex = _rowIndex;
            _id = (Label)_gridView.Rows[_rowIndex].FindControl("IdLabel");

            if (!(string.IsNullOrEmpty(_id.Text) || _id.Text.Equals("0")))
            {
                var esc = new SalaryDeductionsDto()
                {
                    Id     = Convert.ToInt32(_id.Text),
                    UserId = SessionUser.Id
                };

                PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(
                    WebAPIVariables.deleteSalaryDeductions, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();
            }

            _listSalaryDeductionsDto = PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(
                WebAPIVariables.salaryDeductions, "?SalaryDeductionsType=" + (int)SalaryDeductionsType.CompanyCar);
            Session[SessionVariables.gvDeductionsElements] = _listSalaryDeductionsDto;

            foreach (var item in _listSalaryDeductionsDto)
            {
                item.SetFromDateST();
                item.SetToDateST();
            }

            this.gv_Deductions.DataSource = _listSalaryDeductionsDto;
            this.gv_Deductions.DataBind();
        }
Beispiel #3
0
        protected void AddRow_Click(object sender, EventArgs e)
        {
            string id = (string)Session[SessionVariables.hf_EmployeeID];

            Session[SessionVariables.hf_EmployeeID] = null;
            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = Convert.ToInt32(id)
            };

            _directSupervisorDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(
                WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();

            if (_directSupervisorDto != null)
            {
                lbl_DirectSupervisor.Text   = _directSupervisorDto.FirstName + " " + _directSupervisorDto.LastName;
                hf_DirectSupervisorId.Value = _directSupervisorDto.Id.ToString();
            }
            else
            {
                lbl_DirectSupervisor.Text = Translate("Common", "Lack");
            }

            up_SearchForss.Update();
        }
Beispiel #4
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            var editDataPortalResultDto = new EditDataPortalResultDto()
            {
                EmployeeId        = GetIdFromUrl(),
                PhoneNumber       = tb_PhoneNumber.Text,
                MobilePhoneNumber = tb_MobileNumber.Text,
                Email             = tb_Email.Text,
                Pesel             = tb_Pesel.Text,
                Education         = tb_Education.Text,
                City         = tb_Spot.Text,
                PostOffice   = tb_Community.Text,
                PostalCode   = tb_PostalCode.Text,
                Street       = tb_Street.Text,
                BuildingNo   = tb_StreetNo.Text,
                LocalNo      = tb_Premises.Text,
                CityCo       = tb_SpotCo.Text,
                PostOfficeCo = tb_CommunityCo.Text,
                PostalCodeCo = tb_PostalCodeCo.Text,
                StreetCo     = tb_StreetCo.Text,
                BuildingNoCo = tb_StreetNoCo.Text,
                LocalNoCo    = tb_PremisesCo.Text
            };

            var result = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(
                WebAPIVariables.editDataPortal, PageMethodsHelper.ObjectToUrlParam(editDataPortalResultDto)).FirstOrDefault();

            if (result.Success)
            {
                pnl_SuccessMessage.Visible = true;
                pnl_SuccessMessage.Style.Clear();
                pnl_SuccessMessage.Style.Add("display", "inline");
            }
        }
Beispiel #5
0
        private ApplicationActionResult GetData()
        {
            _employeeID = GetIdFromUrl();

            CheckPermissions();

            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = _employeeID
            };

            _employeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(
                WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();
            _directSupervisorDto   = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.employee, "?id=" + _employeeDto.DirectSupervisorID).FirstOrDefault();
            _employeeMembershipDto = PageMethodsHelper.InvokeWebAPI <EmployeeMembershipDto>(WebAPIVariables.employeeMembership, "?id=" + _employeeID).FirstOrDefault();

            if (_employeeDto == null || _employeeMembershipDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.ApplicationsHRStructureAndLocationGetData, SessionUser.Id);
            }

            _listSectionDto            = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.sections);
            _listOrganizationalUnitDto = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.organizationalUnits);
            _listOrganizationalCellDto = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.organizationalCells);
            _listWorksDto                = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.works);
            _listProductSectionDto       = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.productSection);
            _listPlaceWhereCostsAriseDto = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.placeWhereCostsArise);
            _listSzpartaDto              = PageMethodsHelper.InvokeWebAPI <DictionaryDto>(WebAPIVariables.szparta);
            _listStructureAndLocationDto = PageMethodsHelper.InvokeWebAPI <StructureAndLocationDto>(
                WebAPIVariables.structureAndLocation, "?employeeId=" + _employeeID);

            if (_listSectionDto == null || _listOrganizationalUnitDto == null || _listOrganizationalCellDto == null ||
                _listWorksDto == null || _listProductSectionDto == null || _listPlaceWhereCostsAriseDto == null || _listSzpartaDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.ApplicationsHRStructureAndLocationGetData, SessionUser.Id);
            }

            var cph = (ContentPlaceHolder)Master.Master.FindControl("MainContent");

            var basic         = @"~\Content\ThumbnailEmployee\";
            var employeeImage = _employeeID + ".png";
            var emptyImage    = "empty.png";

            var dataFile = Server.MapPath(basic) + employeeImage;

            if (File.Exists(dataFile))
            {
                ((Image)cph.FindControl("btn_Image")).ImageUrl = basic + employeeImage;
            }
            else
            {
                ((Image)cph.FindControl("btn_Image")).ImageUrl = basic + emptyImage;
            }

            return(new ApplicationActionResult()
            {
                Success = true
            });
        }
Beispiel #6
0
        private void SaveOld()
        {
            var value = new StructureAndLocationDto()
            {
                Id                   = Convert.ToInt32(_id.Text),
                EmployeeId           = GetIdFromUrl(),
                OrganizationalUnitId = Convert.ToInt32(_ddl_OrganizationalUnit.Text),
                OrganizationalCellId = Convert.ToInt32(_ddl_OrganizationalCell.Text),
                SiloId               = Convert.ToInt32(_ddl_Silo.Text),
                Coefficient          = Convert.ToDouble(_tb_Coefficient.Text)
            };

            var v = PageMethodsHelper.InvokeWebAPI <StructureAndLocationResultDto>(
                WebAPIVariables.saveCoefficients,
                PageMethodsHelper.ObjectToUrlParam(value)
                ).FirstOrDefault();
        }
Beispiel #7
0
        private void CheckPermissions()
        {
            if (SessionUser.Id == _employeeID)
            {
                return;
            }

            var value = new AccessPolicyDto(SessionUser.Id, _employeeID);

            value = PageMethodsHelper.InvokeWebAPI <AccessPolicyDto>(
                WebAPIVariables.myPortal,
                PageMethodsHelper.ObjectToUrlParam(value)
                ).FirstOrDefault();

            if (!value.IsAccess)
            {
                Response.Redirect("~/Views/Shared/LackPermissions.aspx");
            }
        }
Beispiel #8
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            var editAllocationStructureResultDto = new EditAllocationStructureResultDto()
            {
                EmployeeMembershipId = Convert.ToInt32(hf_EmployeeMembershipId.Value),
                Position             = tb_PositionTable.Text,
                SectionId            = Convert.ToInt32(ddl_Section.SelectedValue),
                OrganizationalUnitId = Convert.ToInt32(ddl_OrganizationalUnit.SelectedValue),
                OrganizationalCellId = Convert.ToInt32(ddl_OrganizationalCell.SelectedValue),
                DirectSupervisorId   = Convert.ToInt32(hf_DirectSupervisorId.Value),
            };

            var result = PageMethodsHelper.InvokeWebAPI <EditAllocationStructureResultDto>(
                WebAPIVariables.editAllocationStructure, PageMethodsHelper.ObjectToUrlParam(editAllocationStructureResultDto)).FirstOrDefault();

            if (result.Success)
            {
                pnl_SuccessMessage.Visible = true;
                pnl_SuccessMessage.Style.Clear();
                pnl_SuccessMessage.Style.Add("display", "inline");
            }
        }
Beispiel #9
0
        protected void AddRow_Click(object sender, EventArgs e)
        {
            string id = (string)Session[SessionVariables.hf_EmployeeID];

            Session[SessionVariables.hf_EmployeeID] = null;
            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            var _listSalaryDeductionsDto = (List <SalaryDeductionsDto>)Session[SessionVariables.gvDeductionsElements];

            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = Convert.ToInt32(id)
            };

            _employeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(
                WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();

            var value = new SalaryDeductionsDto()
            {
                LastFirstName  = _employeeDto.LastName + " " + _employeeDto.FirstName,
                EmployeeNumber = _employeeDto.EmployeeNumber,
                EmployeeId     = Convert.ToInt32(id)
            };

            _listSalaryDeductionsDto.Add(value);

            foreach (var item in _listSalaryDeductionsDto)
            {
                item.SetFromDateST();
                item.SetToDateST();
            }

            this.gv_Deductions.DataSource = _listSalaryDeductionsDto;
            this.gv_Deductions.DataBind();
        }
Beispiel #10
0
        private void CommandDelete(GridViewCommandEventArgs e)
        {
            _rowIndex = int.Parse(e.CommandArgument.ToString());
            _gridView.SelectedIndex = _rowIndex;
            _id = (Label)_gridView.Rows[_rowIndex].FindControl("IdLabel");

            if (!(string.IsNullOrEmpty(_id.Text) || _id.Text.Equals("0")))
            {
                var esc = new StructureAndLocationDto()
                {
                    Id     = Convert.ToInt32(_id.Text),
                    UserId = SessionUser.Id
                };
                PageMethodsHelper.InvokeWebAPI <StructureAndLocationResultDto>(
                    WebAPIVariables.deleteCoefficients, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();
            }

            _listStructureAndLocationDto = PageMethodsHelper.InvokeWebAPI <StructureAndLocationDto>(
                WebAPIVariables.structureAndLocation, "?employeeId=" + GetIdFromUrl());

            Session[SessionVariables.listStructureAndLocationCoefficient] = _listStructureAndLocationDto;
            this.gv_Coefficients.DataSource = _listStructureAndLocationDto;
            this.gv_Coefficients.DataBind();
        }
Beispiel #11
0
        private void SaveOld()
        {
            var value = new SalaryDeductionsDto()
            {
                Id                       = Convert.ToInt32(_id.Text),
                EmployeeId               = Convert.ToInt32(_employeeIdLabel.Text),
                Amount                   = Convert.ToDouble(_amount.Text),
                FromDateST               = _fromDateST.Text,
                ToDateST                 = _toDateST.Text,
                SalaryDeductionsType     = (int)SalaryDeductionsType.ZFSS,
                ContractNumber           = _contractNumber.Text,
                FirstInstallmentCapital  = Convert.ToDouble(_firstInstallmentCapital.Text),
                FirstInstallmentInterest = Convert.ToDouble(_firstInstallmentInterest.Text),
                MonthlyCycle             = Convert.ToDouble(_monthlyCycle.Text)
            };

            PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(WebAPIVariables.addSalaryDeductions, PageMethodsHelper.ObjectToUrlParam(value)).FirstOrDefault();
        }
Beispiel #12
0
        private void SaveNew()
        {
            var value = new SalaryDeductionsDto()
            {
                EmployeeId           = Convert.ToInt32(_employeeIdLabel.Text),
                Amount               = Convert.ToDouble(_amount.Text),
                FromDateST           = _fromDateST.Text,
                ToDateST             = _toDateST.Text,
                SalaryDeductionsType = (int)SalaryDeductionsType.PZUInsurance
            };

            var v = PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(WebAPIVariables.addSalaryDeductions, PageMethodsHelper.ObjectToUrlParam(value)).FirstOrDefault();

            _id.Text = v.Id.ToString();
        }
Beispiel #13
0
        protected void gv_EmployeeList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            var esc = new EmployeeSearchCriteria()
            {
                FirstName          = tb_FirstName.Text,
                LastName           = tb_LastName.Text,
                Section            = ddl_Section.SelectedItem.Value,
                OrganizationalUnit = ddl_OrganizationalUnit.SelectedItem.Value,
                OrganizationalCell = ddl_OrganizationalCell.SelectedItem.Value,
                EmployeeNumber     = tb_EmployeeNumber.Text
            };

            _listEmployeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));
            if (_listEmployeeDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.WUC_SearchEmployeesGv_EmployeeList_PageIndexChanging, _sessionUser.Id);
            }

            GridValueTranslate();
            gv_EmployeeList.PageIndex  = e.NewPageIndex;
            gv_EmployeeList.DataSource = _listEmployeeDto;
            gv_EmployeeList.DataBind();

            up_SearchFor.Update();
        }
Beispiel #14
0
        protected void gv_EmployeeList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            var esc = new EmployeeSearchCriteria()
            {
                FirstName          = tb_FirstName.Text,
                LastName           = tb_LastName.Text,
                Position           = tb_Position.Text,
                PhoneNumber        = tb_PhoneNumber.Text,
                MobilePhoneNumber  = tb_MobilePhoneNumber.Text,
                Section            = ddl_Section.SelectedItem.Value,
                OrganizationalUnit = ddl_OrganizationalUnit.SelectedItem.Value,
                OrganizationalCell = ddl_OrganizationalCell.SelectedItem.Value,
            };

            _listEmployeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            GridValueTranslate();
            gv_EmployeeList.PageIndex  = e.NewPageIndex;
            gv_EmployeeList.DataSource = _listEmployeeDto;
            gv_EmployeeList.DataBind();
        }
Beispiel #15
0
        private void SaveOld()
        {
            var value = new SalaryDeductionsDto()
            {
                Id                   = Convert.ToInt32(_id.Text),
                EmployeeId           = Convert.ToInt32(_employeeIdLabel.Text),
                Amount               = Convert.ToDouble(_amount.Text),
                FromDateST           = _fromDateST.Text,
                ToDateST             = _toDateST.Text,
                SalaryDeductionsType = (int)SalaryDeductionsType.CompanyCar,
                RegistrationNumber   = _registrationNumber.Text
            };

            PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(WebAPIVariables.addSalaryDeductions, PageMethodsHelper.ObjectToUrlParam(value)).FirstOrDefault();
        }
Beispiel #16
0
        protected void btn_SearchFor_Click(object sender, EventArgs e)
        {
            pnl_SearchResults.Visible = true;

            var esc = new EmployeeSearchCriteria()
            {
                FirstName          = tb_FirstName.Text,
                LastName           = tb_LastName.Text,
                Position           = tb_Position.Text,
                PhoneNumber        = tb_PhoneNumber.Text,
                MobilePhoneNumber  = tb_MobilePhoneNumber.Text,
                Section            = ddl_Section.SelectedItem.Value,
                OrganizationalUnit = ddl_OrganizationalUnit.SelectedItem.Value,
                OrganizationalCell = ddl_OrganizationalCell.SelectedItem.Value,
            };

            _listEmployeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            GridValueTranslate();
            gv_EmployeeList.DataSource = _listEmployeeDto;
            gv_EmployeeList.DataBind();
        }
Beispiel #17
0
        protected void gv_DirectReports_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = GetIdFromUrl()
            };

            _employeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();

            esc = new EmployeeSearchCriteria()
            {
                DirectSupervisorID = _employeeDto.Id
            };
            _listDirectReportsDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            if (_listDirectReportsDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.EmployeeGetData, SessionUser.Id);
            }

            gv_DirectReports.PageIndex = e.NewPageIndex;
            SetGridView(gv_DirectReports, _listDirectReportsDto);
        }
Beispiel #18
0
        private ApplicationActionResult GetData()
        {
            CheckPermissions();

            var esc = new EmployeeSearchCriteria()
            {
                EmployeeID = GetIdFromUrl()
            };

            _employeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc)).FirstOrDefault();

            _employeeMembershipDto = PageMethodsHelper.InvokeWebAPI <EmployeeMembershipDto>(WebAPIVariables.employeeMembership, "?id=" + GetIdFromUrl()).FirstOrDefault();

            esc = new EmployeeSearchCriteria()
            {
                EmployeeID = _employeeDto.DirectSupervisorID
            };
            _listDirectReportsDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            esc = new EmployeeSearchCriteria()
            {
                DirectSupervisorID = _employeeDto.Id
            };
            _listReportsToDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            var basic         = @"~\Content\ThumbnailEmployee\";
            var employeeImage = GetIdFromUrl() + ".png";
            var emptyImage    = "empty.png";

            var dataFile = Server.MapPath(basic) + employeeImage;

            if (File.Exists(dataFile))
            {
                btn_Image.ImageUrl = basic + employeeImage;
            }
            else
            {
                btn_Image.ImageUrl = basic + emptyImage;
            }

            if (_employeeDto == null || _employeeMembershipDto == null ||
                _listDirectReportsDto == null || _listReportsToDto == null)
            {
                throw new ApplicationLayerException("NoData", ErrorNumbers.EmployeeGetData, SessionUser.Id);
            }

            SetGridView(gv_ReportsTo, _listDirectReportsDto);
            SetGridView(gv_DirectReports, _listReportsToDto);

            return(new ApplicationActionResult()
            {
                Success = true
            });
        }
Beispiel #19
0
        protected void btn_SearchFor_Click(object sender, EventArgs e)
        {
            pnl_EmployeeList.Visible = true;

            var esc = new EmployeeSearchCriteria()
            {
                FirstName          = tb_FirstName.Text,
                LastName           = tb_LastName.Text,
                Section            = ddl_Section.SelectedItem.Value,
                OrganizationalUnit = ddl_OrganizationalUnit.SelectedItem.Value,
                OrganizationalCell = ddl_OrganizationalCell.SelectedItem.Value,
                EmployeeNumber     = tb_EmployeeNumber.Text,
                DirectSupervisorID = (int)Session[SessionVariables.interiorID]
            };

            _listEmployeeDto = PageMethodsHelper.InvokeWebAPI <EmployeeDto>(WebAPIVariables.searchEmployee, PageMethodsHelper.ObjectToUrlParam(esc));

            GridValueTranslate();
            gv_EmployeeList.DataSource = _listEmployeeDto;
            gv_EmployeeList.DataBind();
        }