/*###########################################Fin crear####################################################*/ /*#############################################Leer######################################################*/ /// <summary> /// Muestra los datos de la resolucion en base al id de la resolucion /// </summary> /// <param name="id"></param> /// <returns></returns> public static Resolucion LeerResolucion(int id) { try { var command = new MySqlCommand() { CommandText = "Leer_Resolucion", CommandType = System.Data.CommandType.StoredProcedure }; command.Parameters.Add(new MySqlParameter() { ParameterName = "in_id", Direction = System.Data.ParameterDirection.Input, Value = id }); var datos = ContexDb.GetDataSet(command); if (datos.Tables[0].Rows.Count == 1) { Resolucion resolucion; var prodData = datos.Tables[0].Rows[0]; resolucion = new Resolucion() { Id = Convert.ToInt32(prodData["id"]), NumResolucion = Convert.ToInt32(prodData["numero"]), AnioResolucion = Convert.ToInt32(prodData["anio"]), CopiaDoc = prodData["copiaDoc"].ToString() }; return(resolucion); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(null); }
/*#############################################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 async Task <IActionResult> Edit(int id, [Bind("ResolcuionId,IDCarpeta,AgrupacionSocial,Poligono,Expediente,ClaseResolucion,TipoResolucion,FechaRegistro,Id")] Resolucion resolucion) { if (id != resolucion.ResolcuionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(resolucion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResolucionExists(resolucion.ResolcuionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Users, "Id", "Id", resolucion.Id); return(View(resolucion)); }
public List <Resolucion> BuscarResolucioness(int mes, int anno) { List <Resolucion> resoluciones = new List <Resolucion>(); OracleConnection con = new OracleConnection(); con.ConnectionString = ConexionSQL.conexionString; con.Open(); OracleCommand cmd = con.CreateCommand(); cmd.CommandText = "select r.id_resolucion, r.fec_resolucion,r.estado_resolucion, r.permiso_id_permiso, r.resolvente_run_sin_dv " + "FROM resolucion r " + "JOIN sol_permiso s on r.permiso_id_permiso = s.id_permiso " + "WHERE extract(MONTH FROM s.fecha_termino) = (" + mes + " - 1) AND extract(YEAR FROM s.fecha_termino) = " + anno; OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Resolucion resolucion = new Resolucion(); resolucion.Id = reader.GetInt32(0); resolucion.FechaResolucion = reader.GetDateTime(1); resolucion.Estado = (parseNullableInt(reader.GetValue(2).ToString()) == null) ? (EstadoResolucion)2 : (EstadoResolucion)reader.GetInt32(2); if (parseNullableInt(reader.GetValue(3).ToString()) != null) { resolucion.Permiso = new GestionadorPermiso().BuscarPermisoFull(reader.GetInt32(3)); } if (parseNullableInt(reader.GetValue(4).ToString()) != null) { resolucion.Resolvente = new GestionadorFuncionario().BuscarFuncionarioParcial(reader.GetInt32(4)); } resoluciones.Add(resolucion); } con.Close(); return(resoluciones); }
public List <Resolucion> GetResolucionesPorActa(string idActa) { List <Resolucion> lista = new List <Resolucion>(); string sql = @"SELECT R.[id] as id, R.[cuerpo] as cuerpo FROM [dbo].[DetalleActa] DA INNER JOIN [dbo].[Resoluciones] R ON DA.[idResolucion] = R.[id] WHERE DA.[idActa] = @idActa Order by R.[id] asc"; using (SqlConnection connection = new SqlConnection(GetConnectionString())) { using (SqlCommand command = new SqlCommand(sql, connection)) { command.Parameters.AddWithValue("@idActa", idActa); connection.Open(); SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { Resolucion r = new Resolucion(); r.id = reader["id"].ToString(); r.cuerpo = reader["cuerpo"].ToString(); lista.Add(r); } reader.Close(); } } return(lista); }
// EL NOMBRE DEL ARCHIVO ES LA CONFIGURACION PERSONAL SI ARCHIVO ES NULO POR DEFECTO SERÁ Player public static bool GuardarConfiguraciones(String archivo) { if (archivo == null) { archivo = "Player"; } int error = 0; String directorio = "config/" + archivo + ".txt"; ConfigParam[] save = new ConfigParam[7]; Resolucion CONFIG = Menu.Controladores.ControladorConfiguraciones.controlador.getResolucion(Menu.Controladores.ControladorConfiguraciones.controlador.ResolucionActual); save[0] = new ConfigParam("Height", CONFIG.resolucion.Height); save[1] = new ConfigParam("Width", CONFIG.resolucion.Width); save[2] = new ConfigParam("Frecuencia", CONFIG.Frecuencia); save[3] = new ConfigParam("Arriba", Menu.Controladores.ControladorConfiguraciones.controlador.KeyArriba.ToString()); save[4] = new ConfigParam("Abajo", Menu.Controladores.ControladorConfiguraciones.controlador.KeyAbajo.ToString()); save[5] = new ConfigParam("Izquierda", Menu.Controladores.ControladorConfiguraciones.controlador.KeyIzquierda.ToString()); save[6] = new ConfigParam("Derecha", Menu.Controladores.ControladorConfiguraciones.controlador.KeyDerecha.ToString()); configuraciones = save.ToList(); saveSettings(directorio, configuraciones.ToArray(), configuraciones.Count, out error); if (error == 0) { errorOcurrido = false; } else { errorOcurrido = true; } return(errorOcurrido); }
public async Task <Object []> EliminarResolucion(int id_tipo_resolucion, int id_valor_resolucion, int id_relacion_aspecto) { Object [] response = new Object [2]; try { Resolucion resolutionToToDelete = await AppDbContext.resoluciones.Where(r => r.id_tipo_resolucion == id_tipo_resolucion && r.id_valor_resolucion == id_valor_resolucion && r.id_relacion_aspecto == id_relacion_aspecto).FirstOrDefaultAsync(); List <DetalleTecnico> detallesTecnicos = await AppDbContext.detallesTecnicos.Where(dt => dt.id_tipo_resolucion == resolutionToToDelete.id_tipo_resolucion && dt.id_valor_resolucion == resolutionToToDelete.id_valor_resolucion && dt.id_relacion_aspecto == resolutionToToDelete.id_relacion_aspecto).ToListAsync(); foreach (DetalleTecnico detalleTecnico in detallesTecnicos) { await EliminarDetalleTecnico(detalleTecnico.id_detalle); } AppDbContext.resoluciones.Remove(resolutionToToDelete); await AppDbContext.SaveChangesAsync(); response[0] = true; } catch (Exception exception) { response[1] = (exception.InnerException != null) ? exception.InnerException.Message : exception.Message; } return(response); }
public async Task <IActionResult> Create([Bind("ResolcuionId,IDCarpeta,AgrupacionSocial,Poligono,Expediente,ClaseResolucion,TipoResolucion,FechaRegistro,Id")] Resolucion resolucion) { if (ModelState.IsValid) { _context.Add(resolucion); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Users, "Id", "Id", resolucion.Id); return(View(resolucion)); }
/*public IActionResult AgregarResolucion(Resolucion resolucion) * { * resolucion.RefSolicitud= _requestHandler.GetIdSolicitud(); * return IrPrincipal(); * }*/ //public IActionResult AgregarResolucion([Bind("NumeroResolucion,AnioResolucion")] Resolucion resolucion) public IActionResult AgregarResolucion([Bind("NumeroResolucion,AnioResolucion")] Resolucion resolucion) { ViewData["_usuario"] = _requestHandler.GetUsuario(); if (ModelState.IsValid) { int idproceso = _requestHandler.GetIdProceso(); int idResolucion = ConsultaResolucion.CrearResolucion(resolucion); ConsultasGenerales.Actualizar_Proceso_Resolucion_DecGatos(2, idproceso, idResolucion); //el dos significa que se agregara el id de la resolucion int estado = 3; /*Representa el estado de la resolucion finalizada*/ ConsultasGenerales.Actualizar_Estado_Proceso(idproceso, estado); return(RedirectToAction("TablaSolicitudes", "Principal")); } return(View(resolucion)); }
public async Task <Object []> CrearResolucion(Resolucion resolucion) { Object [] response = new Object [2]; try { await AppDbContext.resoluciones.AddAsync(resolucion); await AppDbContext.SaveChangesAsync(); response[0] = true; } catch (Exception exception) { response[1] = (exception.InnerException != null) ? exception.InnerException.Message : exception.Message; } return(response); }
private void GuardarBaseDatos(string cuerpo, string filename) { Resolucion r = new Resolucion(); r.id = filename; r.cuerpo = cuerpo; r.idTipo = "1"; r.estado = "Pendiente"; if (log.InsertResolucion(r) > 0) { this.Response.Write("<script language='JavaScript'>window.alert('Ingresado Correctamente')</script>"); } else { this.Response.Write("<script language='JavaScript'>window.alert('ya existe')</script>"); } }
public void ToggleAdaptativo(bool adap) { if (adap) { GraficosSlider.enabled = false; PlayerPrefs.SetInt(pref_graf_b, 1); PlayerPrefs.SetFloat(pref_graf_f, 0.667f); Resolucion.NewResMaster(0.667f); } else { GraficosSlider.value = 0.667f; GraficosSlider.enabled = true; PlayerPrefs.SetInt(pref_graf_b, 0); PlayerPrefs.SetFloat(pref_graf_f, 0.667f); Resolucion.NewResMaster(0.667f); } }
public IList <Resolucion> generarResolucion(int unidad, int año, int mes) { IList <Resolucion> reportes = new List <Resolucion>(); ConsumirWS ws = new ConsumirWS(); solicitudes = new NegocioSolicitud().listado(); departamentos = new NegocioDepartamento().listado(); empleados = new NegocioEmpleado().listado(); listTipoPermiso = new NegocioTipoPermiso().listado(); var query = from s in solicitudes join t in listTipoPermiso on s.idTipoPermiso equals t.idTipoPermiso join e in empleados on s.rutSolicitante equals e.rut join d in departamentos on e.idDepartamento equals d.idDepartamento where d.idDepartamento == unidad && s.idEstado == 3 && s.fechaSolicitud.Year == año && s.fechaSolicitud.Month == mes group s by new { e.rut, t.nombreTipoPermiso, d.nombreDepartamento, s.fechaInicio, s.fechaTermino } into r select new { rut = r.Key.rut, nombrePermiso = r.Key.nombreTipoPermiso, departamento = r.Key.nombreDepartamento, fechaInicio = r.Key.fechaInicio, fechaTermino = r.Key.fechaTermino, cantidad = r.Count(c => c.idSolicitud != null) }; foreach (var item in query) { Resolucion resolucion = new Resolucion(); resolucion.cantidadPermisos = item.cantidad; resolucion.nombreTipoPermiso = item.nombrePermiso; resolucion.rut = item.rut; resolucion.departamento = item.departamento; if (ws.comprobarAsistencia(item.rut, item.fechaInicio.ToString("dd/MM/yyyy"), item.fechaTermino.ToString("dd/MM/yyyy"))) { reportes.Add(resolucion); } } return(reportes); }
//Recibe un string con formato xml y lo convierte en una lista de resolucion public List <Resolucion> DesempaquetarListaXml(string xml) { //Se crea la representacion de un documento xml XDocument doc = XDocument.Parse(xml); //Se pasan lo elementos del documento IEnumerable <XElement> resolucionesXML = doc.Root.Elements(); //Variable de salida List <Resolucion> resoluciones = new List <Resolucion>(); //Se recorren los elementos del xml y se crean funcionarios foreach (var resolucionXML in resolucionesXML) { Resolucion resolucion = new Resolucion(); //Se cargan los datos del funcionario con la informacion del documento resolucion.LeerXML(resolucionXML); //Se agrega el funcionario a la lista de salida resoluciones.Add(resolucion); } return(resoluciones); }
public int InsertResolucion(Resolucion m) { int afectadas; if (GetIDporResolucion(m.id).Equals("0")) { string sql = @"INSERT INTO[dbo].[Resoluciones] ([id] ,[idTipo] ,[estado] ,[cuerpo]) VALUES (@id ,@idTipo ,@estado ,@cuerpo)"; using (SqlConnection connection = new SqlConnection(GetConnectionString())) { using (SqlCommand command = new SqlCommand(sql, connection)) { command.Parameters.AddWithValue("@id", m.id); command.Parameters.AddWithValue("@idTipo", m.idTipo); command.Parameters.AddWithValue("@estado", m.estado); command.Parameters.AddWithValue("@cuerpo", m.cuerpo); connection.Open(); afectadas = command.ExecuteNonQuery(); connection.Close(); } } return(afectadas); } else { return(-1); } }
protected void Button4_Click(object sender, EventArgs e) { /*Editables Y Datos*/ List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFecha.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anio0>"); datos.Add(txtAnio.Text); editables.Add("<presidente>"); datos.Add(txtPresidente.Text); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue.ToString()); editables.Add("<nombredia>"); datos.Add(ddlNombreDia.SelectedValue.ToString()); editables.Add("<numerodia>"); datos.Add(ddlNumeroDia.SelectedValue.ToString()); editables.Add("<nombremes>"); datos.Add(ddlMes.SelectedValue.ToString()); editables.Add("<anio>"); datos.Add(txtAnio0.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombremes1>"); datos.Add(ddlMes0.SelectedValue.ToString()); editables.Add("<numerodia1>"); datos.Add(ddlNumeroDia0.SelectedValue.ToString()); editables.Add("<anio1>"); datos.Add(txtAnio1.Text); editables.Add("<presidente1>"); datos.Add(txtPresidente0.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu.Text); editables.Add("<carrera>"); datos.Add(ddlCarrera.SelectedValue.ToString()); editables.Add("<estudiante1>"); datos.Add(txtNombreEstu0.Text); editables.Add("<carrera1>"); datos.Add(ddlCarrera0.SelectedValue.ToString()); editables.Add("<estudiante2>"); datos.Add(txtNombreEstu1.Text); editables.Add("<presidenta>"); datos.Add(txtPresidente1.Text); editables.Add("<coordinadorcar>"); datos.Add(txtCoordinador.Text); editables.Add("<carrera2>"); datos.Add(ddlCarreras.SelectedValue.ToString()); /**/ StringBuilder sb1 = new StringBuilder(); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); String plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\Titulacion\AprobacionModalidadProyectoInvestigacion.docx"; ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; resol.IDConsejo = txtCodigoConsejoDestino.Text; if (ViewState["CEDULA_EST"] != null) { resol.Estudiante = ViewState["CEDULA_EST"].ToString(); } resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado && resol.Estudiante != null) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
public async Task <Object []> CreateResolutionAsync([FromBody] Resolucion resolucion) { return(await detallesTecnicos.CrearResolucion(resolucion)); }
public void ActivaNewRes() { PlayerPrefs.SetFloat(pref_graf_f, reso); Resolucion.NewResMaster(reso); }
protected void Button4_Click(object sender, EventArgs e) { /*Editables Y Datos*/ List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFecha.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anio>"); datos.Add(txtAnio.Text); editables.Add("<coordinador>"); datos.Add(txtCoordinador.Text); editables.Add("<carrerasCoor>"); datos.Add(txtCarrerasCoorD.SelectedValue.ToString()); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue.ToString()); editables.Add("<nombreDia>"); datos.Add(ddlNombreDia.SelectedValue.ToString()); editables.Add("<numeroDia>"); datos.Add(ddlDiaNum.SelectedValue.ToString()); editables.Add("<nombreMes>"); datos.Add(ddlMes.SelectedValue.ToString()); editables.Add("<anio1>"); datos.Add(txtAnio1.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombreMes1>"); datos.Add(ddlMes0.SelectedValue.ToString()); editables.Add("<numeroDia1>"); datos.Add(ddlDiaNum0.SelectedValue.ToString()); editables.Add("<anio2>"); datos.Add(txtAnio2.Text); editables.Add("<presidenteConsejo>"); datos.Add(txtPresiConsejo.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu1.Text); editables.Add("<cedula>"); datos.Add(txtCedula.Text); editables.Add("<excarrera>"); datos.Add(ddlExCarreras.SelectedValue.ToString()); editables.Add("<periodoAcade>"); datos.Add(txtPeriodo.Text); editables.Add("<resolucion>"); datos.Add(txtResolucion.Text); editables.Add("<nombreMes2>"); datos.Add(ddlMes1.SelectedValue.ToString()); editables.Add("<numeroDia2>"); datos.Add(ddlDiaNum1.SelectedValue.ToString()); editables.Add("<anio3>"); datos.Add(txtAnio3.Text); editables.Add("<memo>"); datos.Add(txtMemo.Text); editables.Add("<numeroDia3>"); datos.Add(ddlDiaNum2.SelectedValue.ToString()); editables.Add("<nombreMes3>"); datos.Add(ddlMes2.SelectedValue.ToString()); editables.Add("<anio4>"); datos.Add(txtAnio4.Text); editables.Add("<suscriptor>"); datos.Add(txtSuscriptor.Text); editables.Add("<cargoSuscriptor>"); datos.Add(txtCargoSuscriptor.Text); editables.Add("<presidente>"); datos.Add(txtPresidente.Text); /**/ StringBuilder sb1 = new StringBuilder(); //sb1.Append(@"D:\Documentos\Pruebas\"); // sb1.Append(@"\\40.84.223.115\formatos\Documentos\Pruebas\"); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio1.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio1.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); // var plantilla = @"\\40.84.223.115\formatos\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"D:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"D:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"\\40.84.223.115\formatos\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; var plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; // resol.IDConsejo = 20; // resol.IDConsejo =Convert.ToInt32( txtCodigoConsejoDestino.Text); resol.IDConsejo = txtCodigoConsejoDestino.Text; resol.Estudiante = txtCedula.Text; resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
public int CreateByPuntoDeVenta(JObject data) { try { Movimiento entityMov = data["entityMov"].ToObject <Movimiento>(); List <MovimientoDetalle> listaDetalleMov = data["listDetalleMov"].ToObject <List <MovimientoDetalle> >(); List <MovimientoFormaPago> listaDetallePag = data["listDetallePag"].ToObject <List <MovimientoFormaPago> >(); SiinErpContext context = new SiinErpContext(); using (var transaccion = context.Database.BeginTransaction()) { TipoDocumento tiposdocmov = context.TiposDocumentos.FirstOrDefault(x => x.TipoDoc.Equals(entityMov.TipoDoc) && x.IdEmpresa == entityMov.IdEmpresa); tiposdocmov.NumDoc++; context.SaveChanges(); Resolucion resolucion = context.Resolucion.FirstOrDefault(x => x.IdEmpresa == entityMov.IdEmpresa && x.Estado.Equals(Constantes.EstadoActivo)); entityMov.TipoDoc = tiposdocmov.TipoDoc; entityMov.NumDoc = tiposdocmov.NumDoc; entityMov.CodModulo = Constantes.ModuloVentas; entityMov.Transaccion = tiposdocmov.IdDetTransaccion; entityMov.Periodo = entityMov.FechaDoc.ToString("yyyyMM"); entityMov.IdResolucion = resolucion.IdResolucion; entityMov.Estado = Constantes.EstadoActivo; entityMov.FechaVencimiento = entityMov.PlazoPago == null ? entityMov.FechaDoc : entityMov.FechaDoc.AddDays(entityMov.PlazoPago.PlazoDias); entityMov.FechaCreacion = DateTimeOffset.Now; context.Movimientos.Add(entityMov); context.SaveChanges(); decimal vrBruto = 0, vrDscto = 0, vrIva = 0; Movimiento obMov = context.Movimientos.FirstOrDefault(x => x.NumDoc == entityMov.NumDoc && x.TipoDoc.Equals(entityMov.TipoDoc)); foreach (MovimientoDetalle m in listaDetalleMov) { m.IdMovimiento = obMov.IdMovimiento; vrBruto += m.VrUnitario * m.Cantidad; vrDscto += m.VrUnitario * m.Cantidad * m.PcDscto / 100; vrIva += m.VrUnitario * m.Cantidad * m.PcIva / 100; Articulo entityArt = context.Articulos.Find(m.IdArticulo); if (entityArt.AfectaInventario) { ArticuloExistencia entityExist = context.Existencias.FirstOrDefault(x => x.IdArticulo == m.IdArticulo && x.IdDetAlmacen == entityMov.IdDetAlmacen); if (entityExist == null) { entityExist = new ArticuloExistencia(); entityExist.IdEmpresa = entityMov.IdEmpresa; entityExist.IdDetAlmacen = entityMov.IdDetAlmacen; entityExist.IdArticulo = m.IdArticulo; entityExist.Existencia = m.Cantidad * -1; context.Existencias.Add(entityExist); context.SaveChanges(); } else { entityExist.Existencia += m.Cantidad * -1; context.SaveChanges(); } } } List <CajaDetalle> ListaCajaDetalle = new List <CajaDetalle>(); foreach (MovimientoFormaPago mfp in listaDetallePag) { mfp.IdMovimiento = obMov.IdMovimiento; CajaDetalle entityCajaDet = new CajaDetalle(); entityCajaDet.IdCaja = Convert.ToInt32(entityMov.IdCaja); entityCajaDet.IdMovimiento = obMov.IdMovimiento; entityCajaDet.TipoDoc = obMov.TipoDoc; entityCajaDet.NumDoc = obMov.NumDoc; entityCajaDet.IdDetFormaPago = mfp.IdDetFormaDePago; entityCajaDet.IdDetCuenta = mfp.IdDetCuenta; entityCajaDet.Efectivo = mfp.Descripcion.Contains("Efectivo") ? true : false; entityCajaDet.Transaccion = 1; entityCajaDet.Valor = mfp.Valor; entityCajaDet.Estado = Constantes.EstadoActivo; entityCajaDet.FechaCreacion = DateTimeOffset.Now; entityCajaDet.CreadoPor = entityMov.CreadoPor; ListaCajaDetalle.Add(entityCajaDet); } context.MovimientosFormasPagos.AddRange(listaDetallePag); context.SaveChanges(); context.MovimientosDetalles.AddRange(listaDetalleMov); context.SaveChanges(); context.CajaDetalle.AddRange(ListaCajaDetalle); context.SaveChanges(); if (entityMov.IdTercero != null) { Tercero entityCli = context.Terceros.Find(entityMov.IdTercero); entityCli.Direccion = entityMov.DireccionTercero; entityCli.Telefono = entityMov.TelefonoTercero; context.SaveChanges(); } transaccion.Commit(); return(obMov.IdMovimiento); } } catch (Exception ex) { errorBusiness.Create("CreateMovimientoByPuntoVenta", ex.Message, null); throw; } }
public int InsertResolucion(Resolucion m) { return(datos.InsertResolucion(m)); }
protected void Button4_Click(object sender, EventArgs e) { List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFechaHeader.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anioReso>"); datos.Add(txtAnio2.Text); editables.Add("<coordinador>"); datos.Add(txtCoordinador.Text); editables.Add("<carreraCoor>"); datos.Add(ddlCarreras.SelectedValue); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue); editables.Add("<nombreDia>"); datos.Add(ddlNombreDia.SelectedValue); editables.Add("<numeroDia>"); datos.Add(ddlNumeroDia.SelectedValue); editables.Add("<nombreMes>"); datos.Add(ddlMes.SelectedValue); editables.Add("<anioSesion>"); datos.Add(txtAnio.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombreMes1>"); datos.Add(ddlMes0.SelectedValue); editables.Add("<numeroDia1>"); datos.Add(ddlNumeroDia0.SelectedValue); editables.Add("<anioAcuerdo>"); datos.Add(txtAnio3.Text); editables.Add("<presidenteConsejo>"); datos.Add(txtPresidente.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu1.Text); editables.Add("<cedula>"); datos.Add(txtCedula.Text); editables.Add("<carrera>"); datos.Add(ddlCarreras1.SelectedValue.ToString()); editables.Add("<carreraGuardado>"); datos.Add(ddlCarreras0.SelectedValue.ToString()); editables.Add("<carrera1>"); datos.Add(txtCarrera2.Text); editables.Add("<facultad>"); datos.Add(txtFacultad.Text); editables.Add("<presidente1>"); datos.Add(txtPresidente1.Text); // StringBuilder sb1 = new StringBuilder(); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio2.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio2.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); // String plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\CulturaFisica.docx"; //continuar = CreateWordDocument(plantilla, sb1.ToString()); ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; // resol.IDConsejo = 30; resol.IDConsejo = txtCodigoConsejoDestino.Text; resol.Estudiante = txtCedula.Text; resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
/// <summary> /// Guarda resolucion de canal /// </summary> public static void IngresarCanalTV() { string nombre = ""; bool validar = false; do { //nombre, resolucion ATLA o BAJA, multilenguaje TRUE, decimal PRECIO Console.WriteLine("Ingrese el nombre del canal: "); nombre = Console.ReadLine(); validar = Canal.ValidarNombre(nombre); if (!validar) { Console.WriteLine("El nombre del canal debe ser mayor a tres caracteres."); } } while (!validar); string resolucionString = ""; do { Console.WriteLine("Ingrese la resolucion del canal, 1080 'alta' o 576 'baja': "); resolucionString = Console.ReadLine(); resolucionString = resolucionString.ToLower(); } while (resolucionString != "alta" && resolucionString != "baja"); Resolucion resolucionFinal = (Resolucion)Enum.Parse(typeof(Resolucion), resolucionString.ToUpper()); //si la respuesta es ALTA se asigna este valor a la resolucion, de no ser asi se asigna BAJA //Resolucion resolucionFinal = resolucionString == "alta" ? Resolucion.ALTA : Resolucion.BAJA; string multiString; do { Console.WriteLine("Ingrese si tiene multilenguage, 'si' o 'no': "); multiString = Console.ReadLine(); multiString = multiString.ToLower(); } while (multiString != "si" && multiString != "no"); //si la respuesta es SI se asigna TRUE a multilenguaje, de no ser asi se asigna FALSE bool multiFinal = multiString == "si" ? true : false; decimal precioDecimal = -1; do { precioDecimal = GuardarValorDecimal("Ingrese el precio del mismo: "); if (!Canal.ValidarPrecio(precioDecimal)) { Console.WriteLine("Ingeese un precio de Canal mayo a 0."); } } while (!Canal.ValidarPrecio(precioDecimal)); if (Canal.ValidarPrecio(precioDecimal) && Canal.ValidarNombre(nombre)) { } { Canal unC = empresa.AgregarCanal(nombre, resolucionFinal, multiFinal, precioDecimal); Console.WriteLine("Su canal ha sido creado."); Console.WriteLine(unC); } }