示例#1
0
        private void button2_Click(object sender, EventArgs events)
        {
            try
            {
                Login.Login.LoggedUserRoleID = DBHandler.SPWithValue("MATOTA.GetGuestRoleID");
            }
            catch (InvalidCastException e)
            {
                // Este tipo exc solo va a pasar si no se encontro el rol guest en la db
                MessageBox.Show("Ocurrio un error interno", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }

            MenuPrincipal menu = new MenuPrincipal();

            this.Hide();
            menu.ShowDialog(this);
            this.Close();
        }
示例#2
0
 public static void listarHoteles(ComboBox comboBox)
 {
     comboBox.DataSource    = DBHandler.QueryForComboBox("SELECT idHotel,nombre FROM MATOTA.Hotel WHERE idHotel NOT IN (SELECT idHotel FROM MATOTA.InactividadHotel)");
     comboBox.DisplayMember = "nombre";
     comboBox.ValueMember   = "idHotel";
 }
示例#3
0
        public static string getIdTipoDoc(string tipoDoc)
        {
            var query = new QueryBuilder(QueryBuilder.QueryBuilderType.SELECT).Fields("td.idTipoDocumento").Table("MATOTA.TipoDocumento td").AddEquals("td.nombre", tipoDoc).Build();

            return(DBHandler.Query(query).First().Values.First().ToString());
        }
 public static void listarTipoDoc(ComboBox comboBox)
 {
     comboBox.DataSource    = DBHandler.QueryForComboBox("SELECT * FROM MATOTA.TipoDocumento");
     comboBox.DisplayMember = "nombre";
     comboBox.ValueMember   = "IdTipoDocumento";
 }
示例#5
0
 public static void listarRegimenes(ComboBox comboBox)
 {
     comboBox.DataSource    = DBHandler.QueryForComboBox("SELECT idRegimen,nombre FROM MATOTA.Regimen");
     comboBox.DisplayMember = "nombre";
     comboBox.ValueMember   = "idRegimen";
 }
示例#6
0
 public static void listarRoles(ComboBox comboBox)
 {
     comboBox.DataSource    = DBHandler.QueryForComboBox("SELECT * FROM MATOTA.Rol WHERE NOMBRE <> 'Guest'");
     comboBox.DisplayMember = "NOMBRE";
     comboBox.ValueMember   = "idRol";
 }