示例#1
0
        public void bttnCheckout_Click(System.Object sender, System.EventArgs e)
        {
            if (txtTransID.Text == null)
            {
                Interaction.MsgBox("Por favor seleccione una transacción para dar salida!", Constants.vbExclamation, "Nota");
            }
            else
            {
                if (Conversion.Val(txtCash.Text) < Conversion.Val(txtTotal.Text))
                {
                    Interaction.MsgBox("Efectivo Insuficiente!", Constants.vbExclamation, "Nota");
                }
                else
                {
                    string @out = System.Convert.ToString(Interaction.MsgBox("Confirma dar Salida", (int)Constants.vbQuestion + Constants.vbYesNo, "Salida"));
                    if (@out == Constants.vbYes.ToString())
                    {
                        if (Modulo1.con.State == ConnectionState.Closed)
                        {
                            Modulo1.con.Open();
                        }

                        OleDbCommand update_trans = new OleDbCommand("UPDATE tblTransaction SET Remarks = \'Salida\' WHERE TransID = " + lblTransID.Text + "", Modulo1.con);
                        update_trans.ExecuteNonQuery();

                        OleDbCommand update_guest = new OleDbCommand("UPDATE tblGuest SET Remarks = \'Disponible\' WHERE ID = " + lblGuestID.Text + "", Modulo1.con);
                        update_guest.ExecuteNonQuery();

                        OleDbCommand update_room = new OleDbCommand("UPDATE tblRoom SET Status = \'Disponible\' WHERE RoomNumber = " + txtRoomNumber.Text + "", Modulo1.con);
                        update_room.ExecuteNonQuery();
                        Interaction.MsgBox("Invitado Salió", Constants.vbInformation, "Salida");
                        Modulo1.con.Close();
                        clear_text();
                        this.Close();
                        frmSalida abrir = new frmSalida();
                        abrir.ShowDialog();
                    }
                }
            }
        }
示例#2
0
 static void defaultInstance_FormClosed(object sender, FormClosedEventArgs e)
 {
     defaultInstance = null;
 }