예제 #1
0
        private void CargarDatos()
        {
            cls_Estados_BLL Obj_Estados_BLL = new cls_Estados_BLL();
            string          sMsjError       = string.Empty;
            DataTable       dtEstados       = new DataTable();

            if (txtFiltro.Text == string.Empty)
            {
                dtEstados = Obj_Estados_BLL.Listar_Estados(ref sMsjError);
            }
            else
            {
                dtEstados = Obj_Estados_BLL.Filtrar_Estados(ref sMsjError, txtFiltro.Text.Trim());
            }

            if (sMsjError == string.Empty)
            {
                dgv_Estados.DataSource = null;
                dgv_Estados.DataSource = dtEstados;
            }
            else
            {
                dgv_Estados.DataSource = null;
                MessageBox.Show("Se Presentó un error : [ " + sMsjError + " ].", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        private void btn_Eliminar_Click(object sender, EventArgs e)
        {
            cls_Estados_BLL objBLL    = new cls_Estados_BLL();
            string          sMsjError = string.Empty;

            if (dgv_Estados.Rows.Count > 0)
            {
                if (MessageBox.Show("Realmente desea eliminar?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    objBLL.Eliminar_Estados(ref sMsjError, dgv_Estados.SelectedRows[0].Cells[0].Value.ToString());

                    if (sMsjError != string.Empty)
                    {
                        MessageBox.Show("Se presento un error a la hora de listar : [ " + sMsjError + " ]", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Registro eliminado correctamente", "Listo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        CargarDatos();
                    }
                    txtFiltro.Text = string.Empty;
                }
            }
            else
            {
                MessageBox.Show("No hay registros para eliminar");
            }
        }
예제 #3
0
        private void CargarDatos()
        {
            #region Combo
            string            sMsjError        = string.Empty;
            cls_Estados_BLL   obj_Estado_BLL   = new cls_Estados_BLL();
            cls_Empleados_BLL obj_Empleado_BLL = new cls_Empleados_BLL();

            DataTable DTUe  = new DataTable();
            DataTable DTUEm = new DataTable();

            DTUe  = obj_Estado_BLL.Listar_Estados(ref sMsjError);
            DTUEm = obj_Empleado_BLL.Listar_Empleados(ref sMsjError);

            DTUe.Rows.Add("0", "--- Selecione un Estado ---");
            DTUEm.Rows.Add("0", "--- Selecione un Nombre ---");

            cmb_IdEstado.DataSource   = DTUe;
            cmb_IdEmpleado.DataSource = DTUEm;

            cmb_IdEstado.DisplayMember = DTUe.Columns[1].ToString();
            cmb_IdEstado.ValueMember   = DTUe.Columns[0].ToString();

            cmb_IdEmpleado.DisplayMember = DTUEm.Columns[2].ToString();
            cmb_IdEmpleado.ValueMember   = DTUEm.Columns[0].ToString();

            cmb_IdEmpleado.SelectedValue = "0";
            cmb_IdEstado.SelectedValue   = "0";
            #endregion


            if (Obj_Usuarios_Dal != null)
            {
                if (Obj_Usuarios_Dal.cBandAX == 'I')
                {
                    txt_Username.Enabled       = true;
                    Obj_Usuarios_Dal.sUsername = string.Empty;
                    Obj_Usuarios_Dal.sPassword = string.Empty;
                }
                else
                {
                    txt_Username.Text            = Obj_Usuarios_Dal.sUsername.ToString().Trim();
                    txt_Username.Enabled         = false;
                    txt_Password.Text            = Obj_Usuarios_Dal.sPassword.ToString().Trim();
                    cmb_IdEmpleado.SelectedValue = Obj_Usuarios_Dal.sIdEmpleado.ToString().Trim();
                    cmb_IdEstado.SelectedValue   = Obj_Usuarios_Dal.cIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error de capa 8 de programador. \n\nFavor Contactar a soporte técnico", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                this.Close();
            }
        }
예제 #4
0
        private void cargarDatos()
        {
            if (Obj_Mant_DAL != null)
            {
                //acá cargamos los datos de elementos del combobox
                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                string          sMsjError     = string.Empty;
                DataTable       DTE           = new DataTable();


                DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);

                DTE.Rows.Add("0", "-- SELECCIONE UN ESTADO --");

                cmb_IdEstado.DataSource    = DTE;
                cmb_IdEstado.DisplayMember = DTE.Columns[1].ToString();
                cmb_IdEstado.ValueMember   = DTE.Columns[0].ToString();

                cmb_IdEstado.SelectedValue = "0";
                if (Obj_Mant_DAL.cbanderaAccion == 'I')
                {
                    //limpiar cajas de texto
                    txt_IdTipoAvion.Enabled = true;
                    txt_CantidadPasajeros.Clear();
                    txt_CantidadPeso.Clear();
                    txt_Descripcion.Clear();
                    txt_IdTipoAvion.Clear();
                    txt_NombreAvion.Clear();
                }
                else
                {
                    txt_IdTipoAvion.Enabled    = false;
                    txt_CantidadPasajeros.Text = Obj_Mant_DAL.iCapacidadPasajeros.ToString().Trim();
                    txt_CantidadPeso.Text      = Obj_Mant_DAL.dcapacidadPeso.ToString().Trim();
                    txt_Descripcion.Text       = Obj_Mant_DAL.sDescTipoAvion.ToString().Trim();
                    txt_IdTipoAvion.Text       = Obj_Mant_DAL.sIdTipoAvion.ToString().Trim();
                    txt_NombreAvion.Text       = Obj_Mant_DAL.sNombreTipoAvion.ToString().Trim();
                    cmb_IdEstado.Text          = Obj_Mant_DAL.cIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error, contacte a soporte", "Error datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
예제 #5
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            cls_Estados_BLL Obj_Estados_BLL = new cls_Estados_BLL();


            if ((string.IsNullOrEmpty(txt_ID_Estados.Text)) || (string.IsNullOrEmpty(txt_Descripcion.Text)))
            {
                MessageBox.Show("No se pueden guardar datos vacios", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                string sMsjError = string.Empty;
                Obj_DAL_Estados.cIdEstado    = Convert.ToChar(txt_ID_Estados.Text.Trim());
                Obj_DAL_Estados.sDescripcion = txt_Descripcion.Text.Trim();
                if (Obj_DAL_Estados.cBandAX == 'I')
                {
                    Obj_Estados_BLL.Insertar_Estados(ref sMsjError, ref Obj_DAL_Estados);

                    if (sMsjError == string.Empty)
                    {
                        MessageBox.Show("Se han ingresado los datos correctamente", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        lb_Guardar.Text = "Modificar";
                    }
                    else
                    {
                        MessageBox.Show("Hubo un error al ingresar los datos a la base de datos:" + "[" + sMsjError + "]", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if ((Obj_DAL_Estados.cIdEstado == 'U') || (Obj_DAL_Estados != null))
                {
                    Obj_Estados_BLL.Modificar_Estados(ref sMsjError, ref Obj_DAL_Estados);

                    if (sMsjError == string.Empty)
                    {
                        MessageBox.Show("Se han ingresado los datos correctamente", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Hubo un error al ingresar los datos a la base de datos:" + "[" + sMsjError + "]", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
예제 #6
0
        public void Cargar_Datos()
        {
            cls_Estados_BLL Obj_BLL   = new cls_Estados_BLL();
            string          sMsjError = string.Empty;
            DataTable       dtEstados = new DataTable();

            if (toolStripTextBox1.Text == string.Empty)
            {
                dtEstados = Obj_BLL.Listar_Estados(ref sMsjError);
            }
            else
            {
                dtEstados = Obj_BLL.Filtrar_Estados(ref sMsjError, toolStripTextBox1.Text);
            }
            if (sMsjError == string.Empty)
            {
                dataGridView1.DataSource = null;
                dataGridView1.DataSource = dtEstados;
            }
        }
예제 #7
0
        private void CargarDatos()
        {
            #region CargarDatos IdEstados
            cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
            string          sMsjError     = string.Empty;
            DataTable       DTE           = new DataTable();
            DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);
            DTE.Rows.Add("0", "--- SELECCIONE UN ESTADO ---");
            cmb_IdEstado.DataSource    = DTE;
            cmb_IdEstado.DisplayMember = DTE.Columns[1].ToString();
            cmb_IdEstado.ValueMember   = DTE.Columns[0].ToString();
            cmb_IdEstado.SelectedValue = "0";

            #endregion



            if (Obj_ManteCategorias_DAL != null)
            {
                if (Obj_ManteCategorias_DAL.cBandAX == 'I')
                {
                    tb_IdCategoria.Enabled = false;
                    lbiIdCategoria.Enabled = true;
                    tb_DescCategoria.Text  = string.Empty;
                }
                else
                {
                    toolStripLabel1.Text       = "Modificar";
                    tb_IdCategoria.Text        = Obj_ManteCategorias_DAL.iIdCategoria.ToString().Trim();
                    tb_IdCategoria.Enabled     = false;
                    tb_DescCategoria.Text      = Obj_ManteCategorias_DAL.sDescCategoria.ToString().Trim();
                    cmb_IdEstado.SelectedValue = Obj_ManteCategorias_DAL.cIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error de capa 8 de programador. \n\nFavor Contactar a soporte técnico", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                this.Close();
            }
        }
        private void CargarDatos()
        {
            cls_TiposClientes_DAL Obj_Tipo_clientes_DAL = new cls_TiposClientes_DAL();

            if (Obj_DAL_TiposClientes != null)
            {
                string sMsjError = string.Empty;

                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                DataTable       DTE           = new DataTable();
                DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);
                DTE.Rows.Add("0", "--SELECCIONE UN ESTADO--");
                cmb_IDEstado.DataSource    = DTE;
                cmb_IDEstado.DisplayMember = DTE.Columns[1].ToString();
                cmb_IDEstado.ValueMember   = DTE.Columns[0].ToString();
                cmb_IDEstado.SelectedValue = "0";

                txt_IDTipoCliente.Enabled = false;

                if (Obj_DAL_TiposClientes.CBandAX == 'I')
                {
                    txt_IDTipoCliente.Text = string.Empty;
                    txt_TipoCliente.Text   = string.Empty;
                    txt_descripcion.Text   = string.Empty;
                }
                else
                {
                    toolStripLabel3.Text       = "Modificar";
                    txt_IDTipoCliente.Text     = Obj_DAL_TiposClientes.IIdTipoCliente.ToString().Trim();
                    txt_TipoCliente.Text       = Obj_DAL_TiposClientes.STipoCliente.ToString().Trim();
                    txt_descripcion.Text       = Obj_DAL_TiposClientes.SDescripcion.ToString().Trim();
                    cmb_IDEstado.SelectedValue = Obj_DAL_TiposClientes.CIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presento un error capa 8 del programador ", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                this.Close();
            }
        }
        private void CargarDatos()
        {
            if (Obj_DAL_TipoEmpleado != null)
            {
                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                string          sMsjError     = string.Empty;

                DataTable DTLE = new DataTable();
                DTLE = ObjBLLEstados.Listar_Estados(ref sMsjError);


                DTLE.Rows.Add("0", "--SELECCIONE UN ESTADO--");

                cmb_IDEstado.DataSource    = DTLE;
                cmb_IDEstado.DisplayMember = DTLE.Columns[1].ToString();
                cmb_IDEstado.ValueMember   = DTLE.Columns[0].ToString();

                cmb_IDEstado.SelectedValue = "0";
                txt_IDTipoEmpleado.Enabled = false;

                if (Obj_DAL_TipoEmpleado.CBandAX == 'I')
                {
                    txt_IDTipoEmpleado.Clear();
                    txt_desc.Clear();
                }
                else
                {
                    toolStripLabel3.Text       = "Modificar";
                    txt_IDTipoEmpleado.Text    = Obj_DAL_TipoEmpleado.ITipoEmpleado.ToString().Trim();
                    txt_desc.Text              = Obj_DAL_TipoEmpleado.SDescTipo.ToString().Trim();
                    cmb_IDEstado.SelectedValue = Obj_DAL_TipoEmpleado.CIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presento un error capa8", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
        }
예제 #10
0
        public void CargarDatos()
        {
            if (Obj_Paises_DAL != null)
            {
                #region Estados
                cls_Estados_BLL ObjEstados = new cls_Estados_BLL();
                DataTable       DT         = new DataTable();
                string          sMsjError  = string.Empty;
                DT = ObjEstados.Listar_Estados(ref sMsjError);
                cmboxEstado.DataSource = DT;
                DT.Rows.Add("0", "Seleccione un estado");
                cmboxEstado.DisplayMember = DT.Columns[1].ToString();
                cmboxEstado.ValueMember   = DT.Columns[0].ToString();
                cmboxEstado.SelectedValue = "0";
                #endregion

                if (Obj_Paises_DAL.cBandera == 'I')
                {
                    txtNombrePais.Clear();
                    txtCodigoISO.Clear();
                    txtCodigoArea.Clear();
                }
                else
                {
                    toolStripLabel1.Text      = "Modificar";
                    txt_IdPais.Text           = Obj_Paises_DAL.iIdPais.ToString().Trim();
                    txtNombrePais.Text        = Obj_Paises_DAL.sNombrePais;
                    txtCodigoISO.Text         = Obj_Paises_DAL.sCodigoISOPais;
                    txtCodigoArea.Text        = Obj_Paises_DAL.sCodigoAreaPais;
                    cmboxEstado.SelectedValue = Obj_Paises_DAL.cIdEstado.ToString();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error, contacte al administrador", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
예제 #11
0
        private void CargarDatos()
        {
            cls_BaseDatos_DAL objDAL_BaseDatos = new cls_BaseDatos_DAL();

            if (objDAL_Aerolinea != null)
            {
                #region Combo Estados
                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                string          sMsjError     = string.Empty;
                DataTable       DTE           = new DataTable();
                DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);
                DTE.Rows.Add("0", "--Seleccione una opcion--");
                cmb_IdEstado.DataSource    = DTE;
                cmb_IdEstado.DisplayMember = DTE.Columns[1].ToString();
                cmb_IdEstado.ValueMember   = DTE.Columns[0].ToString();
                cmb_IdEstado.SelectedValue = "0";
                #endregion
                if (objDAL_Aerolinea.cBandera == 'I')
                {
                    txt_IdAerolinea.Text = "Asignación automatica";
                    //txt_IdAerolinea.Enabled = true;
                    txt_NombreAerolinea.Clear();
                }
                else
                {
                    toolStripLabel1.Text = "Modificar";
                    txt_IdAerolinea.Text = objDAL_Aerolinea.iIdAerolinea.ToString().Trim();
                    //txt_IdAerolinea.Enabled = false;
                    txt_NombreAerolinea.Text   = objDAL_Aerolinea.sNombreAerolinea.ToString().Trim();
                    cmb_IdEstado.SelectedValue = objDAL_Aerolinea.cIdEstado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presento un capa 8 del programador");
                Close();
            }
        }
예제 #12
0
        public void CargarDatos()
        {
            if (Obj_Destinos_DAL != null)
            {
                string sMsjError = string.Empty;
                #region Aerolineas
                cls_Aerolineas_BLL ObjAerolinea = new cls_Aerolineas_BLL();
                DataTable          DTA          = new DataTable();
                DTA = ObjAerolinea.ListarAerolineas(ref sMsjError);
                cmboxAerolinea.DataSource = DTA;
                DTA.Rows.Add("0", "Seleccione una aerolinea");
                cmboxAerolinea.DisplayMember = DTA.Columns[1].ToString();
                cmboxAerolinea.ValueMember   = DTA.Columns[0].ToString();
                cmboxAerolinea.SelectedValue = "0";


                #endregion

                #region Paises
                cls_Paises_BLL ObjPaises = new cls_Paises_BLL();
                DataTable      DTP       = new DataTable();
                DataTable      DTP1      = new DataTable();
                DTP  = ObjPaises.ListarPaises(ref sMsjError);
                DTP1 = ObjPaises.ListarPaises(ref sMsjError);
                cmboxPaisLlegada.DataSource = DTP;
                cmboxPaisSalida.DataSource  = DTP1;
                DTP.Rows.Add("0", "Seleccione un país");
                DTP1.Rows.Add("0", "Seleccione un país");
                cmboxPaisSalida.DisplayMember  = DTP1.Columns[1].ToString();
                cmboxPaisLlegada.DisplayMember = DTP.Columns[1].ToString();
                cmboxPaisSalida.ValueMember    = DTP1.Columns[0].ToString();
                cmboxPaisLlegada.ValueMember   = DTP.Columns[0].ToString();
                cmboxPaisLlegada.SelectedValue = "0";
                cmboxPaisSalida.SelectedValue  = "0";
                #endregion

                #region Estados
                cls_Estados_BLL ObjEstados = new cls_Estados_BLL();
                DataTable       DT         = new DataTable();
                DT = ObjEstados.Listar_Estados(ref sMsjError);
                cmboxEstado.DataSource = DT;
                DT.Rows.Add("0", "Seleccione un estado");
                cmboxEstado.DisplayMember = DT.Columns[1].ToString();
                cmboxEstado.ValueMember   = DT.Columns[0].ToString();
                cmboxEstado.SelectedValue = "0";
                #endregion

                if (Obj_Destinos_DAL.cBandera == 'I')
                {
                    txt_IdDestino.Clear();
                    txt_NombreDestino.Clear();
                }
                else
                {
                    toolStripLabel1.Text           = "Modificar";
                    txt_IdDestino.Text             = Obj_Destinos_DAL.sIdDestino;
                    txt_IdDestino.Enabled          = false;
                    cmboxAerolinea.SelectedValue   = Obj_Destinos_DAL.bIdAerolinea.ToString();
                    txt_NombreDestino.Text         = Obj_Destinos_DAL.sNomDestino;
                    cmboxPaisSalida.SelectedValue  = Obj_Destinos_DAL.bPaisSalida.ToString();
                    cmboxPaisLlegada.SelectedValue = Obj_Destinos_DAL.bPaisLlegada.ToString();
                    cmboxEstado.SelectedValue      = Obj_Destinos_DAL.cIdEstado.ToString();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error, contacte al administrador", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
예제 #13
0
        private void cargarDatos()
        {
            if (Obj_Mant_DAL != null)
            {
                #region CargarDatos IdDestino
                cls_Destinos_BLL ObjBLLDestinos    = new cls_Destinos_BLL();
                string           sMsjErrorDEestido = string.Empty;
                DataTable        DTEDestino        = new DataTable();
                DTEDestino = ObjBLLDestinos.ListarDestinos(ref sMsjErrorDEestido);
                DTEDestino.Rows.Add("0", 1, "-- SELECCIONE UN DESTINO --", 2, 3, 'a');
                cmb_IdDestino.DataSource    = DTEDestino;
                cmb_IdDestino.DisplayMember = DTEDestino.Columns[2].ToString();
                cmb_IdDestino.ValueMember   = DTEDestino.Columns[0].ToString();
                cmb_IdDestino.SelectedValue = "0";

                #endregion

                #region CargarDatos IdAerolinea
                cls_Aerolineas_BLL ObjBLLAerolinea    = new cls_Aerolineas_BLL();
                string             sMsjErrorAerolinea = string.Empty;
                DataTable          DTEAerolinea       = new DataTable();
                DTEAerolinea = ObjBLLAerolinea.ListarAerolineas(ref sMsjErrorAerolinea);
                DTEAerolinea.Rows.Add("0", "-- SELECCIONE UNA AEROLINEA --", 'a');
                cmb_IdAerolinea.DataSource    = DTEAerolinea;
                cmb_IdAerolinea.DisplayMember = DTEAerolinea.Columns[1].ToString();
                cmb_IdAerolinea.ValueMember   = DTEAerolinea.Columns[0].ToString();
                cmb_IdAerolinea.SelectedValue = "0";
                #endregion


                #region CargarDatos IdAvion
                cls_Aviones_BLL ObjBLLAvion    = new cls_Aviones_BLL();
                string          sMsjErrorAvion = string.Empty;
                DataTable       DTEAvion       = new DataTable();
                DTEAvion = ObjBLLAvion.ListarAvion(ref sMsjErrorAvion);
                DTEAvion.Rows.Add("0", "-- SELECCIONE UN AVION --", "0", 0, "0", 'a');
                cmb_IdAvion.DataSource    = DTEAvion;
                cmb_IdAvion.DisplayMember = DTEAvion.Columns[1].ToString();
                cmb_IdAvion.ValueMember   = DTEAvion.Columns[0].ToString();
                cmb_IdAvion.SelectedValue = "0";
                #endregion

                #region CargarDatos IdEstados
                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                string          sMsjError     = string.Empty;
                DataTable       DTE           = new DataTable();
                DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);
                DTE.Rows.Add("0", "-- SELECCIONE UN ESTADO --");
                cmb_IdEstado.DataSource    = DTE;
                cmb_IdEstado.DisplayMember = DTE.Columns[1].ToString();
                cmb_IdEstado.ValueMember   = DTE.Columns[0].ToString();
                cmb_IdEstado.SelectedValue = "0";

                #endregion

                if (Obj_Mant_DAL.cbanderaAccion == 'I')
                {
                    txt_IdVuelo.Enabled = true;
                    txt_IdVuelo.SelectAll();
                    txt_IdVuelo.Focus();
                }
                else
                {
                    txt_IdVuelo.Enabled = false;
                    txt_IdVuelo.Text    = Obj_Mant_DAL.sIdVuelo.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error, contacte a soporte", "Error datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
예제 #14
0
        private void CargarDatos()
        {
            cls_BaseDatos_DAL objDAL_BaseDatos = new cls_BaseDatos_DAL();

            if (objDal_Aviones != null)
            {
                #region Combo Estados
                cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
                string          sMsjError     = string.Empty;

                DataTable DTE = new DataTable();
                DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);

                DTE.Rows.Add("0", "--Seleccione una opcion--");

                cmb_IdEstado.DataSource    = DTE;
                cmb_IdEstado.DisplayMember = DTE.Columns[1].ToString();
                cmb_IdEstado.ValueMember   = DTE.Columns[0].ToString();

                cmb_IdEstado.SelectedValue = "0";
                #endregion

                #region Combo Aero
                cls_Aerolineas_BLL ObjAero = new cls_Aerolineas_BLL();
                DataTable          DTA     = new DataTable();
                DTA = ObjAero.ListarAerolineas(ref sMsjError);
                DTA.Rows.Add("0", "--Seleccione una opcion--");
                cmb_IdAerolinea.DataSource    = DTA;
                cmb_IdAerolinea.DisplayMember = DTA.Columns[1].ToString();
                cmb_IdAerolinea.ValueMember   = DTA.Columns[0].ToString();
                cmb_IdAerolinea.SelectedValue = "0";
                #endregion

                #region Combo TipoA
                cls_TiposA_BLL ObjTiposA = new cls_TiposA_BLL();
                DataTable      DTTA      = new DataTable();
                DTTA = ObjTiposA.ListarTiposA(ref sMsjError);
                DTTA.Rows.Add("0", "--Seleccione una opcion--");
                cmb_IdTipoAvion.DataSource    = DTTA;
                cmb_IdTipoAvion.DisplayMember = DTTA.Columns[1].ToString();
                cmb_IdTipoAvion.ValueMember   = DTTA.Columns[0].ToString();
                cmb_IdTipoAvion.SelectedValue = "0";
                #endregion

                if (objDal_Aviones.cBandera == 'I')
                {
                    txt_IdAvion.Clear();
                    txt_DescAvion.Clear();
                    txt_NomAvion.Clear();
                    txt_IdAvion.Enabled = true;
                }
                else
                {
                    toolStripLabel1.Text          = "Modificar";
                    txt_DescAvion.Text            = objDal_Aviones.sDescAvion;
                    txt_IdAvion.Text              = objDal_Aviones.sIdAvion;
                    txt_NomAvion.Text             = objDal_Aviones.sNomAvion;
                    cmb_IdAerolinea.SelectedValue = objDal_Aviones.iIdAerolinea.ToString();
                    cmb_IdEstado.SelectedValue    = objDal_Aviones.cIdEstado.ToString();
                    cmb_IdTipoAvion.SelectedValue = objDal_Aviones.sIdTipoAvion.ToString();
                    txt_IdAvion.Enabled           = false;
                }
            }
            else
            {
                MessageBox.Show("Se presento un capa 8 del programador");
                Close();
            }
        }
예제 #15
0
        public void CargarDatos()
        {
            if (Obj_Empleados_DAL != null)
            {
                string M_Error = string.Empty;
                #region Estados
                cls_Estados_BLL ObjEstados = new cls_Estados_BLL();
                DataTable       DT_Estados = new DataTable();

                DT_Estados = ObjEstados.Listar_Estados(ref M_Error);

                cb_Estado.DataSource = DT_Estados;
                DT_Estados.Rows.Add("0", "-- Seleccione un valor --");
                cb_Estado.DisplayMember = DT_Estados.Columns[1].ToString();
                cb_Estado.ValueMember   = DT_Estados.Columns[0].ToString();

                cb_Estado.SelectedValue = "0";
                #endregion

                #region ID Tipo Empleado
                cls_TiposEmpleados_BLL ObjTipoEmpleados = new cls_TiposEmpleados_BLL();
                DataTable DT_TipoEmpleados = new DataTable();
                DT_TipoEmpleados = ObjTipoEmpleados.ListarTiposEmpleados(ref M_Error);
                DT_TipoEmpleados.Rows.Add("0", "-- Seleccione un valor --");
                cb_TipoEmpleado.DataSource    = DT_TipoEmpleados;
                cb_TipoEmpleado.DisplayMember = DT_TipoEmpleados.Columns[1].ToString();
                cb_TipoEmpleado.ValueMember   = DT_TipoEmpleados.Columns[0].ToString();
                cb_TipoEmpleado.SelectedValue = "0";
                #endregion

                #region ID Aerolinea
                cls_Aerolineas_BLL ObjAerolinea = new cls_Aerolineas_BLL();
                DataTable          DT_Aerolinea = new DataTable();
                DT_Aerolinea = ObjAerolinea.ListarAerolineas(ref M_Error);
                DT_Aerolinea.Rows.Add("0", "-- Seleccione un valor --");
                cb_IdAerolinea.DataSource    = DT_Aerolinea;
                cb_IdAerolinea.DisplayMember = DT_Aerolinea.Columns[1].ToString();
                cb_IdAerolinea.ValueMember   = DT_Aerolinea.Columns[0].ToString();
                cb_IdAerolinea.SelectedValue = "0";
                #endregion

                if (Obj_Empleados_DAL.cBandera == 'I')
                {
                    txt_Direccion.Clear();
                    txt_Nombre.Clear();
                    txt_Apellidos.Clear();
                    txt_Edad.Clear();
                    txt_IdEmpleado.Clear();
                    txt_Salario.Clear();
                    txt_Cedula.Clear();
                    txt_Celular.Clear();
                    txt_TelCasa.Clear();
                    txt_TelRef.Clear();
                }
                else
                {
                    toolStripLabel1.Text          = "Modificar";
                    txt_Direccion.Text            = Obj_Empleados_DAL.sDireccion;
                    txt_Nombre.Text               = Obj_Empleados_DAL.sNombre;
                    txt_Apellidos.Text            = Obj_Empleados_DAL.sApellidos;
                    txt_Edad.Text                 = Obj_Empleados_DAL.bEdad.ToString().Trim();
                    txt_IdEmpleado.Text           = Obj_Empleados_DAL.sIdEmpleado.ToString().Trim();
                    txt_Salario.Text              = Obj_Empleados_DAL.dSalario.ToString().Trim();
                    txt_Cedula.Text               = Obj_Empleados_DAL.iCedula.ToString().Trim();
                    txt_Celular.Text              = Obj_Empleados_DAL.iCelular.ToString().Trim();
                    txt_TelCasa.Text              = Obj_Empleados_DAL.iTelCasa.ToString().Trim();
                    txt_TelRef.Text               = Obj_Empleados_DAL.iTelRef.ToString().Trim();
                    cb_Estado.SelectedValue       = Obj_Empleados_DAL.cIdEstado.ToString().Trim();
                    cb_IdAerolinea.SelectedValue  = Obj_Empleados_DAL.iIdAerolinea.ToString().Trim();
                    cb_TipoEmpleado.SelectedValue = Obj_Empleados_DAL.iIdTipoEmpleado.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error \nContacte al administrador", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
예제 #16
0
        private void CargarDatos()
        {
            #region Combo ID Estados
            cls_Estados_BLL ObjBLLEstados = new cls_Estados_BLL();
            string          sMsjError     = string.Empty;
            DataTable       DTE           = new DataTable();
            DTE = ObjBLLEstados.Listar_Estados(ref sMsjError);


            DTE.Rows.Add("0", "SELECCIONE UN ESTADO");


            cmb_ID_Estado.DataSource    = DTE;
            cmb_ID_Estado.DisplayMember = DTE.Columns[1].ToString();
            cmb_ID_Estado.ValueMember   = DTE.Columns[0].ToString();
            cmb_ID_Estado.SelectedValue = "0";
            #endregion

            #region Combo ID Clientes
            cls_TiposClientes_BLL ObjBLLTipoC = new cls_TiposClientes_BLL();
            string    sMsjError1 = string.Empty;
            DataTable DTTC       = new DataTable();
            DTTC = ObjBLLTipoC.ListarTiposClientes(ref sMsjError1);

            DTTC.Rows.Add("0", "SELECCIONE UN ID CLIENTE");

            cmb_ID_Tipo_Cliente.DataSource    = DTTC;
            cmb_ID_Tipo_Cliente.DisplayMember = DTTC.Columns[1].ToString();
            cmb_ID_Tipo_Cliente.ValueMember   = DTTC.Columns[0].ToString();
            cmb_ID_Tipo_Cliente.SelectedValue = "0";
            #endregion


            if (ObjClientes_DAL != null)
            {
                if (ObjClientes_DAL.cBandAxn == 'I')
                {
                    txt_ID_Cliente.Text    = string.Empty;
                    txt_ID_Cliente.Enabled = true;
                    txt_Cedula.Text        = string.Empty;
                    txt_Nombre.Text        = string.Empty;
                    txt_Apellidos.Text     = string.Empty;
                    txt_Telefono.Text      = string.Empty;
                }
                else
                {
                    lb_Guardar.Text        = "Modificar";
                    txt_ID_Cliente.Text    = ObjClientes_DAL.sIdCliente.ToString().Trim();
                    txt_ID_Cliente.Enabled = false;
                    txt_Cedula.Text        = ObjClientes_DAL.sCedula.ToString().Trim();
                    txt_Nombre.Text        = ObjClientes_DAL.sNombre.ToString().Trim();
                    txt_Apellidos.Text     = ObjClientes_DAL.sApellido.ToString().Trim();
                    txt_Telefono.Text      = ObjClientes_DAL.sTelefono.ToString().Trim();
                }
            }
            else
            {
                MessageBox.Show("Se presentó un error de capa 8 de programador. \n\nFavor Contactar a soporte técnico", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                this.Close();
            }
        }