Exemple #1
0
        public void Filtrar_MediosElectronicos(ref cls_MediosElectronicos_DAL Obj_MediosElectronicos_DAL, string sFiltro)
        {
            try
            {
                cls_BD_BLL Obj_BD_BLL = new cls_BD_BLL();
                cls_BD_DAL Obj_BD_DAL = new cls_BD_DAL();

                Obj_BD_DAL.SNomb_Sp   = "sp_Filtrar_MediosElectronicos";
                Obj_BD_DAL.SNombTabla = "MediosElectronicos";

                Obj_BD_BLL.Crear_DT_Parametros(ref Obj_BD_DAL);
                Obj_BD_DAL.dt_Parametros.Rows.Add("@NombreMedioElectronico", "3", sFiltro);

                Obj_BD_BLL.Exec_DataAdapter(ref Obj_BD_DAL);

                if (Obj_BD_DAL.SMsjError == string.Empty)
                {
                    Obj_MediosElectronicos_DAL.Obj_DT    = Obj_BD_DAL.Obj_DS.Tables[0];
                    Obj_MediosElectronicos_DAL.sMsjError = string.Empty;
                }
                else
                {
                    Obj_MediosElectronicos_DAL.sMsjError = Obj_BD_DAL.SMsjError;
                }
            }
            catch (Exception ex)
            {
                Obj_MediosElectronicos_DAL.sMsjError = ex.Message.ToString();
            }
        }
Exemple #2
0
        public void Listar_MediosElectronicos(ref cls_MediosElectronicos_DAL Obj_MediosElectronicos_DAL)
        {
            try
            {
                cls_BD_BLL Obj_BD_BLL = new cls_BD_BLL();
                cls_BD_DAL Obj_BD_DAL = new cls_BD_DAL();

                Obj_BD_DAL.SNomb_Sp   = "sp_Listar_MediosElectronicos";
                Obj_BD_DAL.SNombTabla = "MediosElectronicos";

                Obj_BD_BLL.Exec_DataAdapter(ref Obj_BD_DAL);

                if (Obj_BD_DAL.SMsjError == string.Empty)
                {
                    Obj_MediosElectronicos_DAL.Obj_DT    = Obj_BD_DAL.Obj_DS.Tables[0];
                    Obj_MediosElectronicos_DAL.sMsjError = string.Empty;
                }
                else
                {
                    Obj_MediosElectronicos_DAL.sMsjError = Obj_BD_DAL.SMsjError;
                }
            }
            catch (Exception ex)
            {
                Obj_MediosElectronicos_DAL.sMsjError = ex.Message.ToString();
            }
        }
Exemple #3
0
        public void Insertar_MediosElectronicos(ref cls_MediosElectronicos_DAL Obj_MediosElectronicos_DAL)
        {
            try
            {
                cls_BD_BLL Obj_BD_BLL = new cls_BD_BLL();
                cls_BD_DAL Obj_BD_DAL = new cls_BD_DAL();

                Obj_BD_DAL.SNomb_Sp = "sp_Insertar_MediosElectronicos";

                Obj_BD_BLL.Crear_DT_Parametros(ref Obj_BD_DAL);

                Obj_BD_DAL.dt_Parametros.Rows.Add("@IdMedioElectronico", "2", Obj_MediosElectronicos_DAL.sIdMedioElectronico);
                Obj_BD_DAL.dt_Parametros.Rows.Add("@NombreMedioElectronico", "2", Obj_MediosElectronicos_DAL.sNombreMedioElectronico);
                Obj_BD_DAL.dt_Parametros.Rows.Add("@DescMedioElectronico", "2", Obj_MediosElectronicos_DAL.sDescMedioElectronico);
                Obj_BD_DAL.dt_Parametros.Rows.Add("@IdEstado", "4", Obj_MediosElectronicos_DAL.cIdEstado);

                Obj_BD_BLL.Exec_NonQuery(ref Obj_BD_DAL);

                if (Obj_BD_DAL.SMsjError == string.Empty)
                {
                    Obj_MediosElectronicos_DAL.sMsjError = string.Empty;
                    Obj_MediosElectronicos_DAL.cAx       = 'U';
                }
                else
                {
                    Obj_MediosElectronicos_DAL.sMsjError = Obj_BD_DAL.SMsjError;
                    Obj_MediosElectronicos_DAL.cAx       = 'I';
                }
            }
            catch (Exception ex)
            {
                Obj_MediosElectronicos_DAL.sMsjError = ex.Message.ToString();
            }
        }
Exemple #4
0
        public void Eliminar_MediosElectronicos(ref cls_MediosElectronicos_DAL Obj_MediosElectronicos_DAL, string sFiltro)
        {
            try
            {
                cls_BD_BLL Obj_BD_BLL = new cls_BD_BLL();
                cls_BD_DAL Obj_BD_DAL = new cls_BD_DAL();

                Obj_BD_DAL.SNomb_Sp = "sp_Eliminar_MediosElectronicos";

                Obj_BD_BLL.Crear_DT_Parametros(ref Obj_BD_DAL);

                Obj_BD_DAL.dt_Parametros.Rows.Add("@IdMedioElectronico", "2", sFiltro);

                Obj_BD_BLL.Exec_NonQuery(ref Obj_BD_DAL);

                if (Obj_BD_DAL.SMsjError == string.Empty)
                {
                    Obj_MediosElectronicos_DAL.sMsjError = string.Empty;
                }
                else
                {
                    Obj_MediosElectronicos_DAL.sMsjError = Obj_BD_DAL.SMsjError;
                }
            }
            catch (Exception ex)
            {
                Obj_MediosElectronicos_DAL.sMsjError = ex.Message.ToString();
            }
        }
Exemple #5
0
 public void Eliminar_MediosElectronicos(ref cls_MediosElectronicos_DAL Obj_MediosElectronicos_DAL)
 {
     try
     {
     }
     catch (Exception)
     {
     }
 }
        private void tsbtnNuevo_Click(object sender, EventArgs e)
        {
            Obj_MediosElectronicos_DAL     = new cls_MediosElectronicos_DAL();
            Obj_MediosElectronicos_DAL.cAx = 'I';

            Pantallas.Editar.frm_Editar_MediosElectronicos Obj_Pantalla_MediosElectronicos = new Editar.frm_Editar_MediosElectronicos();
            Obj_Pantalla_MediosElectronicos.Obj_MediosElectronicos_DAL = Obj_MediosElectronicos_DAL;

            Obj_Pantalla_MediosElectronicos.ShowDialog();

            Cargar_Datos();
        }
        private void tsbtnModificar_Click(object sender, EventArgs e)
        {
            if (dgv_MediosElectronicos.Rows.Count > 0)
            {
                Obj_MediosElectronicos_DAL     = new cls_MediosElectronicos_DAL();
                Obj_MediosElectronicos_DAL.cAx = 'U';
                Obj_MediosElectronicos_DAL.sIdMedioElectronico     = dgv_MediosElectronicos.SelectedRows[0].Cells[0].Value.ToString();
                Obj_MediosElectronicos_DAL.sNombreMedioElectronico = dgv_MediosElectronicos.SelectedRows[0].Cells[1].Value.ToString();
                Obj_MediosElectronicos_DAL.sDescMedioElectronico   = dgv_MediosElectronicos.SelectedRows[0].Cells[2].Value.ToString();
                Obj_MediosElectronicos_DAL.cIdEstado = Convert.ToChar(dgv_MediosElectronicos.SelectedRows[0].Cells[3].Value.ToString());

                Pantallas.Editar.frm_Editar_MediosElectronicos Pant_Modif_MediosElectronicos = new Editar.frm_Editar_MediosElectronicos();
                Pant_Modif_MediosElectronicos.Obj_MediosElectronicos_DAL = Obj_MediosElectronicos_DAL;
                Pant_Modif_MediosElectronicos.ShowDialog();

                Cargar_Datos();
            }
            else
            {
                MessageBox.Show("Debe seleccionar un Empleado", "Alerta",
                                MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }