0% found this document useful (0 votes)
12 views5 pages

Validaciones y Procedimientos

Uploaded by

Diego Mercedes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Validaciones y Procedimientos

Uploaded by

Diego Mercedes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{

MessageBox.Show("hola ");

button2.PerformClick();

private void button2_Click(object sender, EventArgs e)


{
//MessageBox.Show("cómo estás? ");

if (textBox4.Text == "")
{
MessageBox.Show("te texbox no puede estar vacío ");
}

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 32 && e.KeyChar <= 64) || (e.KeyChar >= 91 &&
e.KeyChar <= 96) || (e.KeyChar >= 123 && e.KeyChar <= 255))
{
MessageBox.Show("Solo letras", "Advertencia", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Handled = true;
return;
}
}

private void textBox2_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 32 && e.KeyChar <= 47) || (e.KeyChar >= 58 &&
e.KeyChar <= 255))
{
MessageBox.Show("Solo números", "Advertencia", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Handled = true;
return;
}

private void textBox1_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.F1)
{
textBox2.Focus();
}
else
{

textBox4.Focus();
}
}

private void textBox2_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.F1)
{
textBox3.Focus();
}

}
}
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp4
{
public partial class Form1 : Form
{

float a, b, c;
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
MessageBox.Show("hola ");

button2.PerformClick();

private void button2_Click(object sender, EventArgs e)


{
//MessageBox.Show("cómo estás? ");

if (textBox4.Text == "")
{
MessageBox.Show("te texbox no puede estar vacío ");
}

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 32 && e.KeyChar <= 64) || (e.KeyChar >= 91 &&
e.KeyChar <= 96) || (e.KeyChar >= 123 && e.KeyChar <= 255))
{
MessageBox.Show("Solo letras", "Advertencia", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Handled = true;
return;
}
}

private void textBox2_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 32 && e.KeyChar <= 47) || (e.KeyChar >= 58 &&
e.KeyChar <= 255))
{
MessageBox.Show("Solo números", "Advertencia", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Handled = true;
return;
}

private void textBox1_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.F1)
{
textBox2.Focus();
}
else
{

textBox4.Focus();
}
}

private void textBox2_KeyDown(object sender, KeyEventArgs e)


{
if (e.KeyCode == Keys.F1)
{
textBox3.Focus();
}

private void button3_Click(object sender, EventArgs e)


{
a=Convert.ToInt32(textBox5.Text);
b = Convert.ToInt32(textBox6.Text);
c = a + b;
textBox7.Text = c.ToString();
}
}
}

Total20 = precio5 *cantidad4


Devolucion480 = pago500 –
total20

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp5
{
public partial class Form1 : Form
{
float total, precio, cantidad, devolucion, pago;

private void button2_Click(object sender, EventArgs e)


{

pago=Convert.ToInt32(textBox4.Text);
devolucion = pago - total;
textBox5.Text = devolucion.ToString();
}

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
precio=Convert.ToInt32(textBox1.Text);
cantidad = Convert.ToInt32(textBox2.Text);
total = precio * cantidad;
textBox3.Text = total.ToString();
}
}
}
--create database procedimientos

--use procedimientoscodigo i
--create table profesor(codigo int, nombres varchar(30))
--insert into profesor values (90, 'jose')

--select * from profesor


--estoy insertando por procedimientos

create procedure insertar (@codigo int, @nombres varchar(30))


as
insert into profesor
(codigo, nombres)
values
(@codigo, @nombres)

exec insertar 93,'maria'

******************************con tres campos


--create table profesora(cedula int, apellidos varchar(30), sueldo float)
--insert into profesora values (10, 'lora', 8000)
--select * from profesora
tex1 10 text2 lora text355
create procedure insertar4(@cedula int, @apellidos varchar(30), @sueldo float)
as
insert into profesora
(cedula, apellidos, sueldo)
values
(@cedula, @apellidos, @sueldo)
select * from profesora

exec insertar4 10, 'lora', 355

You might also like