public static Boolean ActualizarEstadoProceso(int estado, int refProceso, String nombreProceso) { try { var command = new MySqlCommand() { CommandText = "Actualizar_Estado_Proceso", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_estado", Direction = System.Data.ParameterDirection.Input, Value = estado }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refProceso", Direction = System.Data.ParameterDirection.Input, Value = refProceso }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombreProceso", Direction = System.Data.ParameterDirection.Input, Value = nombreProceso }); var datos = ContexDb.ExecuteProcedure(command); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
public static int ActualizarInstitucion(int IdInstitucion, string Abreviatura, string Nombre) { int result; try { var command = new MySqlCommand() { CommandText = "Actualizar_Institucion", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = IdInstitucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_abreviacion", Direction = System.Data.ParameterDirection.Input, Value = Abreviatura }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = Nombre }); var datos = ContexDb.ExecuteProcedure(command); result = 1; } catch (Exception ex) { Console.WriteLine(ex.ToString()); result = -1; } return(result); }
/*###########################################Fin leer######################################################*/ /*#############################################Actualizar##################################################*/ public static void ActualizarEstadoUsuarioRepresentate(int refRepresentante, string estado) { try { var command = new MySqlCommand() { CommandText = "Modificar_crearProceso_usuario_representante", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refResponsable", Direction = System.Data.ParameterDirection.Input, Value = refRepresentante }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_estado", Direction = System.Data.ParameterDirection.Input, Value = estado }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_nombre", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //return datos.Parameters["out_nombre"].Value.ToString(); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } //return null; }
public static void Actualizar_Proceso_Resolucion_DecGatos(int proceso, int id_proceso, int id_procesoActual) { try { var command = new MySqlCommand() { CommandText = "actualizar_estado_proceso", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_proceso", Direction = System.Data.ParameterDirection.Input, Value = id_proceso }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id_procesoFondo", Direction = System.Data.ParameterDirection.Input, Value = id_proceso }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id_proceso_actual", Direction = System.Data.ParameterDirection.Input, Value = id_procesoActual }); var datos = ContexDb.ExecuteProcedure(command); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
/// <summary> /// Se encarga de eliminar una solicitud en particular y por ende elimina el proceso (Para realizar esta eliminacion, el proceso /// no debe tener asignado una resolucion y una declaracion de gasto) /// (1) Indica que se ha eliminado la solicitud correctamente /// (-1) Existen problemas de conexion con la base de datos o el parametro ingresado en la variable id no es correcto /// (-2) Aun existe la solicitud en la BD /// </summary> /// <param name="id"></param> /// <returns>1, -1 o -2</returns> public static int EliminarSolicitud(int id) { try { var command = new MySqlCommand() { CommandText = "Eliminar_solicitud", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = id }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_validacion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_validacion"].Value)); } catch (Exception ex) { Console.WriteLine(ex); } return(-1); }
public static String ModificarEstadoResponsable(string refResponsable, string estado) { try { var command = new MySqlCommand() { CommandText = "cambiar_estado_responsable", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refResponsable", Direction = System.Data.ParameterDirection.Input, Value = refResponsable }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_estado", Direction = System.Data.ParameterDirection.Input, Value = estado }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_nombre", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(datos.Parameters["out_nombre"].Value.ToString()); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(null); }
public static int EliminarDocumentosDG(int IdDeclaracionGastos) { try { var command = new MySqlCommand() { CommandText = "Eliminar_documentos_declaracion_gastos", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idDeclaracionGastos", Direction = System.Data.ParameterDirection.Input, Value = IdDeclaracionGastos }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_validacion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_validacion"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
public static void AgregarCategoria(int idSolicitud, int idCategoria, DateTime FechaModificacion) { try { var command = new MySqlCommand() { CommandText = "Agregar_categoria", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = idSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refCategoria", Direction = System.Data.ParameterDirection.Input, Value = idCategoria }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaModificacion", Direction = System.Data.ParameterDirection.Input, Value = FechaModificacion }); var datos = ContexDb.ExecuteProcedure(command); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static void AgregarParticipante(Persona persona) { try { var command = new MySqlCommand() { CommandText = "Agregar_Participante", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = persona.Nombre }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_run", Direction = System.Data.ParameterDirection.Input, Value = persona.RUN }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static void EliminarPersona(SolicitudPersona solper) { try { var command = new MySqlCommand() { CommandText = "eliminar_persona_seleccionada", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = solper.RefSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refPersona", Direction = System.Data.ParameterDirection.Input, Value = solper.RefPersona }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static int ActualizarTipoOE(int IdTipoOE, string Nombre, string NombreExtendido) { int result; try { var command = new MySqlCommand() { CommandText = "Actualizar_TipoOE", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = IdTipoOE }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = Nombre }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombreExtendido", Direction = System.Data.ParameterDirection.Input, Value = NombreExtendido }); var datos = ContexDb.ExecuteProcedure(command); result = 1; } catch (Exception ex) { Console.WriteLine(ex.ToString()); result = -1; } return(result); }
public static void AgregarProcesoFondo(int refOrganizacion, int refSolicitud, int estado) { try { var command = new MySqlCommand() { CommandText = "crear_proceso_fondo", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refOrganizacion", Direction = System.Data.ParameterDirection.Input, Value = refOrganizacion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = refSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_estado", Direction = System.Data.ParameterDirection.Input, Value = estado }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static void AgregarCategoria(SolicitudCategoria categoria) { try { var command = new MySqlCommand() { CommandText = "agregar_categoria", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = categoria.RefSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refCategoria", Direction = System.Data.ParameterDirection.Input, Value = categoria.RefCategoria }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static void AgregarParSol(String refParticipante, int refSolicitud, DateTime FechaModificacion) { try { var command = new MySqlCommand() { CommandText = "Agregar_parsol", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refParticipante", Direction = System.Data.ParameterDirection.Input, Value = refParticipante }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = refSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaModificacion", Direction = System.Data.ParameterDirection.Input, Value = FechaModificacion }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); //saber.Id = Convert.ToInt32(datos.Parameters["out_id"].Value); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static Boolean EliminarParticipante(int IdSolicitud, String IdParticipante, DateTime FechaModificacion) { try { var command = new MySqlCommand() { CommandText = "Eliminar_Participante", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = IdSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refParticipante", Direction = System.Data.ParameterDirection.Input, Value = IdParticipante }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaModificacion", Direction = System.Data.ParameterDirection.Input, Value = FechaModificacion }); //command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
/*#############################################Crear Resolucion|######################################################*/ public static int CrearResolucion(Resolucion resolucion) { try { var command = new MySqlCommand() { CommandText = "crear_resolucion", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idResolucion", Direction = System.Data.ParameterDirection.Input, Value = resolucion.NumeroResolucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_anio", Direction = System.Data.ParameterDirection.Input, Value = resolucion.AnioResolucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_copiaDocumento", Direction = System.Data.ParameterDirection.Input, Value = resolucion.CopiaDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_id"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
public static int DocumentoSeleccionado(int Estado, int IdDocumento) { try { var command = new MySqlCommand() { CommandText = "Modificar_seleccion_documento", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idDocumento", Direction = System.Data.ParameterDirection.Input, Value = IdDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_estado", Direction = System.Data.ParameterDirection.Input, Value = Estado }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_validacion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_validacion"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
internal static int ModificarDocumento(Documento Documento) { try { var command = new MySqlCommand() { CommandText = "Actualizar_documento", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = Documento.Id }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_codigoDocumento", Direction = System.Data.ParameterDirection.Input, Value = Documento.CodigoDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_proveedor", Direction = System.Data.ParameterDirection.Input, Value = Documento.Proveedor }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaDocumento", Direction = System.Data.ParameterDirection.Input, Value = Documento.FechaDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_monto", Direction = System.Data.ParameterDirection.Input, Value = Documento.Monto }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_descripcionDocumento", Direction = System.Data.ParameterDirection.Input, Value = Documento.DescripcionDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_tipoDocumento", Direction = System.Data.ParameterDirection.Input, Value = Documento.TipoDocumento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_copiaDoc", Direction = System.Data.ParameterDirection.Input, Value = Documento.CopiaDoc }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refCategoria", Direction = System.Data.ParameterDirection.Input, Value = Documento.Categoria.Id }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_validacion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_validacion"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
/*#############################################Crear Solicitud######################################################*/ public static int CrearSolicitud(Solicitud solicitud) { try { var command = new MySqlCommand() { CommandText = "Crear_solicitud", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fecha", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaCreacion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_monto", Direction = System.Data.ParameterDirection.Input, Value = solicitud.Monto }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombreEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.NombreEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaInicioEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaInicioEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaTerminoEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaTerminoEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_lugarEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.LugarEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_tipoActividad", Direction = System.Data.ParameterDirection.Input, Value = solicitud.TipoEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaCreacionPDF", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaFinPdf }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaModificacion", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaModificacion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_id"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
/*###########################################Fin leer Solicitud######################################################*/ /*#############################################Actualizar Solicitud##################################################*/ public static void Actualizar_Solicitud(Solicitud solicitud) { try { var command = new MySqlCommand() { CommandText = "actualizar_solicitud", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = solicitud.Id }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fecha", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaActual }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_monto", Direction = System.Data.ParameterDirection.Input, Value = solicitud.Monto }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombreEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.NombreEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaInicioEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaInicioEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaTerminoEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaTerminoEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_runEncargado", Direction = System.Data.ParameterDirection.Input, Value = solicitud.RutResponsable }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_lugarEvento", Direction = System.Data.ParameterDirection.Input, Value = solicitud.LugarEvento }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_tipoActividad", Direction = System.Data.ParameterDirection.Input, Value = solicitud.TipoActividad }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaCreacionPDF", Direction = System.Data.ParameterDirection.Input, Value = solicitud.FechaFinPdf }); var datos = ContexDb.ExecuteProcedure(command); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
/*#############################################Crear######################################################*/ public static List <int> CrearResolucion(int anioResolucion, int numeroResolucion, string refSolicitud, string ruta) { try { var command = new MySqlCommand() { CommandText = "Crear_resolucion", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = refSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_anioResolucion", Direction = System.Data.ParameterDirection.Input, Value = anioResolucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_numeroResolucion", Direction = System.Data.ParameterDirection.Input, Value = numeroResolucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_ruta", Direction = System.Data.ParameterDirection.Input, Value = ruta }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id_resolucion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_id_declaracion_gastos", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); List <int> ids = new List <int>(); ids.Add(Convert.ToInt32(datos.Parameters["out_id_resolucion"].Value)); ids.Add(Convert.ToInt32(datos.Parameters["out_id_declaracion_gastos"].Value)); return(ids); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(null); }
public static bool ActualizarOrganizacion(string nombre, string email, int idCampus, int idTipoOE, int idOE, int idInstitucion) { try { var command = new MySqlCommand() { CommandText = "Actualizar_OE", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = idOE }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = nombre }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_email", Direction = System.Data.ParameterDirection.Input, Value = email }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_Campus", Direction = System.Data.ParameterDirection.Input, Value = idCampus }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_TipoOE", Direction = System.Data.ParameterDirection.Input, Value = idTipoOE }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idInstitucion", Direction = System.Data.ParameterDirection.Input, Value = idInstitucion }); ContexDb.ExecuteProcedure(command); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
public static bool EliminarOE(int IdOE) { try { var command = new MySqlCommand() { CommandText = "Eliminar_OE", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = IdOE }); ContexDb.ExecuteProcedure(command); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
public static bool ActualizarFechaLimiteDG(int id) { try { var command = new MySqlCommand() { CommandText = "Actualizar_FechaLimite_DG", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idDG", Direction = System.Data.ParameterDirection.Input, Value = id }); ContexDb.ExecuteProcedure(command); return(true); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(false); }
public static int ModificarParticipante(String Nombre, String Run, int IdSolicitud, DateTime FechaModificacion) { try { var command = new MySqlCommand() { CommandText = "Actualizar_participante", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = Nombre }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_run", Direction = System.Data.ParameterDirection.Input, Value = Run }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_idSolicitud", Direction = System.Data.ParameterDirection.Input, Value = IdSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_fechaModificacion", Direction = System.Data.ParameterDirection.Input, Value = FechaModificacion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_validacion", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); return(Convert.ToInt32(datos.Parameters["out_validacion"].Value)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(-1); }
public static void ModificarResponsableFondo(int RefSolicitud, int RefResponsable) { try { var command = new MySqlCommand() { CommandText = "Modificar_responsable_proceso", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = RefSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refResponsable", Direction = System.Data.ParameterDirection.Input, Value = RefResponsable }); var datos = ContexDb.ExecuteProcedure(command); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static void Cambiar_clave(string Email, string Clave) { try { var command = new MySqlCommand() { CommandText = "cambiar_clave", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_correo", Direction = System.Data.ParameterDirection.Input, Value = Email }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_clave", Direction = System.Data.ParameterDirection.Input, Value = Clave }); var datos = ContexDb.ExecuteProcedure(command); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
internal static void Leer_Id_Proceso() { try { if (ConsultasGenerales.idSolicitud != -1) { var command = new MySqlCommand() { CommandText = "leer_id_proceso", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refSolicitud", Direction = System.Data.ParameterDirection.Input, Value = ConsultasGenerales.idSolicitud }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refResolucion", Direction = System.Data.ParameterDirection.Input, Value = ConsultasGenerales.idResolucion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "in_refDeclaracionGastos", Direction = System.Data.ParameterDirection.Input, Value = ConsultasGenerales.idRendicion }); command.Parameters.Add(new MySqlParameter() { ParameterName = "out_idProceso", Direction = System.Data.ParameterDirection.Output, Value = -1 }); var datos = ContexDb.ExecuteProcedure(command); ConsultasGenerales.idProceso = Convert.ToInt32(datos.Parameters["idProceso"]); SetId(); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static int EliminarCampus(int IdCampus) { int result; try { var command = new MySqlCommand() { CommandText = "Eliminar_Campus", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = IdCampus }); var datos = ContexDb.ExecuteProcedure(command); result = 1; } catch (Exception ex) { Console.WriteLine(ex.ToString()); result = -1; } return(result); }
public static int CrearCategoria(string Nombre) { int result; try { var command = new MySqlCommand() { CommandText = "Crear_Categoria", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_nombre", Direction = System.Data.ParameterDirection.Input, Value = Nombre }); var datos = ContexDb.ExecuteProcedure(command); result = 1; } catch (Exception ex) { Console.WriteLine(ex.ToString()); result = -1; } return(result); }