Actividad 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ACTIVIDAD 2

Amilkar Jamil Maisman Espinoza

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 TEMA2._0
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static void login()
{
MessageBox.Show("No ingreso Usuario ni Coontraseña.!");
}
static void login(String Introducido)
{
MessageBox.Show("Falta introducir Usuario o Contraseña");
}
private void label1_Click(object sender, EventArgs e)
{

private void groupBox1_Enter(object sender, EventArgs e)


{
}

private void Form1_Load(object sender, EventArgs e)


{

private void textBox2_TextChanged(object sender, EventArgs e)


{

}
static void Login(string Usu, string Con)
{
if (Usu.ToUpper() == "AMILKAR" && Con == "AMI157")
{
Form2 Obj = new Form2();
Obj.ShowDialog();
}
else
MessageBox.Show("Usuario o Contrseña Incorrecto");
}

private void button1_Click(object sender, EventArgs e)


{
if (string.IsNullOrEmpty(Usu.Text) && string.IsNullOrEmpty(Con.Text))
login();
else
if (!string.IsNullOrEmpty(Usu.Text) &&
!string.IsNullOrEmpty(Con.Text))
Login(Usu.Text, Con.Text);
else
if (string.IsNullOrEmpty(Usu.Text))
login(Con.Text);
else
login(Usu.Text);
}

private void Con_TextChanged(object sender, EventArgs e)


{

}
}
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace TEMA2._0
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)


{

private void listBox1_SelectedIndexChanged_1(object sender, EventArgs e)


{

private void PRO_SelectedIndexChanged(object sender, EventArgs e)


{
switch(PRO.Text)
{
case "MOUSE":PRE.Value = 20;break;
case "TECLADO": PRE.Value = 30; break;
case "PARLANTE": PRE.Value = 40; break;
default : PRE.Value = 50;break;
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
TAS.Enabled=false;
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)


{
TAS.Enabled = true;
}
static decimal Obtcobro(decimal c, decimal PRE)
{
return c * (PRE * 90 / 100);
}
static decimal ObtCobro(decimal c, decimal PRE, decimal TAS)

{
return (c * PRE) + (c * PRE * TAS / 100);
}

private void button1_Click(object sender, EventArgs e)


{
if (OP1.Checked)
S1.Text = Obtcobro(c.Value,
PRE.Value).ToString();
else
S1.Text = ObtCobro(c.Value, PRE.Value,
TAS.Value).ToString();
}

private void button2_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void label5_Click(object sender, EventArgs e)


{

}
}
}

You might also like