public async Task <PasosDTO2> modificarpaso(PasosDTO2 pasosdto2) { Pasos pasos = new Pasos() { id = pasosdto2.id, nombreexpediente = pasosdto2.nombreexpediente, documentos = pasosdto2.documentos.Select(x => new DocumentoPaso() { tipo = x.tipo, pasos = (List <Paso>)x.pasos.Select((a, b) => new Paso() { indice = b, nombre = a.nombre, descripcion = a.descripcion, dias = a.dias, subpaso = (List <SubPaso>)a.subpaso.Select((c, d) => new SubPaso() { indice = d, descripcion = c.descripcion }).ToList() }).ToList() }).ToList() }; var filter = Builders <Pasos> .Filter.Eq("id", pasos.id); var update = Builders <Pasos> .Update .Set("nombreexpediente", pasos.nombreexpediente) .Set("documentos", pasos.documentos); _pasos.FindOneAndUpdate <Pasos>(filter, update); return(pasosdto2); }
public async Task <Asistente> UpdateSolicitudInicial(Asistente asistente, String nombreexpediente) { Pasos pasos = await pasoService.GetPasoByNombreExpediente(nombreexpediente); pasos.documentos.Find(x => x.tipo == asistente.tipodocumento) .pasos.Find(x => x.indice == asistente.paso - 1).fechainicio = asistente.pasos.documentos.ElementAt(0).pasos.ElementAt(0).fechainicio; pasos.documentos.Find(x => x.tipo == asistente.tipodocumento) .pasos.Find(x => x.indice == asistente.paso - 1).fechafin = asistente.pasos.documentos.ElementAt(0).pasos.ElementAt(0).fechafin; pasos.documentos.Find(x => x.tipo == asistente.tipodocumento) .pasos.Find(x => x.indice == asistente.paso - 1).fechalimite = asistente.pasos.documentos.ElementAt(0).pasos.ElementAt(0).fechalimite; FilterDefinition <Asistente> queryUpdate = Builders <Asistente> .Filter.Eq("idexpediente", asistente.idexpediente); UpdateDefinition <Asistente> updateAsistente = Builders <Asistente> .Update .Set("paso", asistente.paso) .Set("subpaso", asistente.subpaso) .Set("tipodocumento", asistente.tipodocumento) .Set("pasos", new PasoAsistente { documentos = pasos.documentos, nombreexpediente = pasos.nombreexpediente }); Asistente asistenteActualizado = await _asistentes.FindOneAndUpdateAsync(queryUpdate, updateAsistente, new FindOneAndUpdateOptions <Asistente> { ReturnDocument = ReturnDocument.After }); return(asistenteActualizado); }
public List <Pasos> ConsultarPasos() { Obtenido = null; Pasos Paso; LPasos = new List <Pasos>(); Sentencia = $"SELECT * FROM PASOS"; using (var Comando = new OracleCommand(Sentencia, Conexion)) { Comando.CommandType = System.Data.CommandType.Text; Obtenido = Comando.ExecuteReader(); } while (Obtenido.Read()) { //Entrada salida nombre Paso = new Pasos(Obtenido["ENTRADA"].ToString(), Obtenido["SALIDA"].ToString(), Obtenido["NOMBRE"].ToString()); Paso.SetId(Obtenido["PASO_ID"].ToString()); Paso.SetFuncion(Obtenido["FUNCION_ID"].ToString()); Paso.SetResultado(Obtenido["RESULTADO_ID"].ToString()); LPasos.Add(Paso); } return(LPasos); }
private void BotonAnterior_Click(object sender, EventArgs e) { BotonSiguiente.Visible = true; switch (Paso) { case Inicial.Pasos.NombreServidor: Paso = Inicial.Pasos.SeleccionarAlmacen; break; case Inicial.Pasos.PruebaServidor: if (RadioInicioInstalacionLocal.Checked) { Paso = Inicial.Pasos.Inicio; } else if (CheckEsteEquipo.Checked) { Paso = Inicial.Pasos.SeleccionarAlmacen; } else if (CheckOtroEquipo.Checked) { Paso = Inicial.Pasos.NombreServidor; } break; case Inicial.Pasos.Deteccion: case Inicial.Pasos.InstalarServidor: case Inicial.Pasos.Final: case Inicial.Pasos.DatosEmpresa: default: Paso = Inicial.Pasos.Inicio; break; } this.MostrarPaneles(); }
public async Task <PasosDTO2> registrarPaso(PasosDTO2 pasosdto2) { Pasos pasos = new Pasos() { nombreexpediente = pasosdto2.nombreexpediente, documentos = pasosdto2.documentos.Select(x => new DocumentoPaso() { tipo = x.tipo, pasos = (List <Paso>)x.pasos.Select((a, b) => new Paso() { indice = b, nombre = a.nombre, descripcion = a.descripcion, dias = a.dias, subpaso = (List <SubPaso>)a.subpaso.Select((c, d) => new SubPaso() { indice = d, descripcion = c.descripcion }).ToList() }).ToList() }).ToList() }; _pasos.InsertOne(pasos); pasosdto2.id = pasos.id; return(pasosdto2); }
public async Task <ActionResult <Pasos> > GetPasosById([FromQuery] string id) { Pasos pasos = new Pasos();; pasos = await pasoService.GetPasosById(id); return(pasos); }
public async Task <Asistente> Create(Asistente asistente) { Pasos pasos = await pasoService.GetPasoByNombreExpediente(asistente.pasos.nombreexpediente); asistente.pasos = new PasoAsistente { documentos = pasos.documentos, nombreexpediente = pasos.nombreexpediente }; asistente.paso = 0; asistente.subpaso = 0; asistente.tipodocumento = "SolicitudInicial"; await _asistentes.InsertOneAsync(asistente); return(asistente); }
public string GuardarPaso(Pasos P) { Sentencia = "INSERTAR_PASO"; using (var Comando = new OracleCommand(Sentencia, Conexion)) { Comando.CommandType = System.Data.CommandType.StoredProcedure; Comando.Parameters.Add("PASO_ID", OracleDbType.Char).Value = P.GetId(); Comando.Parameters.Add("FUNCION_ID", OracleDbType.Char).Value = P.GetFuncion(); Comando.Parameters.Add("RESULTADO_ID", OracleDbType.Char).Value = P.GetResultado(); Comando.Parameters.Add("NOMBRE", OracleDbType.NVarchar2).Value = P.Nombre; Comando.Parameters.Add("ENTRADA", OracleDbType.NVarchar2).Value = P.Entrada; Comando.Parameters.Add("SALIDA", OracleDbType.NVarchar2).Value = P.Salida; Comando.ExecuteNonQuery(); return($"Paso {P.ToString()} Guardado Satisfactoriamente"); } }
private void RegistrarPaso(string Pre, string Post, string Nombre) { //OPTIMIZAR ESTE FILTRO, SEDE DEMASIADO ANTE CUALQUIER CAMBIO PEQUEÑO if (!Pre.Equals(Post)) { //CREAR PASO Y AGREGARLO A LA LISTA Paso = new Pasos(Pre, Post, Nombre); Conexion.Open(); Paso.SetId(DAL.SiguientePaso()); Conexion.Close(); Paso.SetFuncion(Funcion_id); Paso.SetId(Resultado_id); LPasos.Add(Paso); } }
void DecodConversacionEspia(ref string[] partes, Pasos p, StreamReader file) { if (partes[0] == "--") { partes = file.ReadLine().Split(':'); while (!file.EndOfStream && partes [0] != "--") { FraseEspia fr = new FraseEspia(); fr.nombre = partes [0]; fr.frase = partes [1]; p.frasesEspia.Enqueue(fr); partes = file.ReadLine().Split(':'); } partes = file.ReadLine().Split(':'); p.frasesEspia.Enqueue(null); } }
private void BotonInstalar_Click(object sender, EventArgs e) { BotonInstalar.Enabled = false; BotonSiguiente.Enabled = false; EtiquetaDescargando.Text = "Descargando, por favor aguarde..."; EtiquetaDescargando.Visible = true; ProgresoDescargando.Visible = true; if (this.ThreadDescargar != null) { this.ThreadDescargar.Abort(); this.ThreadDescargar = null; } Lfx.Types.OperationProgress Progreso = new Lfx.Types.OperationProgress("Instalar servidor SQL", "Se está descargando, instalando y configurando un servidor SQL en este equipo"); Progreso.Advertise = false; Progreso.Modal = false; Progreso.Begin(); System.Threading.ThreadStart Buscar = delegate { this.DescargarEInstalar(Progreso); }; this.ThreadDescargar = new System.Threading.Thread(Buscar); this.ThreadDescargar.IsBackground = true; this.ThreadDescargar.Start(); while (Progreso != null && Progreso.IsRunning) { System.Threading.Thread.Sleep(100); EtiquetaDescargando.Text = Progreso.Status; System.Windows.Forms.Application.DoEvents(); if (this.ThreadDescargar == null) { // Cancelar return; } } EtiquetaDescargando.Text = "Continuando..."; Paso = Inicial.Pasos.DatosEmpresa; this.MostrarPaneles(); }
private void BotonInstalar_Click(object sender, EventArgs e) { BotonInstalar.Enabled = false; BotonSiguiente.Enabled = false; EtiquetaDescargando.Text = "Descargando, por favor aguarde..."; EtiquetaDescargando.Visible = true; ProgresoDescargando.Visible = true; if (this.ThreadDescargar != null) { this.ThreadDescargar.Abort(); this.ThreadDescargar = null; } Lfx.Types.OperationProgress Progreso = new Lfx.Types.OperationProgress("Instalar servidor SQL", "Se está descargando, instalando y configurando un servidor SQL en este equipo"); Progreso.Advertise = false; Progreso.Modal = false; Progreso.Begin(); System.Threading.ThreadStart Buscar = delegate { this.DescargarEInstalar(Progreso); }; this.ThreadDescargar = new System.Threading.Thread(Buscar); this.ThreadDescargar.IsBackground = true; this.ThreadDescargar.Start(); while (Progreso != null && Progreso.IsRunning) { System.Threading.Thread.Sleep(100); EtiquetaDescargando.Text = Progreso.Status; System.Windows.Forms.Application.DoEvents(); if (this.ThreadDescargar == null) // Cancelar return; } EtiquetaDescargando.Text = "Continuando..."; Paso = Inicial.Pasos.DatosEmpresa; this.MostrarPaneles(); }
private void BotonAnterior_Click(object sender, EventArgs e) { BotonSiguiente.Visible = true; switch (Paso) { case Inicial.Pasos.NombreServidor: Paso = Inicial.Pasos.SeleccionarAlmacen; break; case Inicial.Pasos.PruebaServidor: if (RadioInicioInstalacionLocal.Checked) Paso = Inicial.Pasos.Inicio; else if (CheckEsteEquipo.Checked) Paso = Inicial.Pasos.SeleccionarAlmacen; else if (CheckOtroEquipo.Checked) Paso = Inicial.Pasos.NombreServidor; break; case Inicial.Pasos.Deteccion: case Inicial.Pasos.InstalarServidor: case Inicial.Pasos.Final: case Inicial.Pasos.DatosEmpresa: default: Paso = Inicial.Pasos.Inicio; break; } this.MostrarPaneles(); }
private void BotonSiguiente_Click(object sender, EventArgs e) { switch (Paso) { case Inicial.Pasos.Inicio: if (RadioInicioInstalacionLocal.Checked) Paso = Inicial.Pasos.InstalarServidor; else if (RadioInicioConexionRemota.Checked) Paso = Inicial.Pasos.Deteccion; break; case Inicial.Pasos.Deteccion: Paso = Inicial.Pasos.SeleccionarAlmacen; break; case Inicial.Pasos.SeleccionarAlmacen: if (CheckEsteEquipo.Checked) { Paso = Inicial.Pasos.PruebaServidor; } else if (CheckOtroEquipo.Checked) { Paso = Inicial.Pasos.NombreServidor; } else if (CheckInstalarAhora.Checked) { Paso = Inicial.Pasos.InstalarServidor; } else if (CheckConfigAvanzada.Checked) { using (Config.ConfigurarBd ConfigBD = new Config.ConfigurarBd()) { this.Hide(); if (ConfigBD.ShowDialog() == DialogResult.Cancel) { this.Show(); } else { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } } break; case Inicial.Pasos.NombreServidor: if (EntradaServidor.Text.Length == 0) { Lui.Forms.MessageBox.Show("Por favor escriba el nombre del equipo.", "Error"); } else { Paso = Inicial.Pasos.PruebaServidor; } break; case Inicial.Pasos.PruebaServidor: if (Lfx.Workspace.Master.MasterConnection.IsOpen() && Lfx.Workspace.Master.IsPrepared()) { int PaisActual = Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting<int>("Sistema.Pais", 0); if (PaisActual == 0) Paso = Pasos.DatosEmpresa; else Paso = Pasos.Final; } else { Paso = Inicial.Pasos.Final; } break; case Pasos.DatosEmpresa: if (EntradaPais.Elemento == null || EntradaEmpresaNombre.Text.Length < 3 || EntradaEmpresaEmail.Text.Length < 3 || EntradaEmpresaEmail.Text.IndexOf('@') < 0) { Lui.Forms.MessageBox.Show("Por favor proporcione los datos de la empresa antes de continuar.", "Error"); } else { Paso = Pasos.Final; } break; case Inicial.Pasos.Final: this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); return; case Inicial.Pasos.InstalarServidor: if (BotonInstalar.Enabled) BotonInstalar.PerformClick(); else this.Paso = 0; break; } this.MostrarPaneles(); }
private void BotonConfiguracionAvanzada2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Paso = Pasos.SeleccionarAlmacen; MostrarPaneles(); }
private void BotonDetectar_Click(object sender, EventArgs e) { Paso = Pasos.Deteccion; this.MostrarPaneles(); }
private void BotonSiguiente_Click(object sender, EventArgs e) { switch (Paso) { case Inicial.Pasos.Inicio: //Se Configura la base de datos. using (Config.ConfigurarBd ConfigBD = new Config.ConfigurarBd()) { this.Hide(); if (ConfigBD.ShowDialog() == DialogResult.Cancel) { this.Show(); } else { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); Paso = Inicial.Pasos.PruebaServidor; } } break; case Inicial.Pasos.Password: //Paso = Inicial.Pasos.Inicio; break; case Inicial.Pasos.PruebaServidor: //Prueba si el servidor se encuentra bíen if (Lfx.Workspace.Master.MasterConnection.IsOpen() && Lfx.Workspace.Master.IsPrepared()) { int PaisActual = Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting <int>("Sistema.Pais", 0); if (PaisActual == 0) { Paso = Pasos.DatosEmpresa; } else { Paso = Pasos.Final; } } else { Paso = Inicial.Pasos.Final; } break; case Pasos.DatosEmpresa: //Si esta bíen el servidor y es primera vez se ingresa empresa. if (EntradaPais.Elemento == null || EntradaEmpresaNombre.Text.Length < 3 || EntradaEmpresaEmail.Text.Length < 3 || EntradaEmpresaEmail.Text.IndexOf('@') < 0) { Lui.Forms.MessageBox.Show("Por favor proporcione los datos de la empresa antes de continuar.", "Error"); } else { Paso = Pasos.Final; } break; case Inicial.Pasos.Final: this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); return; } this.MostrarPaneles(); }
public async Task <Pasos> GetPasosById(String idpaso) { Pasos paso = await _pasos.Find(x => x.id == idpaso).FirstAsync(); return(paso); }
private void BotonAnterior_Click(object sender, EventArgs e) { BotonSiguiente.Visible = true; Paso = Inicial.Pasos.Inicio; this.MostrarPaneles(); }
public async Task <Pasos> GetPasoByNombreExpediente(String nombreexpediente) { Pasos paso = await _pasos.Find(x => x.nombreexpediente == nombreexpediente).FirstAsync(); return(paso); }
//Decodifica la mision void DecodificaMision(StreamReader file, string [] partes) { //Tipo de mision: None = 0, Espionaje = 1, DarObjeto = 2. tipoDeMision = (TipoDeMision)int.Parse(partes[2]); //Asignamos el titulo de la mision si la mision no es de tipo None if (tipoDeMision != TipoDeMision.None) { tituloDeLaMision = partes [4]; } else { tituloDeLaMision = null; } //Comenzamos decodificacion de los textos if (!file.EndOfStream) { //Depende del tipo de mision decofificamos de una forma u otra //Hasta que encuentre el final con "" string linea = file.ReadLine(); while (linea != "" && linea != null && !file.EndOfStream) { string[] aux; switch (linea) { //Usaremos # como marca de que empieza y termina la conversación //y ## como marca de que empiezan y terminan los pasos. case "#": linea = file.ReadLine(); do { conversacion.Enqueue(linea); linea = file.ReadLine(); } while(linea != "#"); break; //Para los pasos case "##": aux = file.ReadLine().Split(':'); do { Pasos p = new Pasos(); p.lineaPaso = aux [0]; p.tagObjeto = aux [1]; pasos.Enqueue(p); aux = file.ReadLine().Split(':'); //Si es de Espionaje, decodificará la conversación que se espia DecodConversacionEspia(ref aux, p, file); } while(aux [0] != "##"); break; case "###": linea = file.ReadLine(); do { finMision.Enqueue(linea); linea = file.ReadLine(); } while(linea != "###"); break; } linea = file.ReadLine(); } conversacion.Enqueue(null); finMision.Enqueue(null); pasos.Enqueue(null); } else { tipoDeMision = TipoDeMision.None; } }
private void BotonSiguiente_Click(object sender, EventArgs e) { switch (Paso) { case Inicial.Pasos.Inicio: if (RadioInicioInstalacionLocal.Checked) { Paso = Inicial.Pasos.InstalarServidor; } else if (RadioInicioConexionRemota.Checked) { Paso = Inicial.Pasos.Deteccion; } break; case Inicial.Pasos.Deteccion: Paso = Inicial.Pasos.SeleccionarAlmacen; break; case Inicial.Pasos.SeleccionarAlmacen: if (CheckEsteEquipo.Checked) { Paso = Inicial.Pasos.PruebaServidor; } else if (CheckOtroEquipo.Checked) { Paso = Inicial.Pasos.NombreServidor; } else if (CheckInstalarAhora.Checked) { Paso = Inicial.Pasos.InstalarServidor; } else if (CheckConfigAvanzada.Checked) { using (Config.ConfigurarBd ConfigBD = new Config.ConfigurarBd()) { this.Hide(); if (ConfigBD.ShowDialog() == DialogResult.Cancel) { this.Show(); } else { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } } break; case Inicial.Pasos.NombreServidor: if (EntradaServidor.Text.Length == 0) { Lui.Forms.MessageBox.Show("Por favor escriba el nombre del equipo.", "Error"); } else { Paso = Inicial.Pasos.PruebaServidor; } break; case Inicial.Pasos.PruebaServidor: if (Lfx.Workspace.Master.MasterConnection.IsOpen() && Lfx.Workspace.Master.IsPrepared()) { int PaisActual = Lfx.Workspace.Master.CurrentConfig.ReadGlobalSetting <int>("Sistema.Pais", 0); if (PaisActual == 0) { Paso = Pasos.DatosEmpresa; } else { Paso = Pasos.Final; } } else { Paso = Inicial.Pasos.Final; } break; case Pasos.DatosEmpresa: if (EntradaPais.Elemento == null || EntradaEmpresaNombre.Text.Length < 3 || EntradaEmpresaEmail.Text.Length < 3 || EntradaEmpresaEmail.Text.IndexOf('@') < 0) { Lui.Forms.MessageBox.Show("Por favor proporcione los datos de la empresa antes de continuar.", "Error"); } else { Paso = Pasos.Final; } break; case Inicial.Pasos.Final: this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); return; case Inicial.Pasos.InstalarServidor: if (BotonInstalar.Enabled) { BotonInstalar.PerformClick(); } else { this.Paso = 0; } break; } this.MostrarPaneles(); }