Пример #1
0
        protected void Seleccion_onClick(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable table = new DataTable();
            VentaBE venta = new VentaBE();
            try
            {
                string idUbica = ((System.Web.UI.WebControls.RadioButton)sender).Attributes["value"].ToString();
                lblIdUbica.Text = idUbica;
                ((System.Web.UI.WebControls.RadioButton)sender).Checked = false;

                List<Ubicacion_CilindroBE> lstCilCliente = new List<Ubicacion_CilindroBE>(servCliente.ConsultarCilPorCliente(lblIdUbica.Text));
                table.Columns.Add("CodigosCil");
                table.Columns.Add("Tamano");
                table.Columns.Add("TipoCil");

                foreach (Ubicacion_CilindroBE info in lstCilCliente)
                {
                    table.Rows.Add(info.Cilindro.Codigo_Cilindro, info.Cilindro.NTamano.Tamano, info.Cilindro.Tipo_Cilindro);
                }

                gvCargue.DataSource = table;
                gvCargue.DataBind();
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                btnNuevaConsulta.Focus();
                servCliente.Close();
            }
        }
Пример #2
0
        private void btnBuscar_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            servCliente.ConsultarDirCliPorUbicaAsync(txtIdDir.Text);
            servCliente.ConsultarDirCliPorUbicaCompleted += new EventHandler <ConsultarDirCliPorUbicaCompletedEventArgs>(ModificarDireccion);
        }
Пример #3
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            ClienteBE cliente = new ClienteBE();


                cliente.Cedula = lblCedulaCli.Text;
                cliente.Nombres_Cliente = txtNombres.Text.ToUpper();
                cliente.Apellido_1 = txtPrApellido.Text.ToUpper();
                cliente.Apellido_2 = txtSgApellido.Text.ToUpper();

                UbicacionBE ubicacion = new UbicacionBE();
                ubicacion.Direccion = txtDir.Text.ToUpper();
                ubicacion.Barrio = txtBarrio.Text.ToUpper();
                ubicacion.Telefono_1 = txtTel.Text;
                CiudadBE ciudad = new CiudadBE();
                ciudad.Id_Ciudad = "231";
                ubicacion.Ciudad = ciudad;                          
                cliente.Ubicacion = ubicacion;

            
            servCliente.Registrar_ClienteAsync(cliente);
            servCliente.Registrar_ClienteCompleted += new EventHandler<Registrar_ClienteCompletedEventArgs>(RegistrarCliente);
            servCliente.CloseAsync();
        }
Пример #4
0
        protected void txtCedulaCli_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long resp;

            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedulaCli.Text);

                if (resp != 0)
                {
                    MessageBox.Show("La cédula del cliente ya se encuentra registrada en el sistema", "Modificar Cliente");
                }
                else
                {
                    txtCedulaCli.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
            }
        }
Пример #5
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try
            {
                ClienteServiceClient service = new ClienteServiceClient();

                Cliente cliente  = service.Buscar(nome);
                if (cliente != null)
                {
                    txtCpf.Text = cliente.CPF;

                }
                else
                {
                    MessageBox.Show("Cliente não encontrado");
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
        }
Пример #6
0
        private void btnGuardarModif_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            ClienteBE cliente = new ClienteBE();

            cliente.Cedula          = lblCedulaCli2.Text;
            cliente.Nombres_Cliente = txtNombres2.Text.ToUpper();
            cliente.Apellido_1      = txtPrApellido2.Text.ToUpper();
            cliente.Apellido_2      = txtSgApellido2.Text.ToUpper();

            UbicacionBE ubi = new UbicacionBE();

            if (Convert.ToBoolean(lblDireccion.Visibility == System.Windows.Visibility.Visible))
            {
                ubi.Id_Ubicacion     = lblIdDir.Text;
                ubi.Direccion        = txtDir.Text.ToUpper();
                ubi.Barrio           = txtBarrio.Text.ToUpper();
                ubi.Telefono_1       = txtTel.Text.ToUpper();
                ubi.Ciudad.Id_Ciudad = "231";

                btnGuardarModif.Margin = new Thickness(19, 643, 0, 0);
                btnMenuConsul.Margin   = new Thickness(224, 643, 0, 0);

                servCliente.ModificarDirClienteAsync(ubi);
                servCliente.ModificarDirClienteCompleted += new EventHandler <ModificarDirClienteCompletedEventArgs>(ModificarUbicacion);
            }

            servCliente.ModificarNombreClienteAsync(cliente);
            servCliente.ModificarNombreClienteCompleted += new EventHandler <ModificarNombreClienteCompletedEventArgs>(ModificarCliente);

            servCliente.CloseAsync();
        }
Пример #7
0
 private void btnRegistrar_Click(object sender, RoutedEventArgs e)
 {
  
     ClienteServiceClient servCliente = new ClienteServiceClient();
     servCliente.Consultar_ClienteAsync(txtCedula.Text);
     servCliente.Consultar_ClienteCompleted += new EventHandler<Consultar_ClienteCompletedEventArgs>(ConsultarCliente);
 }
Пример #8
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long resp;

            try
            {
                ClienteBE cliente = new ClienteBE();

                UbicacionBE ubi = new UbicacionBE();
                ubi.Direccion     = txtNuevaDireccion.Text;
                ubi.Barrio        = txtNuevoBarrio.Text;
                ubi.Telefono_1    = txtTelefono.Text;
                cliente.Ubicacion = ubi;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Id_Ciudad = lstCiudad.SelectedValue;
                ubi.Ciudad       = ciucli;

                cliente.Cedula = lblCedula.Text;

                resp = servCliente.Agregar_Ubicacion(cliente);

                MessageBox.Show("La nueva ubicación fue registrada satisfactoriamente", "Registrar Nueva Ubicación");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                Response.Redirect("~/Clientes/frmModificarCliente.aspx");
            }
        }
Пример #9
0
        static void Main()
        {
            var proxy = new ClienteServiceClient();

            var c = proxy.GetById(1);

            if (c != null)
            {
                Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);
            }

            c = proxy.GetById(10);
            if (c != null)
            {
                Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);
            }

            c = proxy.GetById(10000);
            if (c != null)
            {
                Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);
            }

            Console.WriteLine();

            var generos = proxy.GetTop10();

            foreach (var item in generos)
            {
                Console.WriteLine("{0} -> {1}", item.CustomerID, item.FirstName);
            }

            Console.ReadKey();
        }
Пример #10
0
        protected void Seleccion_onClick(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable            table       = new DataTable();
            VentaBE venta = new VentaBE();

            try
            {
                string idUbica = ((System.Web.UI.WebControls.RadioButton)sender).Attributes["value"].ToString();
                lblIdUbica.Text = idUbica;
                ((System.Web.UI.WebControls.RadioButton)sender).Checked = false;

                List <Ubicacion_CilindroBE> lstCilCliente = new List <Ubicacion_CilindroBE>(servCliente.ConsultarCilPorCliente(lblIdUbica.Text));
                table.Columns.Add("CodigosCil");
                table.Columns.Add("Tamano");
                table.Columns.Add("TipoCil");

                foreach (Ubicacion_CilindroBE info in lstCilCliente)
                {
                    table.Rows.Add(info.Cilindro.Codigo_Cilindro, info.Cilindro.NTamano.Tamano, info.Cilindro.Tipo_Cilindro);
                }

                gvCargue.DataSource = table;
                gvCargue.DataBind();
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                btnNuevaConsulta.Focus();
                servCliente.Close();
            }
        }
Пример #11
0
 private void btnConsultar_Click(object sender, RoutedEventArgs e)
 {
     ClienteServiceClient servCliente = new ClienteServiceClient();
     servCliente.Consultar_ClienteAsync(txtCedula.Text);
     servCliente.Consultar_ClienteCompleted += new EventHandler<Consultar_ClienteCompletedEventArgs>(PoblarCliente);
     servCliente.CloseAsync();
 }
Пример #12
0
        private void btnGuardarModif_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            ClienteBE cliente = new ClienteBE();

            cliente.Cedula = lblCedulaCli2.Text;
            cliente.Nombres_Cliente = txtNombres2.Text.ToUpper();
            cliente.Apellido_1 = txtPrApellido2.Text.ToUpper();
            cliente.Apellido_2 = txtSgApellido2.Text.ToUpper();

            UbicacionBE ubi = new UbicacionBE();

            if (Convert.ToBoolean(lblDireccion.Visibility == System.Windows.Visibility.Visible))
            {
                ubi.Id_Ubicacion = lblIdDir.Text;
                ubi.Direccion = txtDir.Text.ToUpper();
                ubi.Barrio = txtBarrio.Text.ToUpper();
                ubi.Telefono_1 = txtTel.Text.ToUpper();
                ubi.Ciudad.Id_Ciudad = "231";

                btnGuardarModif.Margin = new Thickness(19, 643, 0, 0);
                btnMenuConsul.Margin = new Thickness(224, 643, 0, 0);

                servCliente.ModificarDirClienteAsync(ubi);
                servCliente.ModificarDirClienteCompleted += new EventHandler<ModificarDirClienteCompletedEventArgs>(ModificarUbicacion);
            }

            servCliente.ModificarNombreClienteAsync(cliente);
            servCliente.ModificarNombreClienteCompleted += new EventHandler<ModificarNombreClienteCompletedEventArgs>(ModificarCliente);

            servCliente.CloseAsync();
        }
Пример #13
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long resp;

            try
            {
                ClienteBE cliente = new ClienteBE();

                UbicacionBE ubi = new UbicacionBE();
                ubi.Direccion = txtNuevaDireccion.Text;
                ubi.Barrio = txtNuevoBarrio.Text;
                ubi.Telefono_1 = txtTelefono.Text;
                cliente.Ubicacion = ubi;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Id_Ciudad = lstCiudad.SelectedValue;
                ubi.Ciudad = ciucli;

                cliente.Cedula = lblCedula.Text;

                resp = servCliente.Agregar_Ubicacion(cliente);

                MessageBox.Show("La nueva ubicación fue registrada satisfactoriamente", "Registrar Nueva Ubicación");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                Response.Redirect("~/Clientes/frmModificarCliente.aspx");
            }
        }
Пример #14
0
        static void Main(string[] args)
        {
            var svc = new ClienteServiceClient();

            Console.WriteLine("Inicio del cliente");
            Console.WriteLine("Crea el objeto nuevo");

            var nuevoCliente = new Clientes
            {
                IDCliente = 99,
                Nombre = "Municipalidad de Parana",
                IDContacto = 1,
                Web = "www.parana.gov.ar",
                Calle = "Calle",
                Numero = "1",
                Pais = "Ninguno",
                Departamento = "Depto",
                Telefono = "00101000",
                Cuidad = "Parana",
                Provincia = "Entre Ríos",
                Piso = "Piso"
            };

            var nuevoCliID = svc.InsertarCliente(nuevoCliente);

            Console.WriteLine("Nuevo Cliente ID:" + nuevoCliente);
            Clientes Cli = svc.GetCliente(nuevoCliID);

            Console.WriteLine("Nuevo Cliente Nombre:" + Cli.Nombre);
            Cli.Calle = "Monte Caseros";

            Clientes actCli = svc.ActualizarCliente(Cli);

            Console.ReadKey();
        }
Пример #15
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable            table       = new DataTable();
            long resp;

            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Modificar Cliente");
                    divInfoCliente.Visible = false;
                    txtCedula.Text         = "";
                    txtCedula.Focus();
                    btnGuardar.Visible = false;
                }
                else
                {
                    ClienteBE consulta = servCliente.Consultar_Cliente(txtCedula.Text);

                    txtCedulaCli.Text       = consulta.Cedula;
                    lblIdCliente.Text       = consulta.Id_Cliente;
                    txtNombreCliente.Text   = consulta.Nombres_Cliente;
                    txtPrimerApellido.Text  = consulta.Apellido_1;
                    txtSegundoApellido.Text = consulta.Apellido_2;

                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in consulta.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                        objdtTabla.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                    }
                    gvDirecciones.DataSource = table;
                    gvDirecciones.DataBind();
                    divInfoCliente.Visible    = true;
                    divDireccionesCli.Visible = true;
                    divNuevaDir.Visible       = true;
                    txtCedula.Text            = "";
                    txtCedula.Enabled         = false;
                    divNuevaDir.Visible       = true;
                    gvDirecciones.Focus();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
            }
        }
Пример #16
0
        protected void txtCedulaCliente_TextChanged(object sender, EventArgs e)
        {
            VentaServiceClient serVenta = new VentaServiceClient();
            ClienteServiceClient serCliente = new ClienteServiceClient();

            try
            {
                DataTable table = new DataTable();
                long consultarExistencia = serVenta.ConsultarExistenciaVenta(txtCedulaCliente.Text);

                if (consultarExistencia == 0)
                {
                    MessageBox.Show("El cliente no tiene asignado ninguna venta reciente", "Consultar Venta");
                }
                else
                {
                    VentaBE datosVenta = serVenta.ConsultarVenta(txtCedulaCliente.Text);

                    txtFecha.Text = Convert.ToString(datosVenta.Fecha);
                    txtHora.Text = Convert.ToString(datosVenta.Fecha.TimeOfDay);
                    txtObservacion.Text = datosVenta.Observaciones;

                    ClienteBE cliente = serCliente.Consultar_Cliente(txtCedulaCliente.Text);

                    txtCedula2.Text = cliente.Cedula;
                    lblIdCliente.Text = cliente.Id_Cliente;
                    txtNombreCliente.Text = cliente.Nombres_Cliente + " " + cliente.Apellido_1 + " " + cliente.Apellido_2;

                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in cliente.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);

                    }
                    gvDirecciones.DataSource = table;
                    gvDirecciones.DataBind();
                    divDirCliente.Visible = true;
                    divInfoCilindro.Visible = true;
                    DivInfoVenta.Visible = true;
                    btnNuevaConsulta.Visible = true;
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serVenta.Close();
                txtCedulaCliente.Text = "";
                txtCodVenta.Text = "";
            }
        }
Пример #17
0
        private void hplModificarCliente_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            servCliente.Consultar_ClienteAsync(lblCedulaCli.Text);
            servCliente.Consultar_ClienteCompleted += new EventHandler <Consultar_ClienteCompletedEventArgs>(ModificarCli);
            servCliente.CloseAsync();
        }
Пример #18
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            ClienteServiceClient servico = new ClienteServiceClient();
            Cliente clienteBusca         = servico.Buscar(nome);

            txtCPF.Text = clienteBusca.Cpf;
        }
Пример #19
0
        protected void txtCedulaCliente_TextChanged(object sender, EventArgs e)
        {
            VentaServiceClient   serVenta   = new VentaServiceClient();
            ClienteServiceClient serCliente = new ClienteServiceClient();

            try
            {
                DataTable table = new DataTable();
                long      consultarExistencia = serVenta.ConsultarExistenciaVenta(txtCedulaCliente.Text);

                if (consultarExistencia == 0)
                {
                    MessageBox.Show("El cliente no tiene asignado ninguna venta reciente", "Consultar Venta");
                }
                else
                {
                    VentaBE datosVenta = serVenta.ConsultarVenta(txtCedulaCliente.Text);

                    txtFecha.Text       = Convert.ToString(datosVenta.Fecha);
                    txtHora.Text        = Convert.ToString(datosVenta.Fecha.TimeOfDay);
                    txtObservacion.Text = datosVenta.Observaciones;

                    ClienteBE cliente = serCliente.Consultar_Cliente(txtCedulaCliente.Text);

                    txtCedula2.Text       = cliente.Cedula;
                    lblIdCliente.Text     = cliente.Id_Cliente;
                    txtNombreCliente.Text = cliente.Nombres_Cliente + " " + cliente.Apellido_1 + " " + cliente.Apellido_2;

                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in cliente.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                    }
                    gvDirecciones.DataSource = table;
                    gvDirecciones.DataBind();
                    divDirCliente.Visible    = true;
                    divInfoCilindro.Visible  = true;
                    DivInfoVenta.Visible     = true;
                    btnNuevaConsulta.Visible = true;
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serVenta.Close();
                txtCedulaCliente.Text = "";
                txtCodVenta.Text      = "";
            }
        }
Пример #20
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient serCliente = new ClienteServiceClient();
            DataTable table = new DataTable();

            try
            {
                long consultaExistencia = serCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (consultaExistencia == 0)
                {
                    MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Consulta de Clientes");
                    divInfoCliente.Visible = false;
                    btnNuevaConsulta.Visible = false;
                    txtCedula.Text = "";
                    txtCedula.Focus();
                }
                else
                {
                    txtCedula.Enabled = false;
                    ClienteBE consulta = serCliente.Consultar_Cliente(txtCedula.Text);
                    txtCedulaCli.Text = consulta.Cedula;
                    txtNombreCliente.Text = consulta.Nombres_Cliente;
                    txtPrimerApellido.Text = consulta.Apellido_1;
                    txtSegundoApellido.Text = consulta.Apellido_2;

                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in consulta.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                    }
                    gvDirecciones.DataSource = table;
                    gvDirecciones.DataBind();

                    divInfoCliente.Visible = true;
                    divDireccionesCli.Visible = true;
                    btnNuevaConsulta.Visible = true;
                    txtCedula.Text = "";
                    btnNuevaConsulta.Focus();

                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serCliente.Close();

            }
        }
Пример #21
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient serCliente = new ClienteServiceClient();
            DataTable            table      = new DataTable();

            try
            {
                long consultaExistencia = serCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (consultaExistencia == 0)
                {
                    MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Consulta de Clientes");
                    divInfoCliente.Visible = false;
                    txtCedula.Text         = "";
                    txtCedula.Focus();
                }
                else
                {
                    ClienteBE cliente = serCliente.Consultar_Cliente(txtCedula.Text);

                    txtCedulaCliente.Text = cliente.Cedula;
                    lblIdCliente.Text     = cliente.Id_Cliente;
                    txtNombreCliente.Text = cliente.Nombres_Cliente + " " + cliente.Apellido_1 + " " + cliente.Apellido_2;

                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in cliente.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                        gvDirecciones.DataSource = table;
                        gvDirecciones.DataBind();
                    }
                    gvDirecciones.Visible  = true;
                    divDirCliente.Visible  = true;
                    divInfoCliente.Visible = true;
                    txtCedula.Text         = "";
                    txtNumPedido.Text      = "";
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serCliente.Close();
                divInfoCliente.Focus();
            }
        }
Пример #22
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf = txtCpf.Text;

            ClienteServiceClient servico = new ClienteServiceClient();

            servico.Add(nome, cpf);

            MessageBox.Show("Cliente Cadastrado com Sucesso");
        }
Пример #23
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            ClienteServiceClient servico = new ClienteServiceClient();

            servico.Add(nome, cpf);

            MessageBox.Show("Cliente Cadastrado com Sucesso");
        }
Пример #24
0
        static void Main(string[] args)
        {
            c = new ClienteServiceClient();

            c.BeginGetTop10(GetTop10Completed, null);

            c.BeginGetById(1, GetByIdCompleted, null);
            c.BeginGetById(10, GetByIdCompleted, null);
            c.BeginGetById(100, GetByIdCompleted, null);

            Console.ReadKey();
        }
Пример #25
0
 private void button1_Click(object sender, EventArgs e)
 {
     //listar
     //abrimos um canal de comunicacao com o serviço
     //inicializamos o serviço(palavra client)
     using (var servico = new ClienteServiceClient())
     {
         //Chamamos o comando lista
         var resposta = servico.Listar(new RequestClienteDTO());
         dataGridView1.DataSource = resposta.Clientes;
     }
 }
Пример #26
0
        static void Main(string[] args)
        {
            c = new ClienteServiceClient();

            c.BeginGetTop10(GetTop10Completed, null);

            c.BeginGetById(1, GetByIdCompleted, null);
            c.BeginGetById(10, GetByIdCompleted, null);
            c.BeginGetById(100, GetByIdCompleted, null);

            Console.ReadKey();
        }
Пример #27
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try{
                ClienteServiceClient servico = new ClienteServiceClient();

                Cliente resultado = servico.Buscar(nome);

                txtCpf.Text = resultado.Cpf;
            }catch (Exception ex) {
                MessageBox.Show("Erro" + ex);
            }
        }
Пример #28
0
Файл: Form1.cs Проект: pgori/wcf
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try
            {
                ClienteServiceClient servico = new ClienteServiceClient();
                var cliente = servico.Buscar(nome);
                txtCpf.Text = cliente.Cpf;
            }
            catch (Exception)
            {
            }
        }
Пример #29
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try
            {
                ClienteServiceClient servico = new ClienteServiceClient();
                Cliente resultado            = servico.Buscar(nome);
                txtCpf.Text = resultado.Cpf;
            }
            catch (Exception)
            {
                // salva um log
            }
        }
Пример #30
0
        private void button2_Click(object sender, EventArgs e)
        {
            //cadastrar
            using (var servico = new ClienteServiceClient())
            {
                var pedido = new RequestClienteDTO();
                pedido.Cliente = new ClienteDTO
                {
                    Nome  = "AAA",
                    Email = "*****@*****.**"
                };

                var resposta = servico.Cadastrar(pedido);
            }
        }
Пример #31
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try
            {
                var servico   = new ClienteServiceClient();
                var resultado = servico.Buscar(nome);
                txtCpf.Text = resultado.Cpf;
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #32
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try
            {
                ClienteServiceClient servico = new ClienteServiceClient();
                var resultado = servico.GetCliente(nome);
                txtCpf.Text = resultado.Cpf;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #33
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;

            try{
                ClienteServiceClient servico = new ClienteServiceClient();

                Cliente resultado = servico.Buscar(nome);

                txtCpf.Text = resultado.Cpf;

            }catch(Exception ex) {
                MessageBox.Show("Erro" + ex);
            }
        }
Пример #34
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            var nome = txtNome.Text;

            try
            {
                var service = new ClienteServiceClient();
                var cliente = service.Buscar(nome);
                txtCpf.Text = cliente.Cpf;
            }
            catch (Exception)
            {
                MessageBox.Show("Ocorreu um erro ao buscar o cliente");
                throw;
            }
        }
Пример #35
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCPF.Text;

            ClienteServiceClient servico = new ClienteServiceClient();
            Cliente cliente = new Cliente
            {
                Nome = nome,
                Cpf  = cpf
            };

            servico.Add(cliente);

            MessageBox.Show("Cliente Cadastrado");
            MessageBox.Show("Cliente Cadastrado");
        }
Пример #36
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            try
            {
                var service = new ClienteServiceClient();
                var cliente = new Cliente();
                cliente.CPF = txtCPF.Text;
                cliente.Nome = txtNome.Text;
                service.Add(cliente);

                MessageBox.Show("Cliente adicionado com sucesso!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #37
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long      respCliente;
            long      respUbicacion;
            ClienteBE cliente = new ClienteBE();

            try
            {
                cliente.Nombres_Cliente = txtNombreCliente.Text;
                cliente.Apellido_1      = txtPrimerApellido.Text;
                cliente.Apellido_2      = txtSegundoApellido.Text;
                cliente.Cedula          = txtCedulaCli.Text;

                respCliente = servCliente.ModificarNombreCliente(cliente);

                if (txtDireccion.Text != "")
                {
                    UbicacionBE ubica = new UbicacionBE();

                    ubica.Id_Ubicacion = lblIdUbica.Text;
                    ubica.Direccion    = txtDireccion.Text;
                    ubica.Barrio       = txtBarrio.Text;
                    ubica.Telefono_1   = txtTelefono.Text;
                    CiudadBE ciudad = new CiudadBE();
                    ciudad.Id_Ciudad = lstCiudad.SelectedValue;
                    ubica.Ciudad     = ciudad;

                    respUbicacion = servCliente.ModificarDirCliente(ubica);
                }

                MessageBox.Show("El cliente fue modificado satisfactoriamente", "Modificar Cliente");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }

            finally
            {
                servCliente.Close();
                Response.Redirect("~/Clientes/frmModificarCliente.aspx");
                txtCedula.Focus();
            }
        }
Пример #38
0
        private void ConsultarCliente(object sender, Consultar_ClienteCompletedEventArgs e)
         {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            try
            {
                if (e.Result.Cedula != null)
                {
                    MessageBox.Show("El cliente ya se encuentra registrado");
                    NavigationService.Navigate(new Uri("/Clientes/frmRegistrarCliente.xaml", UriKind.Relative));
                }
                else
                {
                    
                    txtNombres.Focus();
                    lblCedulaCli.Text = txtCedula.Text;


                    txtNombres.Text = "";
                    txtPrApellido.Text = "";
                    txtSgApellido.Text = "";
                    txtDir.Text = "";
                    txtBarrio.Text = "";
                    txtTel.Text = "";
                    
                    ContentBusq.Visibility = System.Windows.Visibility.Collapsed;
                    ContentDatosP.Visibility = System.Windows.Visibility.Visible;
                    txtNombres.Focus();
                }
                txtCedula.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error en el sistema");
                
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

            }
            finally
            {
                servCliente.CloseAsync();
            }
           
        }
Пример #39
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long resp;

            ClienteBE cliente = new ClienteBE();

            try
            {
                cliente.Cedula          = txtCedulaCli.Text;
                cliente.Nombres_Cliente = txtNombreCliente.Text;
                cliente.Apellido_1      = txtPrimerApellido.Text;
                cliente.Apellido_2      = txtSegundoApellido.Text;

                UbicacionBE ubicacion = new UbicacionBE();
                ubicacion.Direccion  = txtDireccion.Text;
                ubicacion.Barrio     = txtBarrio.Text;
                ubicacion.Telefono_1 = txtTelefono.Text;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Id_Ciudad  = lstCiudad.SelectedValue;
                ubicacion.Ciudad  = ciucli;
                cliente.Ubicacion = ubicacion;
                resp = servCliente.Registrar_Cliente(cliente);
                if (resp != -1)
                {
                    MessageBox.Show("El cliente fue registrado satisfactoriamente", "Registrar Cliente");
                }
                else
                {
                    Response.Redirect("~/About.aspx");
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                Response.Redirect("~/Clientes/frmRegistrarCliente.aspx");
            }
        }
Пример #40
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            long resp;

            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (resp != 0)
                {
                    MessageBox.Show("El cliente ya se encuentra registrado en el sistema", "Registrar Cliente");
                    divInfoCliente.Visible  = false;
                    txtCedulaCli.Text       = "";
                    txtBarrio.Text          = "";
                    txtCedula.Text          = "";
                    txtDireccion.Text       = "";
                    txtNombreCliente.Text   = "";
                    txtPrimerApellido.Text  = "";
                    txtSegundoApellido.Text = "";
                    txtTelefono.Text        = "";
                    btnGuardar.Visible      = false;
                    txtCedula.Focus();
                }
                else
                {
                    divInfoCliente.Visible = true;
                    btnGuardar.Visible     = true;
                    txtNombreCliente.Focus();
                    txtCedulaCli.Text = txtCedula.Text;
                    txtCedula.Text    = "";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
            }
        }
Пример #41
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            try {
                ClienteServiceClient servico = new ClienteServiceClient();
                Cliente clienteCadastro      = new Cliente();
                clienteCadastro.Nome = nome;
                clienteCadastro.Cpf  = cpf;
                servico.Add(clienteCadastro);

                MessageBox.Show("Cliente cadastrado com sucesso");
            }
            catch (Exception)
            {
                //salvaria um log
            }
        }
Пример #42
0
Файл: Form1.cs Проект: pgori/wcf
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            try
            {
                ClienteServiceClient service = new ClienteServiceClient();
                Cliente cliente = new Cliente();
                cliente.Nome = nome;
                cliente.Cpf  = cpf;
                service.Add(cliente);

                MessageBox.Show("Cliente Cadastrado Com Sucesso");
            }
            catch (Exception)
            {
            }
        }
Пример #43
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            long resp;

            ClienteBE cliente = new ClienteBE();

            try
            {
                cliente.Cedula = txtCedulaCli.Text;
                cliente.Nombres_Cliente = txtNombreCliente.Text;
                cliente.Apellido_1 = txtPrimerApellido.Text;
                cliente.Apellido_2 = txtSegundoApellido.Text;

                UbicacionBE ubicacion = new UbicacionBE();
                ubicacion.Direccion = txtDireccion.Text;
                ubicacion.Barrio = txtBarrio.Text;
                ubicacion.Telefono_1 = txtTelefono.Text;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Id_Ciudad = lstCiudad.SelectedValue;
                ubicacion.Ciudad = ciucli;
                cliente.Ubicacion = ubicacion;
                resp = servCliente.Registrar_Cliente(cliente);
                if (resp != -1)
                {
                    MessageBox.Show("El cliente fue registrado satisfactoriamente", "Registrar Cliente");
                }
                else
                {
                    Response.Redirect("~/About.aspx");
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                Response.Redirect("~/Clientes/frmRegistrarCliente.aspx");
            }
        }
Пример #44
0
        private void ConsultarCliente(object sender, Consultar_ClienteCompletedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            try
            {
                if (e.Result.Cedula != null)
                {
                    MessageBox.Show("El cliente ya se encuentra registrado");
                    NavigationService.Navigate(new Uri("/Clientes/frmRegistrarCliente.xaml", UriKind.Relative));
                }
                else
                {

                    txtNombres.Focus();
                    lblCedulaCli.Text = txtCedula.Text;

                    txtNombres.Text = "";
                    txtPrApellido.Text = "";
                    txtSgApellido.Text = "";
                    txtDir.Text = "";
                    txtBarrio.Text = "";
                    txtTel.Text = "";

                    ContentBusq.Visibility = System.Windows.Visibility.Collapsed;
                    ContentDatosP.Visibility = System.Windows.Visibility.Visible;
                    txtNombres.Focus();
                }
                txtCedula.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error en el sistema");

                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

            }
            finally
            {
                servCliente.CloseAsync();
            }
        }
Пример #45
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                var service = new ClienteServiceClient();
                var result = service.Search(txtNome.Text);

                if (result != null)
                {
                    txtCPF.Text = result.CPF;
                }
                else
                {
                    MessageBox.Show("Cliente não encontrado");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #46
0
        private void button4_Click(object sender, EventArgs e)
        {
            var svc = new ClienteServiceClient();

            var nuevoCliente = new Clientes
            {
                IDCliente = Convert.ToInt32(textBox1.Text),
                Nombre = textBox2.Text,
                IDContacto = Convert.ToInt32(textBox3.Text),
                Calle = textBox4.Text,
                Numero = textBox5.Text,
                Piso = textBox6.Text,
                Departamento = textBox7.Text,
                Cuidad = textBox8.Text,
                Provincia = textBox9.Text,
                Pais = textBox10.Text,
                Telefono = textBox11.Text,
                Web = textBox12.Text
            };
            var nuevoCliID = svc.InsertarCliente(nuevoCliente);

            MessageBox.Show("Cliente Agregado");
        }
Пример #47
0
        static void Main()
        {
            var proxy = new ClienteServiceClient();

            var c = proxy.GetById(1);
            if (c != null) Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);

            c = proxy.GetById(10);
            if (c != null) Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);

            c = proxy.GetById(10000);
            if (c != null) Console.WriteLine("{0} -> {1}", c.CustomerID, c.FirstName);

            Console.WriteLine();

            var generos = proxy.GetTop10();

            foreach (var item in generos)
            {
                Console.WriteLine("{0} -> {1}", item.CustomerID, item.FirstName);
            }

            Console.ReadKey();
        }
Пример #48
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            ClienteBE cliente = new ClienteBE();

                cliente.Cedula = lblCedulaCli.Text;
                cliente.Nombres_Cliente = txtNombres.Text.ToUpper();
                cliente.Apellido_1 = txtPrApellido.Text.ToUpper();
                cliente.Apellido_2 = txtSgApellido.Text.ToUpper();

                UbicacionBE ubicacion = new UbicacionBE();
                ubicacion.Direccion = txtDir.Text.ToUpper();
                ubicacion.Barrio = txtBarrio.Text.ToUpper();
                ubicacion.Telefono_1 = txtTel.Text;
                CiudadBE ciudad = new CiudadBE();
                ciudad.Id_Ciudad = "231";
                ubicacion.Ciudad = ciudad;
                cliente.Ubicacion = ubicacion;

            servCliente.Registrar_ClienteAsync(cliente);
            servCliente.Registrar_ClienteCompleted += new EventHandler<Registrar_ClienteCompletedEventArgs>(RegistrarCliente);
            servCliente.CloseAsync();
        }
Пример #49
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf = txtCpf.Text;

            try
            {
                ClienteServiceClient service = new ClienteServiceClient();
                Cliente cliente = new Cliente();

                cliente.Nome = nome;
                cliente.CPF = cpf;

                if (service.Salvar(cliente))
                {
                    MessageBox.Show("Cliente cadastrado com sucesso!");
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
        }
Пример #50
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            DataTable tabla = new DataTable();
            VentaBE venta = new VentaBE();
            DataTable tabla2 = new DataTable();

            try
            {
                List<Ubicacion_CilindroBE> lstCilVehiculos = new List<Ubicacion_CilindroBE>(servVehiculo.ConsultarCilPorVehiculo("5"));
                List<Ubicacion_CilindroBE> lstCilCliente = new List<Ubicacion_CilindroBE>(servCliente.ConsultarCilPorCliente(lblIdUbica.Text));
                tabla.Columns.Add("CodigosCilVehiculo");
                tabla2.Columns.Add("CodigosCilCliente");

                if (lstCilVehiculos.Count == 0)
                {
                    MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                    divCilSiembra.Visible = false;
                    divDatosConsulta.Visible = false;
                    btnGuardar.Visible = false;
                }
                else
                {
                    foreach (Ubicacion_CilindroBE datos in lstCilVehiculos)
                    {
                        if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                        {
                            tabla.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                            listaCilVeh.Add(datos.Cilindro.Codigo_Cilindro);
                            btnGuardar.Visible = true;
                        }
                        else
                        {
                            MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                            divCilSiembra.Visible = false;
                            divDatosConsulta.Visible = false;
                            btnGuardar.Visible = false;
                        }
                    }
                }
                Session["Vehiculo"] = listaCilVeh;
                gvCilVehiculo.DataSource = tabla;
                gvCilVehiculo.DataBind();

                    foreach (Ubicacion_CilindroBE datos in lstCilCliente)
                    {
                        if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                        {
                            tabla2.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                            listaCilCli.Add(datos.Cilindro.Codigo_Cilindro);
                        }
                    }
                    Session["Cliente"] = listaCilCli;
                    gdCodClientes.DataSource = tabla2;
                    gdCodClientes.DataBind();
                    gdCilSelecCliente.Visible = true;
                    gdCodClientes.Visible = true;
                    gvCilVehiculo.Visible = true;
                    gvSeleccion.Visible = true;
                    btnQuitar.Visible = true;
                    btnQuitar2.Visible = true;
                    btnSeleccionar.Visible = true;
                    btnSelect.Visible = true;
                    divDatosConsulta.Visible = true;
                    if (tabla2.Rows.Count == 0)
                    {
                        divCilSiembra.Visible = true;
                        btnQuitar2.Visible = false;
                        btnSelect.Visible = false;
                        gdCilSelecCliente.Visible = false;
                        gdCodClientes.Visible = false;
                    }

            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVehiculo.Close();
                gdCilSelecCliente.Focus();
            }
        }
Пример #51
0
        private void PoblarCilindro(object sender, ConsultarCilindroCompletedEventArgs e)
        {
            try
            {
                if (e.Result.Codigo_Cilindro == null)
                {
                    MessageBox.Show("El cilindro no se encuentra registrado");
                    NavigationService.Navigate(new Uri("/Ventas/frmConsultaCilindro.xaml", UriKind.Relative));
                }
                else
                {

                    lblCilindro.Text = e.Result.Codigo_Cilindro;
                    txtAnoFab.Text = e.Result.Ano;
                    txtCodEmpresa.Text = e.Result.Fabricante.Nombre_Fabricante;
                    txtCodigoCil.Text = e.Result.Serial_Cilindro;
                    txtTamano.Text = e.Result.NTamano.Tamano;
                    txtUbicacion.Text = e.Result.Tipo_Ubicacion.Nombre_Ubicacion.ToUpper();
                    txtFecha.Text = Convert.ToString(e.Result.Fecha);

                    ContentBusq.Visibility = System.Windows.Visibility.Collapsed;
                    ContentCil.Visibility = System.Windows.Visibility.Visible;

                    if (txtUbicacion.Text == "VEHICULO")
                    {
                        txtPlaca.Text = e.Result.Vehiculo.Placa;
                        txtNomCond.Text = e.Result.Vehiculo.Conductor.Nombres_Conductor.ToUpper();
                        txtApellidosCond.Text = e.Result.Vehiculo.Conductor.Apellido_1 + " " + e.Result.Vehiculo.Conductor.Apellido_2.ToUpper();
                        txtRuta.Text = e.Result.Vehiculo.Ruta.Nombre_Ruta.ToUpper();
                        btnContinuarDatos.Visibility = System.Windows.Visibility.Visible;
                        btnConsultaNueva.Visibility = System.Windows.Visibility.Collapsed;
                    }

                    else if (txtUbicacion.Text == "CLIENTE")
                    {
                        txtCedula.Text = e.Result.Cliente.Cedula;
                        txtNombres.Text = e.Result.Cliente.Nombres_Cliente.ToUpper();
                        txtPrApellido.Text = e.Result.Cliente.Apellido_1.ToUpper();
                        txtSgApellido.Text = e.Result.Cliente.Apellido_2.ToUpper();
                        txtDir.Text = e.Result.Ubicacion.Direccion.ToUpper();
                        txtBarrio.Text = e.Result.Ubicacion.Barrio.ToUpper();
                        txtDepartamento.Text = e.Result.Ubicacion.Ciudad.Departamento.Nombre_Departamento;
                        txtCiudad.Text = e.Result.Ubicacion.Ciudad.Nombre_Ciudad;
                        txtTel.Text = e.Result.Ubicacion.Telefono_1;
                        btnContinuarDatos.Visibility = System.Windows.Visibility.Visible;
                        btnConsultaNueva.Visibility = System.Windows.Visibility.Collapsed;
                    }

                    txtCedula.Text = "";

                    ClienteServiceClient serCliente = new ClienteServiceClient();
                    serCliente.Consultar_ClienteAsync(txtCedula.Text);
                    serCliente.Consultar_ClienteCompleted += new EventHandler<Consultar_ClienteCompletedEventArgs>(PoblarCliente);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error en el sistema");
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }
            finally
            {

            }
        }
Пример #52
0
 private void btnBuscar_Click(object sender, RoutedEventArgs e)
 {
     ClienteServiceClient servCliente = new ClienteServiceClient();
     servCliente.ConsultarDirCliPorUbicaAsync(txtIdDir.Text);
     servCliente.ConsultarDirCliPorUbicaCompleted += new EventHandler<ConsultarDirCliPorUbicaCompletedEventArgs>(ModificarDireccion);
 }
Пример #53
0
 private void hplModificarCliente_Click(object sender, RoutedEventArgs e)
 {
     ClienteServiceClient servCliente = new ClienteServiceClient();
     servCliente.Consultar_ClienteAsync(lblCedulaCli.Text);
     servCliente.Consultar_ClienteCompleted += new EventHandler<Consultar_ClienteCompletedEventArgs>(ModificarCli);
     servCliente.CloseAsync();
 }
Пример #54
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            ClienteBE nuevadir = new ClienteBE();
            nuevadir.Cedula = lblCedulaCli2.Text;

            UbicacionBE ubicacion = new UbicacionBE();
            ubicacion.Direccion = txtNuevaDir.Text.ToUpper();
            ubicacion.Barrio = txtNuevoBarrio.Text.ToUpper();
            ubicacion.Telefono_1 = txtTelefono.Text.ToUpper();
            CiudadBE ciu = new CiudadBE();
            ciu.Nombre_Ciudad = "231";
            ubicacion.Ciudad = ciu;
            nuevadir.Ubicacion = ubicacion;

            servCliente.Agregar_UbicacionAsync(nuevadir);
            servCliente.Agregar_UbicacionCompleted += new EventHandler<Agregar_UbicacionCompletedEventArgs>(AgregarUbiNueva);
            servCliente.CloseAsync();
        }
Пример #55
0
        protected void txtNumPedido_TextChanged(object sender, EventArgs e)
        {
            PedidoServiceClient servPedido = new PedidoServiceClient();
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable table1 = new DataTable();
            DataTable table2 = new DataTable();

            long respExisPedido;

            try
            {
                respExisPedido = servPedido.ConsultarExistenciaPedido(txtNumPedido.Text);

                if (respExisPedido == 0)
                {
                    MessageBox.Show("El pedido no se encuentra registrado en el sistema", "Consultar Pedido");
                    divInfoCliente.Visible = false;
                    txtCedula.Text = "";
                    txtNumPedido.Text = "";
                    txtCedula.Focus();
                }
                else
                {
                    PedidoBE objPedido = servPedido.Consultar_Pedido(txtNumPedido.Text);

                    if (objPedido.Estado == "2")
                    {
                        MessageBox.Show("El pedido se encuentra cancelado en el sistema", "Consultar Pedido");
                        divInfoCliente.Visible = false;
                        divDirCliente.Visible = false;
                        DivInfoPedido.Visible = false;
                        txtCedula.Text = "";
                        txtNumPedido.Text = "";
                        txtCedula.Focus();
                    }
                    else
                    {
                        table2.Columns.Add("Tamano");
                        table2.Columns.Add("Cantidad");

                        foreach (Detalle_PedidoBE datos in objPedido.List_Detalle_Ped)
                        {
                            table2.Rows.Add(datos.Tamano, datos.Cantidad);
                            gvPedido.DataSource = table2;
                            gvPedido.DataBind();
                        }

                        DivInfoPedido.Visible = true;

                        ClienteBE objCliente = servCliente.Consultar_Cliente(Convert.ToString(respExisPedido));

                        txtCedulaCliente.Text = objCliente.Cedula;
                        lblIdCliente.Text = objCliente.Id_Cliente;
                        txtNombreCliente.Text = objCliente.Nombres_Cliente + " " + objCliente.Apellido_1 + " " + objCliente.Apellido_2;
                        lblCodigoPedido.Text = txtNumPedido.Text;
                        table1.Columns.Add("IdUbicacion");
                        table1.Columns.Add("Direccion");
                        table1.Columns.Add("Barrio");
                        table1.Columns.Add("Telefono");
                        table1.Columns.Add("Ciudad");

                        foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                        {
                            table1.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                            gvDirecciones.DataSource = table1;
                            gvDirecciones.DataBind();
                        }

                        divInfoCliente.Visible = true;
                        divDirCliente.Visible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servPedido.Close();
                txtCedula.Text = "";
                txtNumPedido.Text = "";
                divInfoCliente.Focus();
            }
        }
Пример #56
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            PedidoServiceClient servPedido = new PedidoServiceClient();
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable table1 = new DataTable();
            DataTable table2 = new DataTable();

            long respExisCliente;
            long respExisPedido;

            try
            {
                respExisCliente = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (respExisCliente == 0)
                {
                    MessageBox.Show("El cliente no ha solicitado pedido de cilindros", "Consultar Pedido");
                    divInfoCliente.Visible = false;
                    txtCedula.Text = "";
                    txtCedula.Focus();
                }

                else
                {
                    respExisPedido = servPedido.ConsultarExistenciaPedido(txtCedula.Text);

                if (respExisPedido == 0)
                {
                    MessageBox.Show("El cliente no tiene no se encuentra registrado en el sistema", "Consultar Pedido");
                    divInfoCliente.Visible = false;
                    txtCedula.Text = "";
                    txtNumPedido.Text = "";
                    txtCedula.Focus();
                }
                else
                {
                    ClienteBE objCliente = servCliente.Consultar_Cliente(txtCedula.Text);

                    txtCedulaCliente.Text = objCliente.Cedula;
                    txtNombreCliente.Text = objCliente.Nombres_Cliente;
                    txtPrimerApellido.Text = objCliente.Apellido_1;
                    txtSegundoApellido.Text = objCliente.Apellido_2;

                    table1.Columns.Add("IdUbicacion");
                    table1.Columns.Add("Direccion");
                    table1.Columns.Add("Barrio");
                    table1.Columns.Add("Telefono");
                    table1.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                    {
                        table1.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                        gvDirecciones.DataSource = table1;
                        gvDirecciones.DataBind();
                    }

                    PedidoBE objPedido = servPedido.Consultar_Pedido(txtCedulaCliente.Text);

                    table2.Columns.Add("TamanoCil");
                    table2.Columns.Add("CantidadPedido");
                    table2.Columns.Add("FechaPedido");
                    table2.Columns.Add("CodigoPedido");

                    foreach(Detalle_PedidoBE datos in objPedido.List_Detalle_Ped)
                    {
                        table2.Rows.Add(datos.Tamano, datos.Cantidad, datos.Fecha, datos.Id_Pedido);
                    }
                    gvPedido.DataSource = table2;
                    gvPedido.DataBind();
                    gvDirecciones.Visible = true;
                    divInfoPedido.Visible = true;
                    divInfoCliente.Visible = true;
                    divDirCliente.Visible = true;
                    btnMenuPrincipal.Visible = true;
                 }
              }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servPedido.Close();
                txtCedula.Text = "";
                txtNumPedido.Text = "";
                btnNuevaConsulta.Visible = true;
                lblCodigoPedido.Visible = false;
                lblPedido.Visible = false;
                btnNuevaConsulta.Focus();
            }
        }
Пример #57
0
        protected void TxtNumPedido_TextChanged(object sender, EventArgs e)
        {
            PedidoServiceClient servPedido = new PedidoServiceClient();
            ClienteServiceClient servCliente = new ClienteServiceClient();
            DataTable table = new DataTable();

            long respExisPedido;

            try
            {
                respExisPedido = servPedido.ConsultarExistenciaPedido(txtNumPedido.Text);

                if (respExisPedido == 0)
                {
                    MessageBox.Show("El pedido no se encuentra registrado en el sistema", "Consultar Pedido");
                    divInfoCliente.Visible = false;
                    txtNumPedido.Text = "";
                    txtNumPedido.Focus();
                }
                else
                {
                    ClienteBE objCliente = servCliente.Consultar_Cliente(Convert.ToString(respExisPedido));

                    txtCedulaCliente.Text = objCliente.Cedula;
                    txtNombreCliente.Text = objCliente.Nombres_Cliente;
                    txtPrimerApellido.Text = objCliente.Apellido_1;
                    txtSegundoApellido.Text = objCliente.Apellido_2;
                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                        gvDirecciones.DataSource = table;
                        gvDirecciones.DataBind();
                    }
                    gvDirecciones.Visible = true;
                    divDirCliente.Visible = true;
                    divInfoCliente.Visible = true;
                    lblCodigoPedido.Text = txtNumPedido.Text;

                    PedidoBE objPedido = servPedido.Consultar_Pedido(txtNumPedido.Text);

                    foreach (Detalle_PedidoBE datos in objPedido.List_Detalle_Ped)
                    {
                        TamanoBE tam = new TamanoBE();
                        tam.Cantidad = Convert.ToInt32(datos.Cantidad);
                        tam.Tamano = datos.Tamano;
                        lista.Add(tam);
                    }
                    grvPrueba.DataSource = lista;
                    grvPrueba.DataBind();
                    Session["lista"] = lista;
                    Session["listaAuxiliar"] = lista;
                    grvPrueba.Focus();
                    btnMenuPrincipal.Visible = true;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servPedido.Close();
                lblCodigoPedido.Visible = true;
                lblPedido.Visible = true;
                txtNumPedido.Text = "";
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     var svc = new ClienteServiceClient();
     var cliente = svc.GetCliente(Convert.ToInt32(textBox1.Text));
     textBox2.Text = cliente.Nombre;
 }
Пример #59
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();

            long resp;
            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (resp != 0)
                {
                    MessageBox.Show("El cliente ya se encuentra registrado en el sistema", "Registrar Cliente");
                    divInfoCliente.Visible = false;
                    txtCedulaCli.Text = "";
                    txtBarrio.Text = "";
                    txtCedula.Text = "";
                    txtDireccion.Text = "";
                    txtNombreCliente.Text = "";
                    txtPrimerApellido.Text = "";
                    txtSegundoApellido.Text = "";
                    txtTelefono.Text = "";
                    btnGuardar.Visible = false;
                    txtCedula.Focus();
                }
                else
                {
                    divInfoCliente.Visible = true;
                    btnGuardar.Visible = true;
                    txtNombreCliente.Focus();
                    txtCedulaCli.Text = txtCedula.Text;
                    txtCedula.Text = "";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
            }
        }
Пример #60
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            VehiculoServiceClient servVeh = new VehiculoServiceClient();
            DataTable table = new DataTable();
            long resp;
            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

               if (resp == 0)
               {
                   MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Registrar Pedido");
                   divInfoCliente.Visible = false;
                   txtCedula.Text = "";
                   txtCedula.Focus();
               }

               else
               {
                   ClienteBE objCliente = servCliente.Consultar_Cliente(txtCedula.Text);

                   txtCedulaCli.Text = objCliente.Cedula;
                   lblIdCedula.Text = objCliente.Id_Cliente;
                   txtNombreCliente.Text = objCliente.Nombres_Cliente;
                   txtPrimerApellido.Text = objCliente.Apellido_1;
                   txtSegundoApellido.Text = objCliente.Apellido_2;
                   table.Columns.Add("IdUbicacion");
                   table.Columns.Add("Direccion");
                   table.Columns.Add("Barrio");
                   table.Columns.Add("Telefono");
                   table.Columns.Add("Ciudad");

                   foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                   {
                       table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                       gvDirecciones.DataSource = table;
                       gvDirecciones.DataBind();
                   }
                   divDirCliente.Visible = true;
                   divInfoCliente.Visible = true;
                   lstTamanos.Focus();
                   txtCedula.Text = "";
                   btnMenuPrincipal.Visible = true;
               }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVeh.Close();
            }
        }