Exemple #1
0
        private void tls_btn_Modificar_Click(object sender, EventArgs e)
        {
            frm_Modificar_Destinos ModificarDestinos = new frm_Modificar_Destinos();

            if (dgv_Destinos.RowCount > 0)
            {
                ObjDestinos_DAL = new cls_Destinos_DAL();

                ObjDestinos_DAL.cBandera     = 'U';
                ObjDestinos_DAL.sIdDestino   = dgv_Destinos.SelectedRows[0].Cells[0].Value.ToString().Trim();
                ObjDestinos_DAL.bIdAerolinea = Convert.ToByte(dgv_Destinos.SelectedRows[0].Cells[1].Value);
                ObjDestinos_DAL.sNomDestino  = dgv_Destinos.SelectedRows[0].Cells[2].Value.ToString().Trim();
                ObjDestinos_DAL.bPaisSalida  = Convert.ToByte(dgv_Destinos.SelectedRows[0].Cells[3].Value);
                ObjDestinos_DAL.bPaisLlegada = Convert.ToByte(dgv_Destinos.SelectedRows[0].Cells[4].Value);
                ObjDestinos_DAL.cIdEstado    = Convert.ToChar(dgv_Destinos.SelectedRows[0].Cells[5].Value);

                ModificarDestinos.Obj_Destinos_DAL = ObjDestinos_DAL;
                Hide();
                ModificarDestinos.ShowDialog();

                tls_txt_Filtro.Text = string.Empty;
                CargarDatos();
            }
            else
            {
                MessageBox.Show("No se pueden realizar la acción, debido a que no existen datos por modificar", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        public void Insertar_Destinos(ref string sMsjError, ref cls_Destinos_DAL ObjDestinos_DAL)
        {
            cls_BaseDatos_DAL Obj_DAL = new cls_BaseDatos_DAL();
            cls_Bases_BLL     Obj_BLL = new cls_Bases_BLL();

            Obj_BLL.TablaParametros(ref Obj_DAL);
            Obj_DAL.DT_Parametros.Rows.Add("@IdDestino", 3, ObjDestinos_DAL.sIdDestino);
            Obj_DAL.DT_Parametros.Rows.Add("@IdAerolinea", 1, ObjDestinos_DAL.bIdAerolinea);
            Obj_DAL.DT_Parametros.Rows.Add("@NomDestino", 3, ObjDestinos_DAL.sNomDestino);
            Obj_DAL.DT_Parametros.Rows.Add("@PaisSalida", 1, ObjDestinos_DAL.bPaisSalida);
            Obj_DAL.DT_Parametros.Rows.Add("@PaisLlegada", 1, ObjDestinos_DAL.bPaisLlegada);
            Obj_DAL.DT_Parametros.Rows.Add("@IdEstado", 2, ObjDestinos_DAL.cIdEstado);

            Obj_DAL.sSentencia = ConfigurationManager.AppSettings["Insertar Destinos"].ToString().Trim();
            Obj_BLL.Ejec_NonQuery(ref Obj_DAL);

            if (Obj_DAL.sMsgError == string.Empty)
            {
                sMsjError = string.Empty;
                ObjDestinos_DAL.cBandera = 'U';
            }
            else
            {
                sMsjError = Obj_DAL.sMsgError;
                ObjDestinos_DAL.cBandera = 'I';
            }
        }
Exemple #3
0
        private void tls_btn_Nuevo_Click(object sender, EventArgs e)
        {
            frm_Modificar_Destinos ModificarDestinos = new frm_Modificar_Destinos();

            ObjDestinos_DAL = new cls_Destinos_DAL();

            ObjDestinos_DAL.cBandera     = 'I';
            ObjDestinos_DAL.sIdDestino   = string.Empty;
            ObjDestinos_DAL.bIdAerolinea = 0;
            ObjDestinos_DAL.sNomDestino  = string.Empty;
            ObjDestinos_DAL.bPaisSalida  = 0;
            ObjDestinos_DAL.bPaisLlegada = 0;
            ObjDestinos_DAL.cIdEstado    = ' ';

            ModificarDestinos.Obj_Destinos_DAL = ObjDestinos_DAL;
            Hide();
            ModificarDestinos.ShowDialog();

            tls_txt_Filtro.Text = string.Empty;
            CargarDatos();
        }