public static void nuevoDireccion(Direcciones u)
        {
            string sql = String.Format(
                "INSERT INTO ADDRESS( idusuario, address)" +
                $"values( '{1}', {0});",
                u.idusuario, u.address);

            Conexion.realizarAccion(sql);
        }
示例#2
0
        private void btnPedido_Click(object sender, EventArgs e)
        {
            try
            {
                Producto    i = (Producto)cmbProducto1.SelectedItem;
                Direcciones u = (Direcciones)cmbDireccion1.SelectedItem;

                OrdenD.realizarOrden(u, i, dtpfecha.Value);

                MessageBox.Show("Orden agregada", ":)",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error: " + exception.Message, ":(",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public static List <Direcciones> getLista()
        {
            string sql = "select * from ADDRESS";

            DataTable dt = Conexion.realizarConsulta(sql);

            List <Direcciones> lista = new List <Direcciones>();

            foreach (DataRow fila in dt.Rows)
            {
                Direcciones u = new Direcciones();
                u.idaddress = Convert.ToInt32(fila[0].ToString());
                u.idusuario = Convert.ToInt32(fila[1].ToString());
                u.address   = fila[2].ToString();

                lista.Add(u);
            }
            return(lista);
        }
示例#4
0
        private void btnAgregarDireccion_Click(object sender, EventArgs e)
        {
            Direcciones u = new Direcciones();

            u.address = txtDireccion.Text;

            try
            {
                DireccionesD.nuevoDireccion(u);

                MessageBox.Show("agregada exitosamente", ":)",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                actualizarControles();
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error: " + exception.Message, "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#5
0
 public static void realizarOrden(Direcciones direcciones, Producto producto, DateTime dtpfechaValue)
 {
 }