public void modificarInscripcion(Persona modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update INSCRIPCIONES Set IDP=@idp," + " IDU=@idu Where IDP=" + modificar.ID); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@IDP", modificar.ID); accesoDatos.Comando.Parameters.AddWithValue("@IDU", modificar.Usuario.ID); //accesoDatos.Comando.Parameters.AddWithValue("@INICIO", modificar.Usuario.Inicio); //accesoDatos.Comando.Parameters.AddWithValue("@Perfil", modificar.Usuario.ID); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarCorredor(Corredor modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update CORREDORES Set Id_Proveedor=@Id_Proveedor, Numero=@Numero, Nombre=@Nombre," + " Apellido=@Apellido, Telefono=@Telefono, Celular=@Celular, Mail=@Mail " + " Where Id_Proveedor=" + modificar.Id_Proveedor.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Id_Proveedor", modificar.Id_Proveedor); accesoDatos.Comando.Parameters.AddWithValue("@Numero", modificar.Número); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Apellido", modificar.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@Telefono", modificar.Teléfono); accesoDatos.Comando.Parameters.AddWithValue("@Celular", modificar.Celular); accesoDatos.Comando.Parameters.AddWithValue("@Mail", modificar.Mail); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarEmpleado(Empleado modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update empleado Set Nombre=@Nombre, apellido=@apellido, " + "puesto=@puesto,dni=@dni,usuario=@usuario,contrasena=@contrasena Where Id=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@apellido", modificar.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@puesto", modificar.Puesto); accesoDatos.Comando.Parameters.AddWithValue("@dni", modificar.Dni); accesoDatos.Comando.Parameters.AddWithValue("@usuario", modificar.Usuario); accesoDatos.Comando.Parameters.AddWithValue("@contrasena", modificar.Contraseña); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarCliente(Cliente modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update CLIENTES Set Nombre=@Nombre, Apellido=@Apellido, Dni=@Dni, Fecha_Nacimiento=@Fecha_Nacimiento," + " Telefono=@Telefono, Celular=@Celular, Mail=@Mail Where Id=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Apellido", modificar.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@Dni", modificar.Dni); accesoDatos.Comando.Parameters.AddWithValue("@Fecha_Nacimiento", modificar.FechaNacimiento); accesoDatos.Comando.Parameters.AddWithValue("@Telefono", modificar.Teléfono); accesoDatos.Comando.Parameters.AddWithValue("@Celular", modificar.Celular); accesoDatos.Comando.Parameters.AddWithValue("@Mail", modificar.Mail); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarProveedor(Proveedor nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("sp_AGREGAR_PROVEEDOR"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@CUIT", nuevo.CUIT); accesoDatos.Comando.Parameters.AddWithValue("@RAZON_SOCIAL", nuevo.RazonSocial); accesoDatos.Comando.Parameters.AddWithValue("@CONTACTO", nuevo.NombreContacto); accesoDatos.Comando.Parameters.AddWithValue("@NUMERO", nuevo.telefono.Numero); accesoDatos.Comando.Parameters.AddWithValue("@TIPOTEL", nuevo.telefono.TipoDeTelefono); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarDomicilio(Domicilio modif) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("UPDATE DOMICILIOS SET CALLE = @Calle, ALTURA = @Altura, ENTRECALLE1 = @EntreCalle1, ENTRECALLE2 = @Entrecalle2, PISO=@Piso, DEPARTAMENTO=@Depto, IDLOCALIDAD=@Localidad WHERE ID=" + modif.ID); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Calle", esNulo(modif.Calle)); accesoDatos.Comando.Parameters.AddWithValue("@Altura", esNulo(modif.Altura)); accesoDatos.Comando.Parameters.AddWithValue("@EntreCalle1", esNulo(modif.EntreCalle1)); accesoDatos.Comando.Parameters.AddWithValue("@EntreCalle2", esNulo(modif.EntreCalle2)); accesoDatos.Comando.Parameters.AddWithValue("@Piso", esNulo(modif.Edificio.Piso)); accesoDatos.Comando.Parameters.AddWithValue("@Depto", esNulo(modif.Edificio.Departamento)); accesoDatos.Comando.Parameters.AddWithValue("@Localidad", esNulo(modif.Localidad.ID)); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarComercio(Comercio nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("INSERT INTO COMERCIOS (CUIT, NOMBREJURIDICO, NOMBREFANTASIA, INGRESOSBRUTOS, FECHAINICIO, IDDOMICILIO) VALUES (@Cuit, @NombreJ, @NombreF, @IBrutos, @FInicio, @Domicilio)"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Cuit", nuevo.CUIT); accesoDatos.Comando.Parameters.AddWithValue("@NombreJ", nuevo.NombreJuridico); accesoDatos.Comando.Parameters.AddWithValue("@NombreF", nuevo.NombreFantasia); accesoDatos.Comando.Parameters.AddWithValue("@IBrutos", nuevo.IngresosBrutos); accesoDatos.Comando.Parameters.AddWithValue("@FInicio", nuevo.FechaInicio); accesoDatos.Comando.Parameters.AddWithValue("@Domicilio", nuevo.Domicilio.ID); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarIngredientePorComida(IngreditePorComida nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("AgregarIngredientePorComida"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@IdComidas", nuevo.Comida.Id); accesoDatos.Comando.Parameters.AddWithValue("@IdIngredientes", nuevo.Ingrediente.Id); accesoDatos.Comando.Parameters.AddWithValue("@Cantidad", nuevo.Cantidad); accesoDatos.Comando.Parameters.AddWithValue("@FechaCreacion", nuevo.FechaCreacion); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioCreacion", nuevo.UsuarioCreacion.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@FechaModificacion", nuevo.FechaModificacion); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioModificacion", nuevo.UsuarioModificacion.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@Estado", nuevo.Estado); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarInsumo(Bebida modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update bebida Set Nombre=@Nombre, cantidad=@cantidad, descripcion=@descripcion,copa=@copa,idmarca=@idMarca,precio=@precio Where Id=" + modificar.id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@descripcion", modificar.Descripcion); accesoDatos.Comando.Parameters.AddWithValue("@cantidad", modificar.Cantidad); accesoDatos.Comando.Parameters.AddWithValue("@copa", modificar.Copa); accesoDatos.Comando.Parameters.AddWithValue("@idMarca", modificar.marca.Id); accesoDatos.Comando.Parameters.AddWithValue("@precio", modificar.Precio); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarCliente(Clientes nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("SP_AGREGARCLIENTE"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@DNI", nuevo.DNI); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", nuevo.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Apellido", nuevo.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@Email", nuevo.Email); accesoDatos.Comando.Parameters.AddWithValue("@Direccion", nuevo.Direccion); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarCliente(Clientes modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update CLIENTES Set DNI=@DNI,Nombre=@Nombre,Apellido=@Apellido,Email=@email,Direccion=@direccion Where IdCliente=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@DNI", modificar.DNI); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Apellido", modificar.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@Email", modificar.Email); accesoDatos.Comando.Parameters.AddWithValue("@Direccion", modificar.Direccion); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarComida(Comida modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("SET DATEFORMAT 'DMY' update COMIDAS Set NombreComida=@Nombre, PrecioComida=@Precio, FechaModificacion=@FechaModificacion, UsuarioModificacion=@UsuarioModificacion, Estado=@Estado where IdComida=" + modificar.Id); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Precio", modificar.Precio); accesoDatos.Comando.Parameters.AddWithValue("@FechaModificacion", modificar.F_Mod); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioModificacion", modificar.UserMod.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@Estado", modificar.Estado); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarComida(Comida nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("AgregarComida"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@NombreComida", nuevo.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@PrecioComida", nuevo.Precio); accesoDatos.Comando.Parameters.AddWithValue("@FechaCreacion", nuevo.F_Add); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioCreacion", nuevo.UserAdd.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@FechaModificacion", nuevo.F_Mod); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioModificacion", nuevo.UserMod.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@Estado", nuevo.Estado); accesoDatos.Comando.Parameters.AddWithValue("@TC", nuevo.TC.Id); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void AgregarInscripcion(Persona persona) { //SqlConnection conexion = new SqlConnection(); //SqlCommand comando = new SqlCommand(); AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { DateTime ahora = new DateTime(); accesoDatos.setearConsulta("insert into INSCRIPCIONES (IDP, IDU, INICIO) values ('" + persona.ID + "','" + persona.Usuario.ID + "', '" + ahora.ToString() + "')"); //conexion.ConnectionString = AccesoDatosManager.cadenaConexion; //comando.CommandType = System.Data.CommandType.Text; //MSF-20190420: le agregué todas las columnas. Teniendo en cuenta inclusive lo que elegimos en el combo de selección.. //comando.CommandText = "insert into PERSONAS (Nombre, Apellido, DNI, Nacimiento, Email, Calle, Numero, Contraseña) values"; //comando.CommandText += "('" + persona.Nombre.ToString() + "', '" + persona.Apellido.ToString() + "', '" + persona.DNI.ToString() //+ "','" + persona.Nacimiento.ToString() + "', '" + persona.Email.ToString() + "', '" + persona.Direccion.Calle.ToString() //+ "','" + persona.Direccion.Numero.ToString() + "','" + persona.Usuario.Contraseña.ToString() + "' )"; accesoDatos.abrirConexion(); //comando.Connection = conexion; //conexion.Open(); accesoDatos.ejecutarAccion(); //comando.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarProveedor(Proveedor modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update PROVEEDORES Set Razon_Social=@Razon_Social, Cuit=@Cuit, Telefono=@Telefono," + " Celular=@Celular, Mail=@Mail, Web=@Web Where Id=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Razon_Social", modificar.RazónSocial); accesoDatos.Comando.Parameters.AddWithValue("@Cuit", modificar.Cuit); accesoDatos.Comando.Parameters.AddWithValue("@Telefono", modificar.Teléfono); accesoDatos.Comando.Parameters.AddWithValue("@Celular", modificar.Celular); accesoDatos.Comando.Parameters.AddWithValue("@Mail", modificar.Mail); accesoDatos.Comando.Parameters.AddWithValue("@Web", modificar.Web); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarIngrediente(Ingrediente modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("SET DATEFORMAT 'DMY' update INGREDIENTES Set NombreIngrediente=@Nombre, StockIngrediente=@StockIngrediente, PrecioIngrediente=@PrecioIngrediente, UnidadMedida=@UnidadMedida, MasterPack=@MasterPack, FechaModificacion=@FechaModificacion, UsuarioModificacion=@UsuarioModificacion, Estado=@Estado where IdIngrediente=" + modificar.Id); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@StockIngrediente", modificar.Stock); accesoDatos.Comando.Parameters.AddWithValue("@PrecioIngrediente", modificar.Precio); accesoDatos.Comando.Parameters.AddWithValue("@UnidadMedida", modificar.UM.IdUnidad); accesoDatos.Comando.Parameters.AddWithValue("@MasterPack", modificar.Master); accesoDatos.Comando.Parameters.AddWithValue("@FechaModificacion", modificar.F_Mod); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioModificacion", modificar.UserMod.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@Estado", modificar.estado); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void cargarPedido(Pedido p) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("INSERT INTO PEDIDOS (IDCLIENTE, IDCOMBO, OBSERVACION, FECHAENTREGA, PRECIO, ESTADO, FECHASOLICITUD) VALUES (@Cliente, @Combo, @Observacion, @FechaEntrega, @Precio, @Estado, @FechaSolicitud)"); accesoDatos.Comando.Parameters.AddWithValue("@Cliente", p.Cliente.ID); accesoDatos.Comando.Parameters.AddWithValue("@Combo", p.Combo.ID); accesoDatos.Comando.Parameters.AddWithValue("@Observacion", p.Observacion); accesoDatos.Comando.Parameters.AddWithValue("@FechaEntrega", p.FechaEntrega); accesoDatos.Comando.Parameters.AddWithValue("@FechaSolicitud", p.FechaSolicitud); accesoDatos.Comando.Parameters.AddWithValue("@Precio", p.PrecioFinal); accesoDatos.Comando.Parameters.AddWithValue("@Estado", p.Estado); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void pruebapro(prueba nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("pruebaagregar"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@id", nuevo.prod); accesoDatos.Comando.Parameters.AddWithValue("@cant", nuevo.cant); accesoDatos.Comando.Parameters.AddWithValue("@Tota", nuevo.total); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarPlato(Plato modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update plato Set Nombre=@Nombre, precio=@precio,tipo=@tipo, descripcion=@descripcion,cantidad=@cantidad Where id=" + modificar.id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Tipo", modificar.Tipo.id); accesoDatos.Comando.Parameters.AddWithValue("@descripcion", modificar.Descripcion); accesoDatos.Comando.Parameters.AddWithValue("@precio", modificar.Precio); accesoDatos.Comando.Parameters.AddWithValue("@cantidad", modificar.Cantidad); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void agregarIngrediente(Ingrediente nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("AgregarIngrediente"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@NombreIngrediente", nuevo.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@StockIngrediente", nuevo.Precio); accesoDatos.Comando.Parameters.AddWithValue("@UnidadMedida", nuevo.UM.IdUnidad); accesoDatos.Comando.Parameters.AddWithValue("@MasterPack", nuevo.Master); accesoDatos.Comando.Parameters.AddWithValue("@PrecioIngrediente", nuevo.Precio); accesoDatos.Comando.Parameters.AddWithValue("@FechaCreacion", nuevo.F_Add); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioCreacion", nuevo.UserAdd.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@FechaModificacion", nuevo.F_Mod); accesoDatos.Comando.Parameters.AddWithValue("@UsuarioModificacion", nuevo.UserMod.IdUsuario); accesoDatos.Comando.Parameters.AddWithValue("@Estado", nuevo.estado); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarComercio(Comercio comercio) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("UPDATE COMERCIOS SET CUIT = @Cuit, NOMBREJURIDICO = @NombreF, NOMBREFANTASIA = @NombreF, INGRESOSBRUTOS = @IBrutos, FECHAINICIO = @FInicio, IDDOMICILIO = @Domicilio WHERE ID = " + comercio.ID); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Cuit", comercio.CUIT); accesoDatos.Comando.Parameters.AddWithValue("@NombreJ", comercio.NombreJuridico); accesoDatos.Comando.Parameters.AddWithValue("@NombreF", comercio.NombreFantasia); accesoDatos.Comando.Parameters.AddWithValue("@IBrutos", comercio.IngresosBrutos); accesoDatos.Comando.Parameters.AddWithValue("@FInicio", comercio.FechaInicio); accesoDatos.Comando.Parameters.AddWithValue("@Domicilio", comercio.Domicilio.ID); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void ModificarCiente(Cliente nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("sp_MODIFICAR_CLIENTE"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@DNI", nuevo.DNI); accesoDatos.Comando.Parameters.AddWithValue("@APELLIDO", nuevo.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@NOMBRE", nuevo.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@MAIL", nuevo.Mail); accesoDatos.Comando.Parameters.AddWithValue("@NUMERO", nuevo.telefono.Numero); accesoDatos.Comando.Parameters.AddWithValue("@TIPOTEL", nuevo.telefono.TipoDeTelefono); accesoDatos.Comando.Parameters.AddWithValue("@CALLE", nuevo.domicilio.Calle); accesoDatos.Comando.Parameters.AddWithValue("@ALTURA", nuevo.domicilio.Altura); accesoDatos.Comando.Parameters.AddWithValue("@CODPOS", nuevo.domicilio.CodigoPostal); accesoDatos.Comando.Parameters.AddWithValue("@LOCALIDAD", nuevo.domicilio.Localidad); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarDirección(Cliente modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update DIRECCIONES_CLIENTES Set Calle=@Calle, Numero=@Numero, Piso=@Piso, Departamento=@Departamento," + " Localidad=@Localidad, Codigo_Postal=@Codigo_Postal Where Id=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Calle", modificar.Calle); accesoDatos.Comando.Parameters.AddWithValue("@Numero", modificar.Número); accesoDatos.Comando.Parameters.AddWithValue("@Piso", modificar.Piso); accesoDatos.Comando.Parameters.AddWithValue("@Departamento", modificar.Departamento); accesoDatos.Comando.Parameters.AddWithValue("@Localidad", modificar.Localidad); accesoDatos.Comando.Parameters.AddWithValue("@Codigo_Postal", modificar.CódigoPostal); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarEmpleado(Empleado modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update EMPLEADOS Set nombre=@nombre, apellido=@apellido, dni=@dni,direccion=@direccion, localidad=@localidad,mail=@mail,telefono=@telefono Where Id=" + modificar.id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@nombre", modificar.nombre); accesoDatos.Comando.Parameters.AddWithValue("@apellido", modificar.apellido); accesoDatos.Comando.Parameters.AddWithValue("@dni", modificar.dni); accesoDatos.Comando.Parameters.AddWithValue("@direccion", modificar.direccion); accesoDatos.Comando.Parameters.AddWithValue("@localidad", modificar.localidad); accesoDatos.Comando.Parameters.AddWithValue("@mail", modificar.mail); accesoDatos.Comando.Parameters.AddWithValue("@telefono", modificar.telefono); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarProducto(Producto modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update Productos Set Descripcion=@Descripcion, Tipo=@Tipo, Marca=@Marca, Stock=@Stock," + " Stock_Minimo=@Stock_Minimo, Precio_Compra=@Precio_Compra, Precio_Venta=@Precio_Venta, Porcentaje=@Porcentaje" + " Where Id=" + modificar.Id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Descripcion", modificar.Descripción); accesoDatos.Comando.Parameters.AddWithValue("@Tipo", modificar.Tipo); accesoDatos.Comando.Parameters.AddWithValue("@Marca", modificar.Marca); accesoDatos.Comando.Parameters.AddWithValue("@Stock", modificar.Stock); accesoDatos.Comando.Parameters.AddWithValue("@Stock_Minimo", modificar.StockMínimo); accesoDatos.Comando.Parameters.AddWithValue("@Precio_Compra", modificar.PrecioCompra); accesoDatos.Comando.Parameters.AddWithValue("@Precio_Venta", modificar.PrecioVenta); accesoDatos.Comando.Parameters.AddWithValue("@Porcentaje", modificar.Porcentaje); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void ModificarVenta(Venta nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("sp_MODIFICAR_VENTA"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@ID", nuevo.Id); accesoDatos.Comando.Parameters.AddWithValue("@COSTOTOTAL", nuevo.CostoTotal); accesoDatos.Comando.Parameters.AddWithValue("@METODOPAGO", nuevo.MetodoPago); accesoDatos.Comando.Parameters.AddWithValue("@TARJETA", nuevo.Tarjeta); accesoDatos.Comando.Parameters.AddWithValue("@CODIGO", nuevo.Codigo); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void ModificarProducto(Producto nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("sp_MODIFICAR_PRODUCTO"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@MARCA", nuevo.marca.Id); accesoDatos.Comando.Parameters.AddWithValue("@CATEGORIA", nuevo.categoria.Id); accesoDatos.Comando.Parameters.AddWithValue("@DESCRIPCION", nuevo.Descripcion); accesoDatos.Comando.Parameters.AddWithValue("@STOCK_ACTUAL", nuevo.StockActual); accesoDatos.Comando.Parameters.AddWithValue("@ID", nuevo.Id); accesoDatos.Comando.Parameters.AddWithValue("@STOCK_MINIMO", nuevo.StockMinimo); accesoDatos.Comando.Parameters.AddWithValue("@PRECIO", nuevo.PrecioVenta); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void AgregarFactura(Factura nuevo) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearSP("sp_AGREGAR_FACTURAXVENTA"); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@ID", nuevo.Producto); accesoDatos.Comando.Parameters.AddWithValue("@IDPRODUCTO", nuevo.Producto); accesoDatos.Comando.Parameters.AddWithValue("@COSTO", nuevo.Costo); accesoDatos.Comando.Parameters.AddWithValue("@CANTIDAD", nuevo.Cantidad); accesoDatos.Comando.Parameters.AddWithValue("@SUBTOTAL", nuevo.SubTotal); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarProducto(Producto modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update PRODUCTOS Set descripcion=@DESCRIPCION, precioCompra=@precioCompra, precioVenta=@precioVenta,stockMinimo=@stockMinimo Where Id=" + modificar.id.ToString()); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@DESCRIPCION", modificar.descripcion); accesoDatos.Comando.Parameters.AddWithValue("@precioCompra", modificar.precioCompra); accesoDatos.Comando.Parameters.AddWithValue("@precioVenta", modificar.precioVenta); accesoDatos.Comando.Parameters.AddWithValue("@stockMinimo", modificar.stockMinimo); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
public void modificarPersona(Persona modificar) { AccesoDatosManager accesoDatos = new AccesoDatosManager(); try { accesoDatos.setearConsulta("update PERSONAS Set Nombre=@Nombre, Apellido=@Apellido, DNI=@dni, EMAIL=@email," + " Nacimiento=@Nac, Contraseña=@Contraseña Where ID=" + modificar.ID); accesoDatos.Comando.Parameters.Clear(); accesoDatos.Comando.Parameters.AddWithValue("@Nombre", modificar.Nombre); accesoDatos.Comando.Parameters.AddWithValue("@Apellido", modificar.Apellido); accesoDatos.Comando.Parameters.AddWithValue("@dni", modificar.DNI); accesoDatos.Comando.Parameters.AddWithValue("@Nac", modificar.Nacimiento); accesoDatos.Comando.Parameters.AddWithValue("@email", modificar.Email); accesoDatos.Comando.Parameters.AddWithValue("@Contraseña", modificar.Usuario.Contraseña); //accesoDatos.Comando.Parameters.AddWithValue("@Perfil", modificar.Usuario.ID); accesoDatos.abrirConexion(); accesoDatos.ejecutarAccion(); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }