예제 #1
0
        /// <summary>
        /// Konstruktor do edycji
        /// </summary>
        /// <param name="id">id pożyczki</param>
        public LoanNewForm(int id) //280 ->
        {
            InitializeComponent();
            isEdit = true;
            //bindowanie
            BindEmployee();
            AssignLoan(id);
            //blokowanie zmiany pracownika
            cbEmployee.Enabled = false;
            btnSave.Enabled    = false;

            //eventy
            this.tbName.TextChanged            += new System.EventHandler(this.loan_TextChanged);
            this.dtpData.ValueChanged          += new System.EventHandler(this.loan_TextChanged);
            this.tbAmount.TextChanged          += new System.EventHandler(this.loan_TextChanged);
            this.tbInstallmentLoan.TextChanged += new System.EventHandler(this.loan_TextChanged);
            this.tbOther.TextChanged           += new System.EventHandler(this.loan_TextChanged);

            //pasek tytułowy
            this.Text = DaneFirmy.NazwaProgramu + "Edycja pożyczki";
            //ikona
            this.Icon = Properties.Resources.logo_firmy;

            //ustawienie blokady na dany rekord
            Blokady.UstawienieBlokady(NazwaTabeli.pozyczka, id, "", Polaczenia.idUser, DateTime.Now);
        }
예제 #2
0
        /// <summary>
        /// Konstruktor przeciążony
        /// Służy do edycji danych pracownika
        /// </summary>
        /// <param name="idEmployee">id pracownika</param>
        public NewEmployeeForm(int idEmployee)
        {
            InitializeComponent();
            isEdit = true;
            //blokowanie wybierania dat
            dtpRegularRateFromDate.Enabled  = false;
            dtpOvertimeRateFromDate.Enabled = false;
            //blokowanie przycisku zatwierdz
            btnSave.Enabled = false;

            //pasek tytułowy
            this.Text = DaneFirmy.NazwaProgramu + "Pracownik - Edycja";
            //ikona
            this.Icon = Properties.Resources.logo_firmy;
            employee  = employeeManager.GetEmployee(idEmployee, TableView.view, ConnectionToDB.disconnect);

            PermissionsCheck();

            DisplayEmployee();

            //dodanie delegatow
            this.tbOthersInfo.TextChanged            += new System.EventHandler(this.editEmployee_ValueChanged);
            this.cbNumberDaysOffAnnually.TextChanged += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbTelNumer.TextChanged          += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbNumberDaysOffLeft.TextChanged += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbLastName.TextChanged          += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbName.TextChanged    += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbZipCode.TextChanged += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbCity.TextChanged    += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbStreet.TextChanged  += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbNextMmedicalExaminationDate.TextChanged += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbNextTrainingBhpDate.TextChanged         += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbHiredDate.TextChanged         += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbReleaseDate.TextChanged       += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbMail.TextChanged              += new System.EventHandler(this.editEmployee_ValueChanged);
            this.chbPartTimeJob.CheckedChanged   += new System.EventHandler(this.editEmployee_ValueChanged);
            this.chbIsManagement.CheckedChanged  += new System.EventHandler(this.editEmployee_ValueChanged);
            this.tbRateOvertimeValue.TextChanged += new System.EventHandler(this.editRateOvertime_ValueChanged);
            this.tbRateValue.TextChanged         += new System.EventHandler(this.editRateRegular_ValueChanged);

            this.dtpHiredDate.ValueChanged   += new System.EventHandler(this.dtpHiredDate_ValueChanged);
            this.dtpReleaseDate.ValueChanged += new System.EventHandler(this.dtpRealiseDate_ValueChanged);
            this.dtpNextMmedicalExaminationDate.ValueChanged += new System.EventHandler(this.dtpNextMmedicalExaminationDate_ValueChanged);
            this.dtpNextTrainingBhpDate.ValueChanged         += new System.EventHandler(this.dtpNextBhpTrainingDate_ValueChanged);

            //ustawienie blokady na dany rekord
            Blokady.UstawienieBlokady(NazwaTabeli.pracownik, idEmployee, "", Polaczenia.idUser, DateTime.Now);
        }