Example #1
0
 public ByARpt AnularGestion(Entidades.Contratos.vEstContratos Reg)
 {
     ESTCONTRATOS r = new ESTCONTRATOS();
     Mapper.Map(Reg, r);
     cmdAnularGestion o = new cmdAnularGestion { reg = r };
     return o.Enviar();
 }
Example #2
0
 public ByARpt InsertTerminacion(Entidades.Contratos.vEstContratos Reg)
 {
     ESTCONTRATOS r = new ESTCONTRATOS();
     Mapper.Map(Reg, r);
     cmdInsertTerminacion o = new cmdInsertTerminacion { reg = r };
     return o.Enviar();
 }
        public PesquisaMercadoriaResultado(Entidades.Mercadoria.Mercadoria[] mercadorias, Tabela tabela, Entidades.Financeiro.Cotação cotação)
        {
            InitializeComponent();

            listaFotos.Ordenar = false;

            using (Formulários.Aguarde dlg = new Formulários.Aguarde("Carregando fotos...", mercadorias.Length))
            {
                dlg.Abrir();

                foreach (Entidades.Mercadoria.Mercadoria m in mercadorias)
                {
                    Foto foto = CacheMiniaturas.Instância.ObterFoto(m);

                    if (foto != null)
                        listaFotos.Adicionar(foto);

                    dlg.Passo();
                }
            }

            cmbTabela.Seleção = tabela;
            txtCotação.Carregar();
            txtCotação.Cotação = cotação;
        }
        public static Bitmap ObterÍconeComFundoECódigo(Entidades.Pessoa.Pessoa pessoa)
        {
            Bitmap ícone = ObterÍcone(pessoa);
            Bitmap novo = new Bitmap(larguraCaixa, alturaCaixa);
            Graphics desenhador = Graphics.FromImage(novo);

            desenhador.Clear(Color.Black);

            Rectangle rect = new Rectangle(0, 0, larguraCaixa, alturaCaixa);

            Color corFundo;

            if (pessoa.Setor != null &&
                pessoa.Setor.Código == Setor.ObterSetor(SetorSistema.Varejo).Código)
                corFundo = Color.White;
            else
                corFundo = Color.DarkGreen;

            LinearGradientBrush linBrush = new LinearGradientBrush(rect, corFundo, Color.FromArgb(224, 224, 224), LinearGradientMode.ForwardDiagonal);
            
            //cria o degrade no retângulo
            desenhador.FillRectangle(linBrush, rect);
            desenhador.DrawImage(ícone, (larguraCaixa - larguraÍcone) / 2, -8 + (alturaCaixa - alturaÍcone) / 2, larguraÍcone, alturaÍcone);

            StringFormat formato = new StringFormat();
            formato.Alignment = StringAlignment.Center;
            
            SizeF tamanhoTexto = desenhador.MeasureString(pessoa.Código.ToString(), fonteTexto);

            desenhador.DrawString(pessoa.Código.ToString(), fonteTexto, Brushes.Black,
                new RectangleF(0, alturaCaixa - tamanhoTexto.Height, larguraCaixa, tamanhoTexto.Height), formato);

            return novo;
        }
        public static Bitmap ObterÍcone(Entidades.Pessoa.Pessoa pessoa)
        {
            if (pessoa == null)
                return null;

            if (Representante.ÉRepresentante(pessoa))
                return Resource.malaimj;
            else if (pessoa is PessoaJurídica)
                return Resource.predios;
            else if (((PessoaFísica)pessoa).Sexo == Sexo.Feminino)
            {
                //if (pessoa.Setor != null
                //    && pessoa.Setor.Código == Setor.ObterSetor(SetorSistema.Varejo).Código)
                //    return Resources.mulherrosa;
                //else
                //    return Resources.mulherpreto;

                return Resource.mulherpreto;
            }
            else
            {
                //if (pessoa.Setor != null &&
                //    pessoa.Setor.Código == Setor.ObterSetor(SetorSistema.Varejo).Código)
                //    return Resources.homemrosa;
                //else
                //    return Resources.homempreto;

                return Resource.homempreto;
            }
        }
 private static void MapearItem(Entidades.Mercadoria.MercadoriaImpressão mercadoria, DataRow linha)
 {
     linha["referência"] = mercadoria.Referência;
     linha["peso"] = mercadoria.Peso;
     linha["índice"] = mercadoria.Índice;
     linha["depeso"] = mercadoria.DePeso.ToString();
 }
        public void Actualizar(Entidades.Cliente cli, string dniActual)
        {
            //Crear Conexion y Abrirla
            SqlCeConnection Con = CrearConexion();

            // Crear SQLCeCommand - Asignarle la conexion - Asignarle la instruccion SQL (consulta)
            SqlCeCommand Comando = new SqlCeCommand();
            Comando.Connection = Con;
            Comando.CommandType = CommandType.Text;

            Comando.CommandText = "UPDATE [Clientes] SET [dnicuil]=@DNINuevo,[nombre] = @NOMBRE, [apellido] = @APELLIDO, [email] = @EMAIL, [tel1]=@TEL1, [tel2]=@TEL2 WHERE (([dnicuil] = @DNICUILACTUAL))";
            Comando.Parameters.Add(new SqlCeParameter("@DNICUILACTUAL", SqlDbType.NVarChar));
            Comando.Parameters["@DNICUILACTUAL"].Value = dniActual;
            Comando.Parameters.Add(new SqlCeParameter("@NOMBRE", SqlDbType.NVarChar));
            Comando.Parameters["@NOMBRE"].Value = cli.Nombre;
            Comando.Parameters.Add(new SqlCeParameter("@APELLIDO", SqlDbType.NVarChar));
            Comando.Parameters["@APELLIDO"].Value = cli.Apellido;
            Comando.Parameters.Add(new SqlCeParameter("@EMAIL", SqlDbType.NVarChar));
            Comando.Parameters["@EMAIL"].Value = cli.Email;
            Comando.Parameters.Add(new SqlCeParameter("@TEL1", SqlDbType.NVarChar));
            Comando.Parameters["@TEL1"].Value = cli.Tel1;
            Comando.Parameters.Add(new SqlCeParameter("@TEL2", SqlDbType.NVarChar));
            Comando.Parameters["@TEL2"].Value = cli.Tel2;
            Comando.Parameters.Add(new SqlCeParameter("@DNINuevo", SqlDbType.NVarChar));
            Comando.Parameters["@DNINuevo"].Value = cli.DniCuil;

            //Ejecuta el comando INSERT
            Comando.Connection.Open();
            Comando.ExecuteNonQuery();
            Comando.Connection.Close();
        }
        public BaseInfoAtendimentosCliente(Entidades.Pessoa.Pessoa pessoa)
        {
            this.pessoa = pessoa;
            títuloBaseInferior.Título = "Atendimentos de " + pessoa.Nome;
            títuloBaseInferior.Descrição = "";

            InitializeComponent();
        }
		/// <summary>
		/// Balão ilustrado para atualização do TxtCotação
		/// </summary>
		/// <param name="novaCotação">Nova cotação cadastrada</param>
		public BalãoCotaçãoNova(Entidades.Financeiro.Cotação novaCotação)
		{
			// This call is required by the Windows Form Designer.
			InitializeComponent();

            txtFuncionário.Text = novaCotação.Funcionário.Nome;
            txtValor.Text = novaCotação.Valor.ToString("C", DadosGlobais.Instância.Cultura);
		}
 private Resumo ObterResumo(Entidades.Pessoa.Pessoa p)
 {
     foreach (Resumo r in resumos)
     {
         if (r.Pessoa == p.Código)
             return r;
     }
     return null;
 }
        public void PrepararImpressão(ReportClass relatório, Entidades.Pagamentos.NotaPromissória entidade)
        {
            DataSetNotaPromissória ds = new DataSetNotaPromissória();
            DataTable tabela = ds.Tables["NotaPromissória"];

            tabela.Rows.Add(CriarItem(entidade, tabela));

            relatório.SetDataSource(ds);
        }
Example #12
0
        //Metodo para Recibir los datos de la capa de Presentacion y enviarlos a DataAccess
        public void InsertClientes(Entidades.Clientes ObjClientesEntidad)
        {
            //Aqui van las Validaciones de Lugar

               DataAccess.ClientesDA ObjClientesDA = new DataAccess.ClientesDA();
               ObjClientesDA.InsertClientes(ObjClientesEntidad);

               MessageBox.Show("Registro Guardado Correctamente");
        }
        /// <param name="mercadoria">Mercadoria para exibição</param>
        public JanelaInformaçõesMercadoria(Entidades.Mercadoria.Mercadoria mercadoria, Entidades.Financeiro.Cotação cotação)
        {
            InitializeComponent();

            Cotação = cotação;
            Mercadoria = mercadoria;

            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
        }
Example #14
0
        public void UpdateClientes(Entidades.Clientes ObjClientesEntidad)
        {
            DataAccess.ClientesDA ObjClienteDA = new DataAccess.ClientesDA();

            //Aqui van las validaciones antes de Actualizar el registro

            ObjClienteDA.UpdateClientes(ObjClientesEntidad);

            MessageBox.Show("Registro Actulizado Correctamente");
        }
Example #15
0
        //Metodo para insertar Clientes
        public void InsertClientes(Entidades.Clientes ObjClientesEntidad)
        {
            SqlCommand ObjCmd = new SqlCommand("Sp_Insert_Cli", Connection.Get);
            ObjCmd.CommandType = CommandType.StoredProcedure;
            Connection.Get.Open();

            ObjCmd.Parameters.Add(new SqlParameter("@CodCliente", ObjClientesEntidad.CodCliente) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Nombre", ObjClientesEntidad.Nombre) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Apellido", ObjClientesEntidad.Apellido) { SqlDbType = SqlDbType.NVarChar});
            ObjCmd.Parameters.Add(new SqlParameter("@Cedula", ObjClientesEntidad.Cedula) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Genero", ObjClientesEntidad.Genero) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Telefono", ObjClientesEntidad.Telefono) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Celular", ObjClientesEntidad.Celular) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Fax", ObjClientesEntidad.Fax) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@FechaNacimiento", ObjClientesEntidad.FechaNaci) { SqlDbType = SqlDbType.DateTime });
            ObjCmd.Parameters.Add(new SqlParameter("@CalleoAv", ObjClientesEntidad.CalleoAv) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@NoVivienda", ObjClientesEntidad.NoVivienda) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Sector", ObjClientesEntidad.Sector) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Ciudad", ObjClientesEntidad.Ciudad) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Email", ObjClientesEntidad.Email) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Nodependiente", ObjClientesEntidad.Nodependiente) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Empresa", ObjClientesEntidad.Empresa) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CalleoAvEmpresa", ObjClientesEntidad.CalleoAvEmpresa) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Noempresa", ObjClientesEntidad.NoEmpresa) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@RNC", ObjClientesEntidad.RNC) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CiudadEmp", ObjClientesEntidad.CiudadEmp) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@TelefonoEmp", ObjClientesEntidad.TelefonoEmp) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@FaxEmp", ObjClientesEntidad.FaxEmp) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Puesto", ObjClientesEntidad.Puesto) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Ingresos", ObjClientesEntidad.Ingresos) { SqlDbType = SqlDbType.Decimal });
            ObjCmd.Parameters.Add(new SqlParameter("@FechaIngreso", ObjClientesEntidad.FechaIngreso) { SqlDbType = SqlDbType.DateTime });
            ObjCmd.Parameters.Add(new SqlParameter("@NoCuenta", ObjClientesEntidad.NoCuenta) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@NombreGar", ObjClientesEntidad.NombreGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@ApellidoGar", ObjClientesEntidad.ApellidoGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CedulaGar", ObjClientesEntidad.CedulaGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@TelefonoGar", ObjClientesEntidad.TelefonoGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CelularGar", ObjClientesEntidad.CelularGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@EmailGar", ObjClientesEntidad.EmailGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Direccion", ObjClientesEntidad.DireccionGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@Descripciongarantia", ObjClientesEntidad.DescripcionGarantia) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@EmpresaGar", ObjClientesEntidad.EmpresaGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CalleoAvEmpresaGar", ObjClientesEntidad.CalleoAvEmpresaGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@NoEmpresaGar", ObjClientesEntidad.NoEmpresaGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@RNCgar", ObjClientesEntidad.RNCGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@CiudadEmpGar", ObjClientesEntidad.CiudadEmpGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@TelefonoEmpGar", ObjClientesEntidad.TelefonoEmpGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@FaxEmpGar", ObjClientesEntidad.FaxEmpGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@PuestoGar", ObjClientesEntidad.PuestoGar) { SqlDbType = SqlDbType.NVarChar });
            ObjCmd.Parameters.Add(new SqlParameter("@IngresosGar", ObjClientesEntidad.IngresosGar) { SqlDbType = SqlDbType.Decimal });
            ObjCmd.Parameters.Add(new SqlParameter("@FechaIngresoGar", ObjClientesEntidad.FechaIngresoGar) { SqlDbType = SqlDbType.DateTime });
            ObjCmd.Parameters.Add(new SqlParameter("@NoCuentaGar", ObjClientesEntidad.NoCuentaGar) { SqlDbType = SqlDbType.NVarChar });

            ObjCmd.ExecuteNonQuery();
            Connection.Get.Close();
        }
 private void txtCotação_EscolheuCotação(Entidades.Financeiro.Cotação escolha)
 {
     try
     {
         listaFotos_AoSelecionar(listaFotos.Seleção);
     }
     catch
     {
         lblPreço.Text = "N/D";
     }
 }
Example #17
0
        public void MostrarDatos(Entidades.Usuario user)
        {
            Console.WriteLine("Usuario: {0}" + user.ID);
            Console.WriteLine("\t\tNombre: {0}" + user.Nombre);
            Console.WriteLine("\t\tApellido: {0}" + user.Apellido);
            Console.WriteLine("\t\tNombre de usuario: {0}" + user.NombreUsuario);
            Console.WriteLine("\t\tPassword: {0}" + user.Password);
            Console.WriteLine("\t\tEmail: {0}" + user.Email);
            Console.WriteLine("\t\tHabilitado: {0}" + user.Habilitado);
            Console.WriteLine();

        }
        /// <summary>
        /// Adiciona um endereço
        /// </summary>
        /// <param name="Pessoa"></param>
        internal void Adicionar(Entidades.Pessoa.Pessoa pessoa)
        {
            Entidades.Pessoa.Endereço.Endereço endereço = null;

            Focus();

            // Primeiro verifica se pessoa já está na lista.
            // Se estiver, faz nada.
            foreach (EtiquetaSedex etiqueta in hashItens.Values)
            {
                if (etiqueta.Pessoa.Código == pessoa.Código)
                    return;
            }

            if (pessoa.Endereços.ContarElementos() > 1) 
            {
                using (Apresentação.Pessoa.Endereço.EscolhaEndereço dlg =
                    new Apresentação.Pessoa.Endereço.EscolhaEndereço(pessoa.Endereços)) 
                {
                    if (dlg.ShowDialog(ParentForm) == DialogResult.OK)
                        endereço = dlg.Endereço;
                    else
                        return;
                }
            }
            else if (pessoa.Endereços.ContarElementos() == 0)
            {
                MessageBox.Show(
                    ParentForm,
                    "Não existe nenhum endereço cadastrado para este cliente, portanto não é possível imprimir etiqueta para mala-direta.",
                    "Mala-Direta",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                // Existe só um endereço
                endereço = pessoa.Endereços.ExtrairElementos()[0];
            }

            Entidades.EtiquetaSedex entidade = new Entidades.EtiquetaSedex();
            entidade.Pessoa = pessoa;
            entidade.Endereço = endereço;

            ListViewItem item = new ListViewItem();
            AtualizarItem(item, entidade);
            lista.Items.Add(item);
            hashItens[item] = entidade;

            Show();
        }
        public static Bitmap ObterÍcone(Entidades.Pessoa.Pessoa pessoa)
        {
            if (pessoa == null)
                return null;

            if (Representante.ÉRepresentante(pessoa))
                return Resource.malaimj;
            else if (pessoa is PessoaJurídica)
                return Resource.predios;
            else if (((PessoaFísica)pessoa).Sexo == Sexo.Feminino)
                return Resource.mulherpreto;
            else
                return Resource.homempreto;
        }
Example #20
0
        public int SearchClientes(Entidades.Clientes ObjClientesEntidad)
        {
            SqlCommand ObjCmd = new SqlCommand("Sp_Search_Cli", Connection.Get);
            ObjCmd.CommandType = CommandType.StoredProcedure;

            Connection.Get.Open();

            ObjCmd.Parameters.Add(new SqlParameter("@CodCliente", ObjClientesEntidad.CodCliente) { SqlDbType = SqlDbType.NVarChar });

            SqlParameter Prm = ObjCmd.Parameters.Add("@Returns", SqlDbType.Bit);
            Prm.Direction = ParameterDirection.Output;
            ObjCmd.ExecuteNonQuery();
            Connection.Get.Close();

            return Convert.ToInt32( (ObjCmd.Parameters["@Returns"].Value));
        }
Example #21
0
        public EscolherTabela(Entidades.Pessoa.Pessoa pessoa) : this()
        {
            if (pessoa != null && pessoa.Setor != null)
            {
                List<Tabela> tabelas = Tabela.ObterTabelas(pessoa.Setor);

                foreach (Tabela tabela in tabelas)
                    if (!lista.Contains(tabela))
                        AdicionarTabela(tabela, false);
            }

            if (lst.Items.Count == 0 && Representante.ÉRepresentante(pessoa))
                foreach (Tabela tabela in Tabela.ObterTabelas())
                    if (!lista.Contains(tabela))
                        AdicionarTabela(tabela, false);
        }
        public static Bitmap ObterÍconeComFundoECódigo(Entidades.Pessoa.Pessoa pessoa)
        {
            
            Bitmap ícone = ObterÍcone(pessoa);
            Bitmap novo = new Bitmap(larguraCaixa, alturaCaixa);
            Graphics desenhador = Graphics.FromImage(novo);
            //desenhador.FillPath(.DrawCurve(.DrawClosedCurve(Pens.AliceBlue, 23, 2, System.Drawing.Drawing2D.FillMode.
            //desenhador.Clear(Color.FromArgb(192, 192, 255));


            desenhador.Clear(Color.Black);
            //Cria retângulo na posição 10,10 com 50 por 50
            Rectangle rect = new Rectangle(0, 0, larguraCaixa, alturaCaixa);

            Color corFundo;

            if (pessoa.Setor != null &&
                pessoa.Setor.Código == Setor.ObterSetor(SetorSistema.Varejo).Código)
                corFundo = Color.Gray;
            else
                corFundo = Color.DarkGreen;

            LinearGradientBrush linBrush = new LinearGradientBrush(rect, corFundo, Color.FromArgb(224, 224, 224), LinearGradientMode.ForwardDiagonal);
            
            //cria o degrade no retângulo
            desenhador.FillRectangle(linBrush, rect);
            
            //imprime retângulo
            //e.FillRectangle(linBrush, rect);

            //desenhador.Clear(Color.FromKnownColor(KnownColor.DarkOliveGreen));

            desenhador.DrawImage(ícone, (larguraCaixa - larguraÍcone) / 2, -4 + (alturaCaixa - alturaÍcone) / 2, larguraÍcone, alturaÍcone);
            //desenhador.DrawImage(ícone, 0, 0);

            StringFormat formato = new StringFormat();
            formato.Alignment = StringAlignment.Center;
            
            SizeF tamanhoTexto = desenhador.MeasureString(pessoa.Código.ToString(), fonteTexto);

            desenhador.DrawString(pessoa.Código.ToString(), fonteTexto, Brushes.Black,
                new RectangleF(0, alturaCaixa - tamanhoTexto.Height, larguraCaixa, tamanhoTexto.Height), formato);

            return novo;
        }
        private static DataRow CriarItem(Entidades.Pagamentos.NotaPromissória entidade, DataTable tabela)
        {
            DataRow item = tabela.NewRow();

            CultureInfo cultura = Entidades.Configuração.DadosGlobais.Instância.Cultura;

            item["dataVencimento"] = entidade.Vencimento.ToShortDateString();

            if (entidade.Valor.ToString("C", cultura).Trim().Length == 0)
                throw new Exception("O valor formatado não pode ser vazio.");

            item["valor"] = entidade.Valor.ToString("C", cultura);
            item["valorExtenso"] = NúmeroExtenso.Transformar((decimal)entidade.Valor);
            Entidades.Pessoa.Pessoa cliente = Entidades.Pessoa.Pessoa.ObterPessoa(entidade.Cliente);

            item["emitenteNome"] = cliente.Nome.ToUpper();

            if (entidade.Venda.HasValue)
                item["venda"] = entidade.Venda.Value.ToString();

            if (cliente is PessoaFísica)
                item["emitenteDocumento"] = ((PessoaFísica)cliente).CPF;
            else if (cliente is PessoaJurídica)
                item["emitenteDocumento"] = ((PessoaJurídica)cliente).CNPJ;

            List<Endereço> endereços = cliente.Endereços.ExtrairElementos();
            if (endereços.Count > 0 && endereços[0].Localidade != null && endereços[0].Logradouro != null)
            {
                Endereço endereço = endereços[0];
                item["emitenteEndereço"] = string.Format("{0}, {1}, {2}", endereço.Logradouro, endereço.Número, endereço.Complemento);
                item["emitenteEndereço"] += " " + endereço.Localidade.Nome + " / " + endereço.Localidade.Estado.Sigla;
            }

            item["dataEmissão"] = entidade.Data.ToShortDateString();

            item["dataVencimentoExtenso"] = (entidade.Vencimento.Day == 1 ? "Ao primeiro dia " : "Aos " +
                ObterDiaMesPorExtenso(entidade.Vencimento.Day).ToLower() + " dias ")
                + "do mês de " + ObterNomeMes(entidade.Vencimento.Month).ToLower() + " do ano de " +
                NúmeroExtenso.Transformar(entidade.Vencimento.Year).ToLower().Replace("reais", "");
            
            return item;
        }
        //protected override Entidades.Relacionamento.Relacionamento CriarEntidade()
        //{
        //    return new Entidades.Relacionamento.Retorno.Retorno();
        //}

        /// <summary>
        /// É a primeiro método chamado nesta base inferior.
        /// Deve ser chamado externamente,
        /// Abre as bandejas e inicia observação.
        /// </summary>
        public override void Abrir(Entidades.Relacionamento.Relacionamento s)
        {
            AguardeDB.Mostrar();
            base.Abrir(s);
            AguardeDB.Fechar();

            Entidades.Relacionamento.Retorno.Retorno retorno = (Entidades.Relacionamento.Retorno.Retorno) s;

            título.Título = retorno.Pessoa.Nome;

            if (retorno.Cadastrado)
                título.Descrição = "Retorno de número " + retorno.Código;
            else
            {
                título.Descrição = "Retorno a ser cadastrado";
                retorno.DepoisDeCadastrar += new Acesso.Comum.DbManipulação.DbManipulaçãoHandler(DepoisDeCadastrar);
            }

            quadroAcerto.Visible = Relacionamento.AcertoConsignado != null && !Relacionamento.AcertoConsignado.Acertado;
        }
        private static void ConstruirHorárioPadrão(Entidades.Pessoa.Funcionário funcionário)
        {
            foreach (DayOfWeek dia in new DayOfWeek[] {
                DayOfWeek.Monday, DayOfWeek.Tuesday,
                DayOfWeek.Wednesday, DayOfWeek.Thursday,
                DayOfWeek.Friday })
            {
                funcionário.TabelaHorário.Adicionar(
                    new Entidades.Pessoa.Horário(
                    funcionário,
                    dia,
                    08, 00,
                    11, 59));

                funcionário.TabelaHorário.Adicionar(
                    new Entidades.Pessoa.Horário(
                    funcionário,
                    dia,
                    13, 00,
                    17, 59));
            }
        }
        /// <summary>
        /// Constrói a janela a partir da venda.
        /// </summary>
        public JanelaCriarPagamentos(Entidades.Relacionamento.Venda.Venda venda)
        {
            InitializeComponent();

            this.venda = venda;

            venda.CalcularDívida(venda.DataCobrança, out dívida, out juros);

            cmbPrestações.Items.Clear();

            //if (((TimeSpan)(DadosGlobais.Instância.HoraDataAtual.Date - venda.Data.Date)).Days == 0)
            //{
            foreach (string parcelamento in DadosGlobais.Instância.Parcelamento)
                cmbPrestações.Items.Add(parcelamento);

            cmbPrestações.SelectedItem = cmbPrestações.Items[0];
            //}
            //else
            //{
            //    cmbPrestações.Enabled = false;
            //    botãoLiberarPrestações.Visible = false;
            //}

            lblValor.Text = venda.Valor.ToString("C");

            if (venda.DescontoPercentual.HasValue && !txtDescontoPercentual.Focused)
                txtDescontoPercentual.Text =
                    string.Format("{0:######0.00}%", venda.DescontoPercentual.Value);

            if (venda.Desconto != 0 && !txtDesconto.Focused)
                txtDesconto.Text = venda.Desconto.ToString("C");

            lblValorComDesconto.Text = string.Format("{0:C}", venda.Valor - venda.Desconto);
            lblPago.Text = venda.CalcularValorPago().ToString("C");
            lblDívida.Text = dívida.ToString("C");
            txtDiasSemJuros.Int = (int)venda.DiasSemJuros;

            AtualizarValores();
        }
        private static void MapearItem(Entidades.PedidoConserto.Pedido pedido, DataRow linha)
        {
            linha["código"] = pedido.Código;

            switch (pedido.TipoPedido)
            {
                case Entidades.PedidoConserto.Pedido.Tipo.Conserto:
                    linha["tipo"] = "Conserto";
                    break;

                case Entidades.PedidoConserto.Pedido.Tipo.Pedido:
                    linha["tipo"] = "Pedido";
                    break;

                default:
                    throw new NotSupportedException();
            }

            if (pedido.Cliente != null)
            {
                List<Entidades.Pessoa.Endereço.Endereço> endereços =
                pedido.Cliente.Endereços.ExtrairElementos();

                string cidade = endereços.Count > 0 ? endereços[0].Localidade != null ? endereços[0].Localidade.Nome + endereços[0].Localidade.Estado != null ? " - " + endereços[0].Localidade.Estado.Sigla : "" : "" : "";
                linha["cliente"] = pedido.Cliente.Nome + " (" + pedido.Cliente.Código.ToString() + ") " + cidade;
            } else
                linha["cliente"] = pedido.NomeDoCliente;
                

            linha["representante"] = pedido.Representante != null ? Entidades.Pessoa.Pessoa.AbreviarNome(pedido.Representante.Nome) : "";
            linha["receptor"] = pedido.Receptor.PrimeiroNome;
            linha["dataRecepção"] = pedido.DataRecepção;
            linha["dataPrevisão"] = pedido.DataPrevisão;
            linha["observações"] = pedido.Observações;
            
            //linha["controle"] = pedido.Controle != null ? pedido.Controle.ToString() : "";
        }
        private static void MapearItem(Entidades.PedidoConserto.Pedido pedido, DataRow linha)
        {
            //linha["código"] = pedido.Controle.HasValue ? pedido.Controle.Value : pedido.Código;
            linha["código"] = pedido.Código;
            linha["tipoPedido"] = pedido.TipoPedido == Entidades.PedidoConserto.Pedido.Tipo.Pedido;

            //List<Entidades.Pessoa.Endereço.Endereço> endereços =
            //pedido.Cliente.Endereços.ExtrairElementos();
            //string cidade = endereços.Count > 0 ? endereços[0].Localidade != null ? endereços[0].Localidade.Nome + endereços[0].Localidade.Estado != null ? " - " + endereços[0].Localidade.Estado.Sigla : "" : "" : "";

            if (pedido.Cliente != null)
            {
                linha["clienteNome"] = pedido.Cliente.Nome;
                linha["clienteCódigo"] = pedido.Cliente.Código.ToString();
                if (pedido.Cliente.Telefones != null && pedido.Cliente.Telefones.ContarElementos() > 0)
                {
                    Telefone primeiroTelefone = pedido.Cliente.Telefones.ExtrairElementos()[0];

                    linha["telefoneCliente"] = string.Format("{0} {1}", primeiroTelefone.Número, primeiroTelefone.Descrição);
                }
            }
            else
            {
                linha["clienteNome"] = pedido.NomeDoCliente;
            }

            
            linha["representanteNome"] = pedido.Representante != null ? pedido.Representante.Nome : "";
            linha["recepçãoFuncionárioNome"] = pedido.Receptor.Nome;
            linha["dataRecepção"] = pedido.DataRecepção.ToShortDateString();
            linha["dataPrevisão"] = pedido.DataPrevisão.ToShortDateString();
            linha["observações"] =  pedido.Observações == null ? "" : pedido.Observações.ToUpper();
            linha["pertenceAoCliente"] = pedido.PertenceAoCliente;
            linha["despachar"] = pedido.EntregaPedido == Entidades.PedidoConserto.Pedido.Entrega.Despachar;
            linha["valor"] = pedido.Valor.ToString("C");
            //linha["controle"] = pedido.Controle != null ? pedido.Controle.ToString() : "";
        }
Example #29
0
        private void AtribuirCotação(Entidades.Financeiro.Cotação cotação)
        {
            if (painelFlutuante == null)
                return;

            if (painelFlutuante.InvokeRequired)
            {
                AtribuirCotaçãoCallback método = new AtribuirCotaçãoCallback(AtribuirCotação);
                painelFlutuante.BeginInvoke(método, cotação);
            }
            else
            {
                txt.Double = cotação.Valor;
                painelFlutuante.CotaçãoSelecionada = cotação;

                if (carregado)
                    DispararEscolheuCotação();
            }
        }
Example #30
0
 public static void AddMessage(Entidades.Message message)
 {
     MessageDAO messageDAO = new MessageDAO();
     messageDAO.AddMessage(message);
 }