public void Fill_PuestoTrabajo(ref cls_PuestoTrabajo_DAL Obj_PuestoTrabajo_DAL)
        {
            cls_BD_BLL        Obj_BD_BLL        = new cls_BD_BLL();
            cls_BD_DAL        Obj_BD_DAL        = new cls_BD_DAL();
            cls_Generales_BLL Obj_Generales_BLL = new cls_Generales_BLL();

            Obj_Generales_BLL.CrearDTParametros(ref Obj_BD_DAL);

            Obj_BD_DAL.Dt_Parametros.Rows.Add("@filtro", "1", Obj_PuestoTrabajo_DAL.sNombre);

            Obj_BD_DAL.sParametro   = ConfigurationManager.AppSettings["listarpuestotrabajo"].ToString();
            Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablapuestotrabajo"].ToString();

            Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_PuestoTrabajo_DAL.dData     = Obj_BD_DAL.Ds;
                Obj_PuestoTrabajo_DAL.sMgsError = string.Empty;
            }
            else
            {
                Obj_PuestoTrabajo_DAL.dData     = null;
                Obj_PuestoTrabajo_DAL.sMgsError = Obj_BD_DAL.sMsError;
            }
        }
Пример #2
0
        public void cargarData()
        {
            Obj_PuestoTrabajo_DAL = new cls_PuestoTrabajo_DAL();

            if (txt_filtra_puestos.Text == string.Empty)
            {
                Obj_PuestoTrabajo_BLL.List_PuestoTrabajon(ref Obj_PuestoTrabajo_DAL);
            }
            else
            {
                Obj_PuestoTrabajo_DAL.iCod_Id = Convert.ToInt32(txt_filtra_puestos.Text);
                Obj_PuestoTrabajo_BLL.List_PuestoTrabajon(ref Obj_PuestoTrabajo_DAL);
            }

            if (Obj_PuestoTrabajo_DAL.sMgsError == string.Empty)
            {
                dgv_puestos.DataSource = null;

                dgv_puestos.DataSource = Obj_PuestoTrabajo_DAL.dData.Tables[ConfigurationManager.AppSettings["tablapuestotrabajo"].ToString()];
            }
            else
            {
                MessageBox.Show("Error " + Obj_PuestoTrabajo_DAL.sMgsError);
                dgv_puestos.DataSource = null;
            }
        }
        public void List_PuestoTrabajon(ref cls_PuestoTrabajo_DAL Obj_PuestoTrabajo_DAL)
        {
            cls_BD_BLL Obj_BD_BLL = new cls_BD_BLL();
            cls_BD_DAL Obj_BD_DAL = new cls_BD_DAL();

            Obj_BD_DAL.sParametro   = ConfigurationManager.AppSettings["listarpuestotrabajo"].ToString();
            Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablapuestotrabajo"].ToString();

            Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_PuestoTrabajo_DAL.dData     = Obj_BD_DAL.Ds;
                Obj_PuestoTrabajo_DAL.sMgsError = string.Empty;
            }
            else
            {
                Obj_PuestoTrabajo_DAL.dData     = null;
                Obj_PuestoTrabajo_DAL.sMgsError = Obj_BD_DAL.sMsError;
            }
        }