Exemple #1
0
        public void cargarData()
        {
            Obj_Marcas_DAL = new cls_Marcas_DAL();

            if (txt_filtrar_marcas.Text == string.Empty)
            {
                Obj_Marcas_BLL.List_Marcas(ref Obj_Marcas_DAL);
            }
            else
            {
                Obj_Marcas_DAL.sDescripcion = txt_filtrar_marcas.Text;
                Obj_Marcas_BLL.Fill_Marcas(ref Obj_Marcas_DAL);
            }

            if (Obj_Marcas_DAL.sMgsError == string.Empty)
            {
                dgv_marcas.DataSource = null;

                dgv_marcas.DataSource = Obj_Marcas_DAL.dData.Tables[ConfigurationManager.AppSettings["tablamarcavehiculos"].ToString()];
            }
            else
            {
                MessageBox.Show("Error " + Obj_Marcas_DAL.sMgsError);
                dgv_marcas.DataSource = null;
            }
        }
        public void CargarCombo()
        {
            #region Objetos DAL
            cls_Marcas_DAL         Obj_Marcas_DAL   = new cls_Marcas_DAL();
            cls_TiposVehiculos_DAL Obj_TipoVehi_DAL = new cls_TiposVehiculos_DAL();
            cls_ModelosVehi_DAL    Obj_Modelos_DAL  = new cls_ModelosVehi_DAL();
            cls_Combustible_DAL    Obj_Combus_DAL   = new cls_Combustible_DAL();
            #endregion
            #region Objetos BLL
            cls_Marcas_BLL         Obj_Marcacs_BLL = new cls_Marcas_BLL();
            cls_ModelosVehi_BLL    Obj_Modelos_BLL = new cls_ModelosVehi_BLL();
            cls_TiposVehiculos_BLL Obj_Tipos_BLL   = new cls_TiposVehiculos_BLL();

            cls_Combustible_BLL Obj_Combus_BLL = new cls_Combustible_BLL();

            #endregion
            Obj_Marcacs_BLL.List_Marcas(ref Obj_Marcas_DAL);
            cmb_Marca.DataSource    = Obj_Marcas_DAL.dData.Tables[ConfigurationManager.AppSettings["tablamarcavehiculos"].ToString()].DefaultView;
            cmb_Marca.DisplayMember = Obj_Marcas_DAL.dData.Tables[0].Columns["Marca"].ToString();
            cmb_Marca.ValueMember   = "Id";//Marca

            Obj_Modelos_BLL.List_ModelosVehi(ref Obj_Modelos_DAL);
            cmb_Modelo.DataSource    = Obj_Modelos_DAL.dData.Tables[ConfigurationManager.AppSettings["tablamodelosvehiculos"].ToString()].DefaultView;
            cmb_Modelo.DisplayMember = Obj_Modelos_DAL.dData.Tables[0].Columns["Modelo"].ToString();
            cmb_Modelo.ValueMember   = "Id";//Modelo

            Obj_Tipos_BLL.List_TiposVehiculos(ref Obj_TipoVehi_DAL);
            cbx_tipos.DataSource    = Obj_TipoVehi_DAL.dData.Tables[ConfigurationManager.AppSettings["tablatiposvehiculos"].ToString()].DefaultView;
            cbx_tipos.DisplayMember = Obj_TipoVehi_DAL.dData.Tables[ConfigurationManager.AppSettings["tablatiposvehiculos"].ToString()].Columns["Nombre"].ToString();
            cbx_tipos.ValueMember   = "Id";//Tipos

            Obj_Combus_BLL.List_Combustible(ref Obj_Combus_DAL);
            cbx_combus.DataSource    = Obj_Combus_DAL.dData.Tables[ConfigurationManager.AppSettings["tablacombustibles"].ToString()].DefaultView;
            cbx_combus.DisplayMember = Obj_Combus_DAL.dData.Tables[0].Columns["Descripcion"].ToString();
            cbx_combus.ValueMember   = "Id";// Combustibles
        }