Created
July 17, 2014 01:02
-
-
Save Fhernd/12af6e3836612219c830 to your computer and use it in GitHub Desktop.
Control con las opciones extra de administración de la empresa que vende juegos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ===++=== | |
// | |
// OrtizOL | |
// | |
// ===--=== | |
/*============================================================ | |
// | |
// Clase: ControlOpciones.cs | |
// | |
// Original en: http://goo.gl/pA6Iy5 | |
// | |
// Propósito: Control para los botones de operaciones | |
// extendidas sobre los juegos que vende la empresa. | |
// | |
============================================================*/ | |
using System; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Windows.Forms; | |
namespace JuegosCelulares.GUI | |
{ | |
/// <summary> | |
/// Control para las operaciones extendidas de la empresa de juegos. | |
/// </summary> | |
public partial class ControlOpciones : UserControl | |
{ | |
#region Componentes | |
/// <summary> | |
/// Representa el formulario padre de este control. | |
/// </summary> | |
private Principal ventanaPrincipal; | |
#endregion | |
#region Campos | |
/// <summary> | |
/// Presupuesto para la compra de juegos. | |
/// </summary> | |
private decimal presupuesto; | |
/// <summary> | |
/// Capacidad del dispositivo. | |
/// </summary> | |
private int capacidad; | |
/// <summary> | |
/// Cantidad del juego `Car Racer 2`. | |
/// </summary> | |
private int cantidadCarRacer2; | |
/// <summary> | |
/// Cantidad del juego `Air Attack`. | |
/// </summary> | |
private int cantidadAirAttack; | |
/// <summary> | |
/// Cantidad del juego `Mini Golf 2`. | |
/// </summary> | |
private int cantidadMiniGolf2; | |
/// <summary> | |
/// Cantidad del juego `Aztec Warrior`. | |
/// </summary> | |
private int cantidadAztecWarrior; | |
#endregion | |
#region Propiedades | |
/// <summary> | |
/// Obtiene y modifica la cantidad del juego `Car Racer 2`. | |
/// </summary> | |
public int CantidadCarRacer2 | |
{ | |
get | |
{ | |
return cantidadCarRacer2; | |
} | |
set | |
{ | |
cantidadCarRacer2 = value; | |
} | |
} | |
/// <summary> | |
/// Obtiene y modifica la cantidad del juego `Air Attack`. | |
/// </summary> | |
public int CantidadAirAttack | |
{ | |
get | |
{ | |
return cantidadAirAttack; | |
} | |
set | |
{ | |
cantidadAirAttack = value; | |
} | |
} | |
/// <summary> | |
/// Obtiene y modifica la cantidad del juego `Mini Golf 2`. | |
/// </summary> | |
public int CantidadMiniGolf2 | |
{ | |
get | |
{ | |
return cantidadMiniGolf2; | |
} | |
set | |
{ | |
cantidadMiniGolf2 = value; | |
} | |
} | |
/// <summary> | |
/// Obtiene y modifica la cantidad del juego `Aztec Warrior`. | |
/// </summary> | |
public int CantidadAztecWarrior | |
{ | |
get | |
{ | |
return cantidadAztecWarrior; | |
} | |
set | |
{ | |
cantidadAztecWarrior = value; | |
} | |
} | |
/// <summary> | |
/// Obtiene y modifica el presupuesto para compra de juegos. | |
/// </summary> | |
public decimal Presupuesto | |
{ | |
get | |
{ | |
return presupuesto; | |
} | |
set | |
{ | |
presupuesto = value; | |
} | |
} | |
/// <summary> | |
/// Obtiene y modifica la capacidad del dispositivo. | |
/// </summary> | |
public int Capacidad | |
{ | |
get | |
{ | |
return capacidad; | |
} | |
set | |
{ | |
capacidad = value; | |
} | |
} | |
#endregion | |
#region Constructores | |
/// <summary> | |
/// Crea un nuevo control de opciones. | |
/// </summary> | |
/// <param name="principal">Control padre.</param> | |
public ControlOpciones(Principal principal) | |
{ | |
InitializeComponent(); | |
ventanaPrincipal = principal; | |
} | |
#endregion | |
#region Eventos | |
/// <summary> | |
/// Busca un juego. | |
/// </summary> | |
/// <param name="sender">Generador del evento.</param> | |
/// <param name="e">Argumentos del evento.</param> | |
private void btnBuscarJuego_Click(object sender, EventArgs e) | |
{ | |
using (DialogoBusquedaJuego dbj = new DialogoBusquedaJuego(this)) | |
{ | |
if (dbj.ShowDialog(this) == DialogResult.OK) | |
{ | |
ventanaPrincipal.SeleccionarJuego(this.presupuesto, this.capacidad); | |
} | |
} | |
} | |
/// <summary> | |
/// Calcula el juego más vendido. | |
/// </summary> | |
/// <param name="sender">Generador del evento.</param> | |
/// <param name="e">Argumentos del evento.</param> | |
private void btnJuegoMasVendido_Click(object sender, EventArgs e) | |
{ | |
ventanaPrincipal.MostrarMasVendido(); | |
} | |
/// <summary> | |
/// Determina el descuento por volumen. | |
/// </summary> | |
/// <param name="sender">Generador del evento.</param> | |
/// <param name="e">Argumentos del evento.</param> | |
private void btnDescuentosPorVolumen_Click(object sender, EventArgs e) | |
{ | |
using (DialogoVentaVolumen dvv = new DialogoVentaVolumen(this)) | |
{ | |
if (dvv.ShowDialog(this) == DialogResult.OK) | |
{ | |
ventanaPrincipal.CalcularDescuento(cantidadCarRacer2, cantidadAirAttack, cantidadMiniGolf2, cantidadAztecWarrior); | |
} | |
} | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment