private async void BtnMostrar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); int Fase = int.Parse(cboFase.Text); List <historial> historial = null; try { if (cboFase.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione una Fase"); } else { cboFase.Text = ""; txtDescripcion.Text = ""; txtFecha.Text = ""; cboEstado.Items.Clear(); historial = cliente.detalleHistorial(Fase).ToList(); foreach (var item in historial) { txtDescripcion.Text = item.descripcion; txtFecha.Text = item.fecha; cboEstado.Items.Add("EN PROCESO"); cboEstado.Items.Add("TERMINADO"); } } } catch { await this.ShowMessageAsync("Error", "No hay requerimientos existentes a este proyecto"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String NombreProyecto = cboProyecto.Text; List <solicitud> fecha = null; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyeto"); } else { fecha = cliente.fechaSolicitud(NombreProyecto).ToList(); foreach (var item in fecha) { cboFecha.Items.Add(item.fecha); } await this.ShowMessageAsync("Exito", "Fechas Cargadas"); } } catch { await this.ShowMessageAsync("Error", "No Existen Fechas a Terreno"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String nombreProyecto = cboProyecto.Text.ToUpper(); List <historial> historial = null; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyecto"); } else { lsFase.Items.Clear(); lsDescripcion.Items.Clear(); lsFecha.Items.Clear(); lsEstado.Items.Clear(); historial = cliente.buscarHistorial(nombreProyecto).ToList(); foreach (var item in historial) { lsFase.Items.Add(item.fase); lsDescripcion.Items.Add(item.descripcion); lsFecha.Items.Add(item.fecha); lsEstado.Items.Add(item.estado); } } } catch { await this.ShowMessageAsync("Error", "No hay requerimientos existentes a este proyecto"); } }
private async void BtnAgregar_Click(object sender, RoutedEventArgs e) { agregarHistorial agregar = new agregarHistorial(); NaturalWSClient cliente = new NaturalWSClient(); String rutcliente = txtRut.Text.ToUpper(); List <proyecto> proyecto = null; try { cboProyecto.Items.Clear(); proyecto = cliente.buscarProyecto(rutcliente).ToList(); foreach (var item in proyecto) { agregar.cboProyecto.Items.Add(item.nombre_Proyecto); } agregar.txtRut.Text = txtRut.Text.ToUpper(); agregar.Show(); this.Close(); } catch { await this.ShowMessageAsync("Error", "Porfavor, Ingrese Rut del Cliente"); } }
private async void BtnComprobar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String rutcliente = txtRut.Text.ToUpper(); List <proyecto> proyecto = null; try { if (txtRut.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor, Ingrese Rut del Cliente"); } else { cboProyecto.Items.Clear(); proyecto = cliente.buscarProyecto(rutcliente).ToList(); foreach (var item in proyecto) { cboProyecto.Items.Add(item.nombre_Proyecto); } await this.ShowMessageAsync("Exito", "Proyectos Encontrados"); } } catch { lsFase.Items.Clear(); lsDescripcion.Items.Clear(); lsFecha.Items.Clear(); lsEstado.Items.Clear(); await this.ShowMessageAsync("Error", "Rut no Valido"); } }
private async void BtnEstado_Click(object sender, RoutedEventArgs e) { int resp = 0; NaturalWSClient cliente = new NaturalWSClient(); proyecto pro = new proyecto(); pro.nombre_Proyecto = cboProyecto.Text.ToUpper(); pro.servicio = txtServicio.Text.ToUpper(); pro.estado = cboEstado.Text.ToUpper(); pro.rutCliente = txtRut.Text.ToUpper(); pro.nombre_Equipo = txtEquipo.Text.ToUpper(); if (cboEstado.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "No puede Actualizar Estado si no Carga Proyecto"); } else { if (cliente.estadoProyecto(pro)) { resp = 1; await this.ShowMessageAsync("EXITO", "PROYECTO CAMBIO ESTADO A " + pro.estado); proyectoSoli solicitud = new proyectoSoli(); solicitud.Show(); this.Close(); } else { await this.ShowMessageAsync("ERROR", "NO SE PUDO CAMBIAR ESTADO"); } } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String NombreProyecto = cboProyecto.Text; List <proyecto> proyecto = null; txtServicio.IsEnabled = false; txtEquipo.IsEnabled = false; cboEstado.IsEnabled = true; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyecto"); } else { txtServicio.Text = ""; txtEquipo.Text = ""; proyecto = cliente.detalleProyecto(NombreProyecto).ToList(); foreach (var item in proyecto) { txtServicio.Text = item.servicio; txtEquipo.Text = item.nombre_Equipo; cboEstado.Text = item.estado; } } } catch { await this.ShowMessageAsync("Error", "Nombre de Proyecto en Blanco"); } }
private async void BtnEstado_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); solicitud soli = new solicitud(); try { soli.codSolicitud = int.Parse(txtCodigo.Text); soli.hora = txtHora.Text; soli.fecha = cboFecha.Text; soli.estado = cboEstado.Text; soli.nombre_Proyecto = cboProyecto.Text; if (cliente.estadoSolicitud(soli)) { await this.ShowMessageAsync("Exito", "HORA AGENDADA CAMBIO ESTADO A " + soli.estado); horaSoli hora = new horaSoli(); hora.Show(); this.Close(); } else { await this.ShowMessageAsync("Error", "No se pudo cambiar Estado"); } } catch { await this.ShowMessageAsync("Error", "Hay Campos que no ah Seleccionado, Porfavor Rellene los Campos Vacios"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String nombreProyecto = cboProyecto.Text; List <historial> historial = null; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Erro", "Porfavor Seleccione un Proyecto"); } else { cboFase.Items.Clear(); txtDescripcion.Text = ""; txtFecha.Text = ""; cboEstado.Items.Clear(); historial = cliente.faseHistorial(nombreProyecto).ToList(); foreach (var item in historial) { cboFase.Items.Add(item.fase); } await this.ShowMessageAsync("Exito", "Fases del proyecto Encontrado"); } } catch { await this.ShowMessageAsync("Error", "No hay requerimientos existentes a este proyecto"); } }
private async void BtnCargar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String Fecha = cboFecha.Text; List <solicitud> solicitud = null; try { if (cboFecha.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione una Fecha"); } else if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyecto"); } else { cboEstado.IsEnabled = true; solicitud = cliente.fechaProyecto(Fecha).ToList(); foreach (var item in solicitud) { txtCodigo.Text = item.codSolicitud.ToString(); txtHora.Text = item.hora; cboEstado.Text = item.estado; } } } catch { await this.ShowMessageAsync("Error", "Fecha Incorrecta"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String rutcliente = txtRut.Text.ToUpper(); List <proyecto> proyecto = null; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyecto"); } else { proyecto = cliente.buscarProyecto(rutcliente).ToList(); foreach (var item in proyecto) { txtEquipo.Text = item.nombre_Equipo; } await this.ShowMessageAsync("Exito", "Equipo Encontrado"); } } catch { lsNombre.Items.Clear(); lsCargo.Items.Clear(); txtEquipo.Text = ""; await this.ShowMessageAsync("Error", "Proyecto no Encontrado"); } }
private async void BtnCargar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String equipo = txtEquipo.Text.ToUpper(); List <trabajador> trabajador = null; try { lsNombre.Items.Clear(); lsCargo.Items.Clear(); trabajador = cliente.buscarTrabajador(equipo).ToList(); foreach (var item in trabajador) { lsNombre.Items.Add(item.nombre_Trabajador); lsCargo.Items.Add(item.cargo); } } catch { lsNombre.Items.Clear(); lsCargo.Items.Clear(); await this.ShowMessageAsync("Error", "Equipo no Encontrado"); } }
private async void BtnAgregar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); historial his = new historial(); try { if (txtRut.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese Rut del Cliente"); } else if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Seleccione un Proyecto"); } else if (txtFase.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese la Fase del Proyecto"); } else if (txtFecha.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese la Fecha del Requerimiento"); } else if (txtDescripcion.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese una Descripción para el Requerimiento"); } else { his.fase = int.Parse(txtFase.Text); his.fecha = txtFecha.Text.ToUpper(); his.descripcion = txtDescripcion.Text.ToUpper(); his.estado = txtEstado.Text.ToUpper(); his.nombre_Proyecto = cboProyecto.Text.ToUpper(); if (cliente.agregarHistorial(his)) { await this.ShowMessageAsync("Exito", "Requerimiento ingresado Correctamente"); historialPro historial = new historialPro(); historial.Show(); this.Close(); } else { await this.ShowMessageAsync("Error", "No se pudo Ingresar actual Requerimiento"); } } } catch { await this.ShowMessageAsync("Error", "Tenemos problemas para Ingresar un Requerimiento"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String nombreProyecto = cboProyecto.Text.ToUpper(); List <insumo> insumo = null; double suma = 0; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Seleccione un Proyecto"); } else { lsNumero.Items.Clear(); lsDescripcion.Items.Clear(); lsTienda.Items.Clear(); lsCantidad.Items.Clear(); lsPrecioUni.Items.Clear(); lsPrecioTotal.Items.Clear(); insumo = cliente.buscarInsumo(nombreProyecto).ToList(); foreach (var item in insumo) { lsNumero.Items.Add(item.codInsumo); lsDescripcion.Items.Add(item.descripcion); lsTienda.Items.Add(item.tienda); lsCantidad.Items.Add(item.cantidad); lsPrecioUni.Items.Add(item.precio); lsPrecioTotal.Items.Add(item.precio * item.cantidad); } foreach (object item in lsPrecioTotal.Items) { double val = Convert.ToDouble(item); suma += val; txtTotal.Text = "$ " + suma.ToString(); } } } catch { lsNumero.Items.Clear(); lsDescripcion.Items.Clear(); lsTienda.Items.Clear(); lsCantidad.Items.Clear(); lsPrecioUni.Items.Clear(); lsPrecioTotal.Items.Clear(); await this.ShowMessageAsync("Error", "No hay insumos existentes a este proyecto"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String NombreProyecto = cboProyecto.Text.ToUpper(); List <solicitud> solicitud = null; try { if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Seleccione un Proyecto"); } else { solicitud = cliente.detalleSolicitud(NombreProyecto).ToList(); listId.Items.Clear(); listProyecto.Items.Clear(); listHora.Items.Clear(); listFecha.Items.Clear(); listEstado.Items.Clear(); foreach (var item in solicitud) { listId.Items.Add(item.codSolicitud); listProyecto.Items.Add(item.nombre_Proyecto); listHora.Items.Add(item.hora); listFecha.Items.Add(item.fecha); listEstado.Items.Add(item.estado); } } } catch (System.Exception ex) { await this.ShowMessageAsync("Error", "No hay Solicitud a Terreno Existente para ese Proyecto"); listId.Items.Clear(); listProyecto.Items.Clear(); listHora.Items.Clear(); listFecha.Items.Clear(); listEstado.Items.Clear(); } }
private async void BtnAgregar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); historial hist = new historial(); hist.fecha = txtFecha.Text; hist.descripcion = txtDescripcion.Text; hist.estado = cboEstado.Text; hist.nombre_Proyecto = cboProyecto.Text; if (cliente.estadoHistorial(hist)) { await this.ShowMessageAsync("Exito", "REQUERIMIENTO CAMBIO ESTADO A " + hist.estado); } else { await this.ShowMessageAsync("Error", "No se pudo cambiar Estado"); } }
private async void BtnSeleccionar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String RutCliente = txtRut.Text.ToUpper(); List <proyecto> proyecto = null; try { if (txtRut.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Ingrese Rut del Cliente"); } else { listNombre.Items.Clear(); listServicio.Items.Clear(); listEquipo.Items.Clear(); listEstado.Items.Clear(); proyecto = cliente.buscarProyecto(RutCliente).ToList(); foreach (var item in proyecto) { listNombre.Items.Add(item.nombre_Proyecto); listServicio.Items.Add(item.servicio); listEquipo.Items.Add(item.nombre_Equipo); listEstado.Items.Add(item.estado); } await this.ShowMessageAsync("Exito", "Proyecto Encontrado"); } } catch (System.Exception ex) { txtRut.Text = ""; listNombre.Items.Clear(); listServicio.Items.Clear(); listEquipo.Items.Clear(); listEstado.Items.Clear(); await this.ShowMessageAsync("Error", "Rut Invalido"); } }
private async void BtnIngresar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); String user = txtUser.Text.ToUpper(); String pass = txtPass.Password.ToUpper(); try { if (txtUser.Text.Equals("")) { await this.ShowMessageAsync("Error", "Porfavor Ingrese su Usuario"); } else if (txtPass.Password.Equals("")) { await this.ShowMessageAsync("Error", "Porfavir Ingrese su Contraseña"); } else { if (cliente.loginAdmin(user, pass)) { await this.ShowMessageAsync("Exito", "BIENVENIDO " + user); Vistas.Administrador.menu menu = new Vistas.Administrador.menu(); menu.Show(); this.Close(); } else { await this.ShowMessageAsync("Error", "Usuario o Contraseña Incorrecta"); } } } catch { await this.ShowMessageAsync("Error", "No se pudo iniciar"); } }
private async void BtnAgregar_Click(object sender, RoutedEventArgs e) { NaturalWSClient cliente = new NaturalWSClient(); insumo insu = new insumo(); try { var random = new Random(); var value = random.Next(0, 1000); int Codigo = value; insu.codInsumo = Codigo; if (cboProyecto.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Seleccione un Proyecto"); } else if (txtRut.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese Rut del Cliente"); } else if (txtDescripcion.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese una Descripcion"); } else if (txtPrecio.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese Precio del Producto"); } else if (txtCantidad.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese la Cantidad a Comprar del Producto"); } else if (txtTienda.Text.Equals("")) { await this.ShowMessageAsync("Advertencia", "Porfavor Ingrese la Tienda a Comprar"); } else { insu.descripcion = txtDescripcion.Text.ToUpper(); insu.tienda = txtTienda.Text.ToUpper(); insu.cantidad = int.Parse(txtCantidad.Text); insu.precio = int.Parse(txtPrecio.Text); insu.nombre_Proyecto = cboProyecto.Text.ToUpper(); if (cliente.agregarInsumo(insu)) { await this.ShowMessageAsync("Exito", "Insumo ingresado Correctamente"); insumosPro insumo = new insumosPro(); insumo.Show(); this.Close(); } else { await this.ShowMessageAsync("Error", "No se pudo ingresar Insumo"); } } } catch { await this.ShowMessageAsync("Error", "Tenemos problemas al ingresar Insumo"); } }