public int Quantidade() { CrudDataBase AtendenteDatabas = new CrudDataBase(); int quantidade = AtendenteDatabas.QuantidadeDeAtivos(); return(quantidade); }
public void Alterar(int id, string nome, string cnpj, string desconto, DateTime inicio, DateTime fim) { if ((nome == string.Empty || cnpj == string.Empty || desconto == "0")) { MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Clear = false; } else { CrudDataBase AttDb = new CrudDataBase(); // Salvar o usuário DTOParceiros parceirosDTO = new DTOParceiros(); parceirosDTO.IdParceiro = id; parceirosDTO.NameEnterprise = nome; parceirosDTO.Cnpj = cnpj; parceirosDTO.Discount = desconto; parceirosDTO.Start = inicio; parceirosDTO.End = fim; AttDb.UpdateParc(parceirosDTO); MessageBox.Show("NOVA ATUALIZAÇÃO REALIZADA!", "TOPMOVIE", MessageBoxButtons.OK, MessageBoxIcon.Information); Clear = true; } }
public List <DTOUser> Buscar() { CrudDataBase AtendenteDatabas = new CrudDataBase(); List <DTOUser> Atendentes = AtendenteDatabas.ListAllUsers(); return(Atendentes); }
public void Alterar(int id, string nome, string cnpj, string fantasia, string cep, int numero) { if ((nome == string.Empty || cnpj == string.Empty || fantasia == string.Empty || cep == string.Empty || numero == 0)) { MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Clear = false; } else { CrudDataBase AttDb = new CrudDataBase(); // Salvar o usuário DTOFornecedor fornecedorDTO = new DTOFornecedor(); fornecedorDTO.IdForncedor = id; fornecedorDTO.CodigoPostal = cep; fornecedorDTO.Cnpj = cnpj; fornecedorDTO.Numero = numero; fornecedorDTO.RazãoSocial = nome; fornecedorDTO.NomeFantasia = fantasia; AttDb.UpdateForn(fornecedorDTO); MessageBox.Show("NOVA ATUALIZAÇÃO REALIZADA!", "TOPMOVIE", MessageBoxButtons.OK, MessageBoxIcon.Information); Clear = true; } }
public List <DTOParceiros> ListAll() { CrudDataBase db = new CrudDataBase(); List <DTOParceiros> parceiros = db.ListarParceiros(); return(parceiros); }
public List <DTOTerceirizado> ListTerceirizados() { CrudDataBase db = new CrudDataBase(); List <DTOTerceirizado> terc = db.ListarTerceiros(); return(terc); }
public List <DTOUser> ListAll() { CrudDataBase db = new CrudDataBase(); List <DTOUser> funcionarios = db.ListarAtivos(); return(funcionarios); }
public void Alterar(int id, string nome, string cnpj, DateTime inicio, DateTime fim) { if ((nome == string.Empty || cnpj == string.Empty)) { MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Clear = false; } else { CrudDataBase AttDb = new CrudDataBase(); // Salvar o usuário DTOTerceirizado terceirizadosDTO = new DTOTerceirizado(); terceirizadosDTO.IdTerc = id; terceirizadosDTO.NomeEmpresa = nome; terceirizadosDTO.Cnpj = cnpj; terceirizadosDTO.Inicio = inicio; terceirizadosDTO.Final = inicio; AttDb.UpadateTerc(terceirizadosDTO); MessageBox.Show("NOVA ATUALIZAÇÃO REALIZADA!", "TOPMOVIE", MessageBoxButtons.OK, MessageBoxIcon.Information); Clear = true; } }
public void Save(string email, string nome, string pass, string user, string cpf, DateTime nascimento, string cep, string telefone, decimal numerodacasa, decimal salariobruto, bool adm, bool vendas, bool compras, bool contabilidade, bool fin, bool rh, string setor, decimal va, decimal vr, decimal sf, bool saude, bool transporte, bool rhcargos, bool ageral, bool mkt, bool cont, bool gerentelocal) { if (email == string.Empty || nome == string.Empty || pass == string.Empty || user == string.Empty || cpf == string.Empty || cpf == string.Empty || cep == string.Empty || numerodacasa == 0 || salariobruto < 0) { MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Clear = false; } else if (rhcargos == false && ageral == true && mkt == true && cont == true && gerentelocal == true) { MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Clear = false; } else { CrudDataBase SaveDB = new CrudDataBase(); // Salvar o usuário DTOUser usuarioDTO = new DTOUser(); usuarioDTO.Nome = nome; usuarioDTO.User = user; usuarioDTO.Password = pass; usuarioDTO.Email = email; usuarioDTO.Cpf = cpf; usuarioDTO.Birth = nascimento; usuarioDTO.PostalCode = cep; usuarioDTO.HouseNumber = numerodacasa; usuarioDTO.Telefone = telefone; int idUsuario = SaveDB.SaveUser(usuarioDTO); // Salvar permissão DTOPermission permissaoDTO = new DTOPermission(); permissaoDTO.Administrator = adm; permissaoDTO.Rh = rh; permissaoDTO.Fin = fin; permissaoDTO.Cont = contabilidade; permissaoDTO.Vend = vendas; permissaoDTO.Comp = compras; permissaoDTO.IdUser = idUsuario; SaveDB.SavePermission(permissaoDTO); //Salvar cargos DTOCargos cargosDTO = new DTOCargos(); cargosDTO.AGeral = ageral; cargosDTO.Contabilidade = cont; cargosDTO.Marketing = mkt; cargosDTO.GerenteLocal = gerentelocal; cargosDTO.Rh = rhcargos; cargosDTO.IdUser = idUsuario; SaveDB.SaveCargo(cargosDTO); //Salvar o setor DTOSector setorDTO = new DTOSector(); setorDTO.Setor = setor; setorDTO.IdUsuario = idUsuario; SaveDB.SaveSetor(setorDTO); //Salvar beneficios DTOBenefit beneficiosDTO = new DTOBenefit(); beneficiosDTO.CommuterBenefits = transporte; beneficiosDTO.FamilySalary = sf; beneficiosDTO.HealthInsurance = saude; beneficiosDTO.MealTicket = vr; beneficiosDTO.MealVoucher = va; beneficiosDTO.IdUsuario = idUsuario; SaveDB.SaveBenef(beneficiosDTO); //Salvar salário bruto DTOSalarioBruto salariobrutoDTO = new DTOSalarioBruto(); salariobrutoDTO.IdUser = idUsuario; salariobrutoDTO.SalarioBruto = salariobruto; SaveDB.SaveSalarioBruto(salariobrutoDTO); MessageBox.Show("NOVA ADMISSÃO REALIZADA!", "TOPMOVIE", MessageBoxButtons.OK, MessageBoxIcon.Information); Clear = true; } }
public void FiltrarDemitidos(string texto) { CrudDataBase Atend = new CrudDataBase(); Atendentes = Atend.ListPorNomeAtendentesDemitidos(texto); }