Beispiel #1
0
        public string ValeAlimentação(int ano, int mes)
        {
            Database.Entities.tb_benefits tb = DB.tb_benefits.First(t => t.id_emp == id);
            if (tb.bt_food == true)
            {
                int qtdDiasUteis = this.QtdDeDiasUteis(ano, mes);

                decimal VA = Convert.ToDecimal(qtdDiasUteis * 30);
                return("R$ " + VA.ToString());
            }
            else
            {
                return("R$ 00,00");
            }
        }
Beispiel #2
0
        public string ValeTransporte(int ano, int mes)
        {
            Database.Entities.tb_benefits  tb = DB.tb_benefits.First(t => t.id_emp == id);
            Database.Entities.tb_financial F  = DB.tb_financial.First(t => t.id_emp == id);
            if (tb.bt_transport == true)
            {
                int qtdDiasUteis = this.QtdDeDiasUteis(ano, mes);

                decimal VL = Convert.ToDecimal(qtdDiasUteis * 8.60);

                double bruto = Convert.ToDouble(F.vl_grossSalary);
                SL = Convert.ToDecimal(bruto - bruto * 0.06);

                return("R$ " + VL.ToString());
            }
            else
            {
                SL = 0;
                return("R$ 00,00");
            }
        }
Beispiel #3
0
 public void Alterar(Database.Entities.tb_benefits benefits)
 {
     db.Alterar(benefits);
 }
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                Database.Entities.tb_employees tbemployees = new Database.Entities.tb_employees();
                Business.EmployeesBusiness     busemployee = new Business.EmployeesBusiness();

                Database.Entities.tb_department tbdepartment  = new Database.Entities.tb_department();
                Business.DepartmentBusiness     busdepartment = new Business.DepartmentBusiness();

                Database.Entities.tb_function tbfunction  = new Database.Entities.tb_function();
                Business.FunctionBusiness     busfunction = new Business.FunctionBusiness();

                Database.Entities.tb_timecard tbtimecard  = new Database.Entities.tb_timecard();
                Business.TimeCardBusiness     bustimecard = new Business.TimeCardBusiness();

                Database.Entities.tb_financial tbfinancial  = new Database.Entities.tb_financial();
                Business.FinancialBusiness     busfinancial = new Business.FinancialBusiness();

                Database.Entities.tb_benefits tbbenefits  = new Database.Entities.tb_benefits();
                Business.BenefitsBusiness     busbenefits = new Business.BenefitsBusiness();

                Database.Entities.tb_bankaccount tbbank  = new Database.Entities.tb_bankaccount();
                Business.BankAccountBusiness     busbank = new Business.BankAccountBusiness();

                tbemployees.dt_hiring        = dtpContratação.Value.ToShortDateString();
                tbemployees.dt_resignation   = dtpDemissão.Value.ToShortDateString();
                tbdepartment.nm_department   = cboDepartamento.Text;
                tbfunction.nm_function       = cboCargo.Text;
                tbtimecard.hr_fixedInput     = mtxtInício.Text;
                tbtimecard.hr_fixedIntInput  = mtxtInícioIntervalo.Text;
                tbtimecard.hr_fixedIntOutput = mtxtTérminoIntervalo.Text;
                tbtimecard.hr_fixedOutput    = mtxtTérminoIntervalo.Text;
                tbfinancial.vl_grossSalary   = nudSalárioBruto.Value;
                tbbenefits.bt_food           = Convert.ToBoolean(chkValeAlimentação.Checked);
                tbbenefits.bt_meal           = Convert.ToBoolean(chkValeRefeição.Checked);
                tbbenefits.bt_lifeSafe       = Convert.ToBoolean(chkSeguroDeVida.Checked);
                tbbenefits.bt_transport      = Convert.ToBoolean(chkValeTransporte.Checked);
                tbbenefits.bt_planHealth     = Convert.ToBoolean(chkPlanoDeSáude.Checked);
                tbbenefits.bt_planDental     = Convert.ToBoolean(chkPlanoDental.Checked);
                tbbank.nm_bank       = txtNomeDoBanco.Text;
                tbbank.nr_account    = mtxtCódigoDoBanco.Text;
                tbbank.nr_agency     = Convert.ToInt32(mtxtAgênciaDoBanco.Text);
                tbbank.ds_typePerson = cboTipoDePessoa.Text;

                busemployee.Inserir1(tbemployees);
                busdepartment.Inserir(tbdepartment);
                busfunction.Inserir(tbfunction);
                bustimecard.Inserir(tbtimecard);
                busfinancial.Inserir(tbfinancial);
                busbenefits.Inserir(tbbenefits);
                busbank.Inserir(tbbank);

                MessageBox.Show("Funcionário cadastrado com sucesso");

                Model.EmployeesModel.firstName  = string.Empty;
                Model.EmployeesModel.lastName   = string.Empty;
                Model.EmployeesModel.RG         = string.Empty;
                Model.EmployeesModel.CPF        = string.Empty;
                Model.EmployeesModel.dependents = 0;
                Model.EmployeesModel.birth      = Convert.ToString(DateTime.Now);
                Model.EmployeesModel.CEP        = string.Empty;
                Model.EmployeesModel.note       = string.Empty;
                Model.EmployeesModel.address    = string.Empty;
                Model.EmployeesModel.email      = string.Empty;
                Model.EmployeesModel.cellphone  = string.Empty;
                Model.EmployeesModel.tellphone  = string.Empty;
                Model.EmployeesModel.password   = string.Empty;
                Model.EmployeesModel.manager    = Convert.ToBoolean(string.Empty);
                Model.EmployeesModel.employeer  = Convert.ToBoolean(string.Empty);
                Model.EmployeesModel.RH         = Convert.ToBoolean(string.Empty);
                Model.EmployeesModel.financial  = Convert.ToBoolean(string.Empty);
                Model.EmployeesModel.stock      = Convert.ToBoolean(string.Empty);
                Model.EmployeesModel.CRM        = Convert.ToBoolean(string.Empty);
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (Exception)
            {
                MessageBox.Show("Ocorreu um erro!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #5
0
 public void Inserir(Database.Entities.tb_benefits benefits)
 {
     db.Inserir(benefits);
 }