Esempio n. 1
0
 private void Init()
 {
     _servicio = new LSservicio.ServicioLSClient();
     CargarFamiliaProducto();
     //CargarTiposProductos();
     CargarProductos();
 }
        public Registro_Proveedores()
        {
            InitializeComponent();
            _servicio = new LSservicio.ServicioLSClient();

            CargarDatos();
        }
Esempio n. 3
0
 public Cambio_Contrasena(string nombre, string nombrecompleto)
 {
     InitializeComponent();
     NombreUsuario          = nombre;
     txtNombreCompleto.Text = string.Format("({0}) {1}", nombre, nombrecompleto);
     _servicio = new LSservicio.ServicioLSClient();
 }
        //Elimina un empleado
        protected async void btnEliminar_Click(object sender, EventArgs e)
        {
            Empleado emp = new Empleado();

            emp.Rut = txt_Rut.Text;

            LSservicio.ServicioLSClient servicio = new LSservicio.ServicioLSClient();

            //if (bib.Read())
            string xml = servicio.LeerEmpleado(emp.Serializar());

            if (xml != null)
            {
                emp = new Empleado(xml);
                xml = emp.Serializar();
                //if (bib.Delete())
                Usuario u = new Usuario();
                u.RutEmpleado = emp.Rut;
                string xml2 = u.Serializar();
                if (servicio.EliminarUsuarioPorRut(xml2))
                {
                    await this.ShowMessageAsync("Información", "Usuario Eliminado con Éxito");

                    if (emp.IdCargo.ToString() == "1")
                    {
                        Odontologo o = new Odontologo();
                        o.RutEmpleado = emp.Rut;
                        string xml3 = o.Serializar();
                        if (servicio.EliminarOdonPorRut(xml3))
                        {
                            await this.ShowMessageAsync("Información", "Odontologo eliminado exitosamente");
                        }
                        else
                        {
                            await this.ShowMessageAsync("Información", "Odontologo NO eliminado");
                        }
                    }

                    if (servicio.EliminarEmpleado(xml))
                    {
                        await this.ShowMessageAsync("Información", "Empleado eliminado exitosamente");
                    }
                    else
                    {
                        await this.ShowMessageAsync("Información", "Empleado eliminado exitosamente");
                    }
                }
                else
                {
                    await this.ShowMessageAsync("Información", "Usuario NO Eliminado");
                }
            }
            else
            {
                await this.ShowMessageAsync("Información", "Empleado no existe");
            }

            //gd_Empleados.ItemsSource = servicio.LeerTodosEmpleados();
        }
 private void Init()
 {
     _servicio = new LSservicio.ServicioLSClient();
     if (IdProducto == null)
     {
         btnModificar.IsEnabled = false;
         btnEliminar.IsEnabled  = false;
     }
     else
     {
         btnModificar.IsEnabled = true;
         btnEliminar.IsEnabled  = true;
     }
     CargarFamiliaProducto();
 }
        //Inicia los combobox con los valores de base de datos, inicia el grid como hidden, desactiva el digito verificador
        public void Iniciador()
        {
            servicio = new LSservicio.ServicioLSClient();

            string xml = servicio.LeerTodasProvincias();

            List <Provincia> ciudades = Util.Deserializar <List <Provincia> >(xml);

            cbo_Ciudad.ItemsSource       = ciudades;
            cbo_Ciudad.SelectedValuePath = "Id";

            string xmls = servicio.LeerTodosCargos();

            List <Cargos> cargos = Util.Deserializar <List <Cargos> >(xmls);

            cbo_Cargo.ItemsSource       = cargos;
            cbo_Cargo.SelectedValuePath = "Id";
        }
        //Actualiza un empleado
        protected async void btnActualizar_Click(object sender, EventArgs e)
        {
            Empleado emp = new Empleado();

            emp.Rut = txt_Rut.Text;

            LSservicio.ServicioLSClient servicio = new LSservicio.ServicioLSClient();

            if (servicio.LeerEmpleado(emp.Serializar()) != null)
            {
                emp.Nombre          = txt_Nombre.Text;
                emp.ApellidoPaterno = txt_ApellidoP.Text;
                emp.ApellidoMaterno = txt_ApellidoM.Text;
                emp.Direccion       = txt_Direccion.Text;
                emp.IdComuna        = decimal.Parse(cbo_Comuna.SelectedValue.ToString());
                emp.IdCargo         = int.Parse(cbo_Cargo.SelectedValue.ToString());


                try
                {
                    if (servicio.ActualizarEmpleado(emp.Serializar()))
                    {
                        await this.ShowMessageAsync("Información", "Empleado actualizado exitosamente");
                    }
                    else
                    {
                        await this.ShowMessageAsync("Información", "Empleado no pudo ser actualizado");
                    }
                }
                catch (Exception)
                {
                    await this.ShowMessageAsync("Información", "Empleado no pudo ser actualizado");
                }
            }
            else
            {
                await this.ShowMessageAsync("Información", "El Empleado no existe");
            }

            //gd_Empleados.ItemsSource = servicio.LeerTodosEmpleados();
        }
Esempio n. 8
0
        public Estadisticas()
        {
            InitializeComponent();
            _servicio = new LSservicio.ServicioLSClient();

            string xml = _servicio.ComunasConMasClientes();

            List <ReportesCSP> c = Util.Deserializar <List <ReportesCSP> >(xml);

            var list       = new List <KeyValuePair <string, int> >();
            int cant_total = 0;

            foreach (var i in c)
            {
                list.Add(new KeyValuePair <string, int>(i.Nombre, i.Cantidad));
                cant_total = cant_total + i.Cantidad;
            }
            int cantidad = int.Parse(_servicio.CantidadComunas());
            int cont     = cantidad - cant_total;

            //list.Add(new KeyValuePair<string, int>("Otras", cont));

            ((ColumnSeries)mcChart.Series[0]).ItemsSource = list;
        }
        public Registro_Proveedores(string id)
        {
            InitializeComponent();
            button.Visibility  = Visibility.Hidden;
            button3.Visibility = Visibility.Hidden;
            button4.Visibility = Visibility.Hidden;
            _servicio          = new LSservicio.ServicioLSClient();
            Rut          = id;
            txt_rut.Text = Rut;



            Proveedor p = new Proveedor();

            p.Rut = Rut;
            string xml = p.Serializar();

            xml = _servicio.TraerProveedor(xml);
            if (xml != null)
            {
                Proveedor proveedor = new Proveedor(xml);

                txt_Nombre.Text    = proveedor.Nombre;
                txt_rubro.Text     = proveedor.Rubro;
                txt_contacto.Text  = proveedor.Telefono.ToString();
                txt_correo.Text    = proveedor.Correo;
                txt_dv.Text        = proveedor.Dv;
                txt_direccion.Text = proveedor.Direccion;
                CargarDatos();
                int val = 0;

                Comuna com = new Comuna();
                com.Id = int.Parse(proveedor.IdComuna.ToString());
                xml    = com.Serializar();
                xml    = _servicio.LeerComuna(xml);
                com    = new Comuna(xml);
                // CargarDatos();
                for (int i = 0; i < cbcProvincia.Items.Count; i++)
                {
                    Provincia pr = (Provincia)cbcProvincia.Items[i];
                    if (com.provincia.Id == pr.Id)
                    {
                        val = i;
                    }
                }
                cbcProvincia.SelectedIndex = val;
                val = 0;
                for (int i = 0; i < cbcComuna.Items.Count; i++)
                {
                    Comuna c = (Comuna)cbcComuna.Items[i];
                    if (c.Id == proveedor.IdComuna)
                    {
                        val = i;
                    }
                }

                cbcComuna.SelectedIndex = val;

                Usuario u = new Usuario();
                u.RutProveedor = proveedor.Rut;
                xml            = u.Serializar();
                xml            = _servicio.LeerPorRut(xml);
                if (xml != null)
                {
                    u = new Usuario(xml);
                    txt_usuario.Text = u.Nombre;
                }
            }
        }
 private void Init()
 {
     _servicio    = new LSservicio.ServicioLSClient();
     ServProlista = new List <ServPro>();
     CargarFamiliaProducto();
 }
Esempio n. 11
0
 private void InicializarWCF()
 {
     _servicio = new LSservicio.ServicioLSClient();
 }
Esempio n. 12
0
        private void Init()
        {
            _servicio = new LSservicio.ServicioLSClient();

            CargarServicios();
        }
Esempio n. 13
0
 private void Init()
 {
     _servicio = new LSservicio.ServicioLSClient();
     CargarProvincias();
 }
Esempio n. 14
0
 private void Init()
 {
     servicio = new LSservicio.ServicioLSClient();
     CargarFiltros();
     CargarEmpleados();
 }