domingo, 25 de septiembre de 2011

Programa del hotel

Esta es la segunda parte que es del Form1

/*
 * Creado por SharpDevelop.
 * Usuario: Alumno
 * Fecha: 09/09/2011
 * Hora: 09:35 a.m.
 *
 * Para cambiar esta plantilla use Herramientas | Opciones | Codificación | Editar Encabezados Estándar
 */
using System;
using System.Drawing;
using System.Windows.Forms;

namespace practica_6
{
    /// <summary>
    /// Description of Form1.
    /// </summary>
    public partial class Form1 : Form
    {
        public Form1()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
           
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
           
           
        }
       

        void CmbtipohabitacionSelectedIndexChanged(object sender, EventArgs e)
        {
            if(cmbtipohabitacion.Text=="Ninguna")
            {
                pictureBox1.Image=new Bitmap("riu logo.jpg");
            }
            if(cmbtipohabitacion.Text=="Estandar")
            {
                pictureBox1.Image=new Bitmap("habitacion estandar.jpg");
            }
            if(cmbtipohabitacion.Text=="Junior Suite")
            {
                pictureBox1.Image=new Bitmap("habitacion junior.jpg");
            }
            if(cmbtipohabitacion.Text=="Suite")
            {
                pictureBox1.Image=new Bitmap("suite.jpg");
            }
            if(cmbtipohabitacion.Text=="Ninguno")
            {
                pictureBox1.Image=new Bitmap("riu logo.jpg");
            }
        }
       
        void GpbtipoEnter(object sender, EventArgs e)
        {
           
        }
       

        void ChksoloCheckedChanged(object sender, EventArgs e)
        {
            if(chksolo.Checked==true)
            {
                if(cmbtipohabitacion.Text=="Estandar")
                {
                txtimporte.Text=Convert.ToString("1000");
                }
                if(cmbtipohabitacion.Text=="Junior Suite")
                {
                    txtimporte.Text=Convert.ToString("2000");
                }
                if(cmbtipohabitacion.Text=="Suite")
                {
                    txtimporte.Text=Convert.ToString("3000");
                }
            }
           
            txtimporte.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*(Convert.ToDouble(txtdias.Text)));
            txtiva.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*.16);
            txttotal.Text=(Convert.ToString(Convert.ToDouble(txtimporte.Text) + Convert.ToDouble(txtiva.Text)));
        }
       
        void TxtimporteTextChanged(object sender, EventArgs e)
        {
           
           
        }
           
       
        void ChkdesayunoincCheckedChanged(object sender, EventArgs e)
        {
            if(chkdesayunoinc.Checked==true)
            {
                if(cmbtipohabitacion.Text=="Estandar")
                {
                txtimporte.Text=Convert.ToString("1500");
                }
                if(cmbtipohabitacion.Text=="Junior Suite")
                {
                    txtimporte.Text=Convert.ToString("2500");
                }
                if(cmbtipohabitacion.Text=="Suite")
                {
                    txtimporte.Text=Convert.ToString("3500");
                }
            }
           
            txtimporte.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*(Convert.ToDouble(txtdias.Text)));
            txtiva.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*.16);
            txttotal.Text=(Convert.ToString(Convert.ToDouble(txtimporte.Text) + Convert.ToDouble(txtiva.Text)));
        }
       
        void ChktodoincluCheckedChanged(object sender, EventArgs e)
        {
            if(chktodoinclu.Checked==true)
            {
                if(cmbtipohabitacion.Text=="Estandar")
                {
                txtimporte.Text=Convert.ToString("2000");
                }
                if(cmbtipohabitacion.Text=="Junior Suite")
                {
                    txtimporte.Text=Convert.ToString("3000");
                }
                if(cmbtipohabitacion.Text=="Suite")
                {
                    txtimporte.Text=Convert.ToString("4000");
                }
            }
       
            txtimporte.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*(Convert.ToDouble(txtdias.Text)));
            txtiva.Text=Convert.ToString(Convert.ToDouble(txtimporte.Text)*.16);
            txttotal.Text=(Convert.ToString(Convert.ToDouble(txtimporte.Text) + Convert.ToDouble(txtiva.Text)));
        }
       
        void DtpllegadaValueChanged(object sender, EventArgs e)
        {
            DateTime fecha;
           
       
               
            fecha = dtpllegada.Value;
           
        }
       
        void DtpsalidaValueChanged(object sender, EventArgs e)
        {
            DateTime fecha2;
           
            fecha2 = dtpsalida.Value;
                   
              txtdias.Text =fecha2.DayOfYear.ToString();
       
     txtdias.Text=Convert.ToString(Convert.ToDouble(dtpsalida.Value.DayOfYear)-Convert.ToDouble(dtpllegada.Value.DayOfYear));
   
           
        }
    }
}

Programa del hotel

Se realiza un software para un hotel y lo hare en 2 publicaciones

En esta publicacion pongo lo que va en el MainForm

/*
 * Creado por SharpDevelop.
 * Usuario: Alumno
 * Fecha: 09/09/2011
 * Hora: 09:32 a.m.
 *
 * Para cambiar esta plantilla use Herramientas | Opciones | Codificación | Editar Encabezados Estándar
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace practica_6
{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
           
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
       
        void CmdaceptarClick(object sender, EventArgs e)
        {
            //EN ESTA PARTE VAMOS A VALIDAR AL USUARIO Y CONTRASEÑA
           
            if(txtusuario.Text=="Administrador" && txtcontraseña.Text=="123")
            {
                Form1 x =new Form1();
           
                this.Visible=false;
                x.Show();
               
               
           
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
    }
}