示例#1
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();
        }
示例#2
0
        public Root <SalaryDeductionsResultDto> AddSalaryDeductions([FromUri] SalaryDeductionsDto salaryDeductionsDto)
        {
            int id;
            var list = new List <SalaryDeductionsResultDto>();

            if (!string.IsNullOrEmpty(salaryDeductionsDto.FromDateST))
            {
                salaryDeductionsDto.FromDate = Convert.ToDateTime(salaryDeductionsDto.FromDateST);
            }
            if (!string.IsNullOrEmpty(salaryDeductionsDto.ToDateST))
            {
                salaryDeductionsDto.ToDate = Convert.ToDateTime(salaryDeductionsDto.ToDateST);
            }

            if (salaryDeductionsDto.Id == 0)
            {
                id = SalaryDeductionsInsert(salaryDeductionsDto);
            }
            else
            {
                id = SalaryDeductionsUpdate(salaryDeductionsDto);
            }

            list.Add(new SalaryDeductionsResultDto(id));

            return(new Root <SalaryDeductionsResultDto> {
                Items = list
            });
        }
示例#3
0
        public int SalaryDeductionsInsert(SalaryDeductionsDto salaryDeductionsDto)
        {
            var addDeductionsSalary = new AddDeductionsSalaryCommand(salaryDeductionsDto);

            _gate.Dispatch(addDeductionsSalary);

            return(addDeductionsSalary.ReturnValue);
        }
示例#4
0
        private void InitData()
        {
            lbl_nameSurname.Text    = _employeeDto.LastName + " " + _employeeDto.FirstName;
            lbl_EmployeeNumber.Text = _employeeDto.EmployeeNumber;
            lbl_Position.Text       = _employeeMembershipDto.Position;
            lbl_PhoneNumber.Text    = _employeeDto.PhoneNumber;
            lbl_MobileNumber.Text   = _employeeDto.MobilePhoneNumber;
            lbl_Email.Text          = _employeeDto.Email;

            //pnl_PersonalInformation
            var address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == false).FirstOrDefault();

            lbl_Spot.Text       = address.City;
            lbl_Community.Text  = address.PostOffice;
            lbl_PostalCode.Text = address.PostalCode;
            lbl_Street.Text     = address.Street;
            lbl_StreetNo.Text   = address.BuildingNo;
            lbl_Premises.Text   = address.LocalNo;

            address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == true).FirstOrDefault();
            if (address == null)
            {
                address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == false).FirstOrDefault();
            }

            lbl_SpotCo.Text       = address.City;
            lbl_CommunityCo.Text  = address.PostOffice;
            lbl_PostalCodeCo.Text = address.PostalCode;
            lbl_StreetCo.Text     = address.Street;
            lbl_StreetNoCo.Text   = address.BuildingNo;
            lbl_PremisesCo.Text   = address.LocalNo;

            lbl_Pesel.Text     = _employeeDto.Pesel;
            lbl_Education.Text = _employeeDto.Education;

            //pnl_HolidaysDue
            lbl_ReportForDay.Text           = DateTime.Now.ToShortDateString();
            lbl_HolidaysDue.Text            = _vacationsDto.HolidaysDue.ToString();
            lbl_HolidaysCalculated.Text     = _vacationsDto.HolidaysCalculated.ToString();
            lbl_HolidaysUnderpaid.Text      = _vacationsDto.HolidaysUnderpaid.ToString();
            lbl_HolidaysRehabilitation.Text = _vacationsDto.HolidaysRehabilitation.ToString();
            lbl_HolidaysUsed.Text           = _vacationsDto.HolidaysUsed.ToString();
            lbl_Art188KP.Text       = _vacationsDto.Art188KP.ToString();
            lbl_RemainedUnused.Text = _vacationsDto.RemainedUnused.ToString();

            var value = new List <SalaryDeductionsDto>();
            var v     = new SalaryDeductionsDto();

            value.Add(v);

            this.gv_Additions.DataSource = value;
            this.gv_Additions.DataBind();
            this.gv_MedicalExamination.DataSource = value;
            this.gv_MedicalExamination.DataBind();
        }
示例#5
0
 public AddDeductionsSalaryCommand(SalaryDeductionsDto salaryDeductionsDto)
 {
     SalaryDeductionsDto              = salaryDeductionsDto;
     SalaryDeductionsDto.Success      = false;
     SalaryDeductionsDto.ErrorNumber  = ErrorNumbers.AddDeductionsSalaryCommand;
     SalaryDeductionsDto.ErrorMessage = "AddDeductionsSalary";
     Success      = false;
     ErrorNumber  = ErrorNumbers.AddDeductionsSalaryCommand;
     ErrorMessage = "AddDeductionsSalary";
     UserId       = salaryDeductionsDto.UserId;
 }
示例#6
0
        public Root <SalaryDeductionsResultDto> DeleteSalaryDeductions([FromUri] SalaryDeductionsDto salaryDeductionsDto)
        {
            var list = new List <SalaryDeductionsResultDto>();

            _deductionsSalaryService.DeleteDeductionsSalary(salaryDeductionsDto);

            list.Add(new SalaryDeductionsResultDto(salaryDeductionsDto.Id));

            return(new Root <SalaryDeductionsResultDto> {
                Items = list
            });
        }
示例#7
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.PZUInsurance
            };

            PageMethodsHelper.InvokeWebAPI <SalaryDeductionsDto>(WebAPIVariables.addSalaryDeductions, PageMethodsHelper.ObjectToUrlParam(value)).FirstOrDefault();
        }
示例#8
0
        public void UpdateDeductionsSalary(SalaryDeductionsDto salaryDeductionsDto)
        {
            var value = SalaryDeductionsRepository.Load(salaryDeductionsDto.Id);

            value.Amount                   = salaryDeductionsDto.Amount;
            value.FromDate                 = salaryDeductionsDto.FromDate;
            value.ToDate                   = salaryDeductionsDto.ToDate;
            value.ContractNumber           = salaryDeductionsDto.ContractNumber;
            value.FirstInstallmentCapital  = salaryDeductionsDto.FirstInstallmentCapital;
            value.FirstInstallmentInterest = salaryDeductionsDto.FirstInstallmentInterest;
            value.MonthlyCycle             = salaryDeductionsDto.MonthlyCycle;
            value.RegistrationNumber       = salaryDeductionsDto.RegistrationNumber;

            SalaryDeductionsRepository.SaveAndFlush(value, salaryDeductionsDto.UserId);
        }
示例#9
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.Multisport
            };

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

            _id.Text = v.Id.ToString();
        }
示例#10
0
        private void InitData()
        {
            lbl_nameSurname.Text    = _employeeDto.LastName + " " + _employeeDto.FirstName;
            lbl_EmployeeNumber.Text = _employeeDto.EmployeeNumber;
            lbl_Position.Text       = _employeeMembershipDto.Position;
            tb_PhoneNumber.Text     = _employeeDto.PhoneNumber;
            tb_MobileNumber.Text    = _employeeDto.MobilePhoneNumber;
            tb_Email.Text           = _employeeDto.Email;

            //pnl_PersonalInformation
            var address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == false).FirstOrDefault();

            tb_Spot.Text       = address.City;
            tb_Community.Text  = address.PostOffice;
            tb_PostalCode.Text = address.PostalCode;
            tb_Street.Text     = address.Street;
            tb_StreetNo.Text   = address.BuildingNo;
            tb_Premises.Text   = address.LocalNo;

            address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == true).FirstOrDefault();
            if (address == null)
            {
                address = _listEmployeeAddressDto.Where(x => x.IsCorrespondence == false).FirstOrDefault();
            }

            tb_SpotCo.Text       = address.City;
            tb_CommunityCo.Text  = address.PostOffice;
            tb_PostalCodeCo.Text = address.PostalCode;
            tb_StreetCo.Text     = address.Street;
            tb_StreetNoCo.Text   = address.BuildingNo;
            tb_PremisesCo.Text   = address.LocalNo;

            tb_Pesel.Text     = _employeeDto.Pesel;
            tb_Education.Text = _employeeDto.Education;

            var value = new List <SalaryDeductionsDto>();
            var v     = new SalaryDeductionsDto();

            value.Add(v);

            this.gv_Additions.DataSource = value;
            this.gv_Additions.DataBind();
            this.gv_MedicalExamination.DataSource = value;
            this.gv_MedicalExamination.DataBind();
        }
示例#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();
        }
示例#12
0
        public Root <SalaryDeductionsResultDto> AddSalaryDeductions([FromUri] SalaryDeductionsDto salaryDeductionsDto)
        {
            int id;
            var list = new List <SalaryDeductionsResultDto>();

            if (salaryDeductionsDto.Id == 0)
            {
                id = SalaryDeductionsInsert(salaryDeductionsDto);
            }
            else
            {
                id = SalaryDeductionsUpdate(salaryDeductionsDto);
            }

            list.Add(new SalaryDeductionsResultDto(id));

            return(new Root <SalaryDeductionsResultDto> {
                Items = list
            });
        }
示例#13
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();
        }
示例#14
0
        public int AddDeductionsSalary(SalaryDeductionsDto salaryDeductionsDto)
        {
            var employee = new B_Employee();

            employee.SetId(salaryDeductionsDto.EmployeeId);

            var value = new B_SalaryDeductions()
            {
                Employee                 = employee,
                Amount                   = salaryDeductionsDto.Amount,
                FromDate                 = salaryDeductionsDto.FromDate,
                ToDate                   = salaryDeductionsDto.ToDate,
                SalaryDeductionsType     = (SalaryDeductionsType)salaryDeductionsDto.SalaryDeductionsType,
                ContractNumber           = salaryDeductionsDto.ContractNumber,
                FirstInstallmentCapital  = salaryDeductionsDto.FirstInstallmentCapital,
                FirstInstallmentInterest = salaryDeductionsDto.FirstInstallmentInterest,
                MonthlyCycle             = salaryDeductionsDto.MonthlyCycle,
                RegistrationNumber       = salaryDeductionsDto.RegistrationNumber
            };

            SalaryDeductionsRepository.SaveAndFlush(value, salaryDeductionsDto.UserId);

            return(value.Id);
        }
示例#15
0
 public void DeleteDeductionsSalary(SalaryDeductionsDto salaryDeductionsDto)
 {
     SalaryDeductionsRepository.Delete(salaryDeductionsDto.Id, salaryDeductionsDto.UserId);
 }
示例#16
0
 public int SalaryDeductionsInsert(SalaryDeductionsDto salaryDeductionsDto)
 {
     return(_deductionsSalaryService.AddDeductionsSalary(salaryDeductionsDto));
 }
示例#17
0
        public int SalaryDeductionsUpdate(SalaryDeductionsDto salaryDeductionsDto)
        {
            _deductionsSalaryService.UpdateDeductionsSalary(salaryDeductionsDto);

            return(salaryDeductionsDto.Id);
        }