Example #1
0
        public void cargarData()
        {
            Obj_Combustible_DAL = new cls_Combustible_DAL();

            if (txt_filtrar_combust.Text == string.Empty)
            {
                Obj_Combustible_BLL.List_Combustible(ref Obj_Combustible_DAL);
            }
            else
            {
                Obj_Combustible_DAL.sDescripcion = txt_filtrar_combust.Text;
                Obj_Combustible_BLL.Fill_Combustible(ref Obj_Combustible_DAL);
            }

            if (Obj_Combustible_DAL.sMgsError == string.Empty)
            {
                dgv_combustib.DataSource = null;

                dgv_combustib.DataSource = Obj_Combustible_DAL.dData.Tables[ConfigurationManager.AppSettings["tablacombustibles"].ToString()];
            }
            else
            {
                MessageBox.Show("Error " + Obj_Combustible_DAL.sMgsError);
                dgv_combustib.DataSource = null;
            }
        }
Example #2
0
        public void Insert_Combustible(ref cls_Combustible_DAL Obj_Combustible_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("@Descripcion", "1", Obj_Combustible_DAL.sDescripcion);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@Estado", "3", Obj_Combustible_DAL.cEstado);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@Id_Crea_Empleados", "2", Obj_Combustible_DAL.iCod_EmpleCreador);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@FechaCreado", "6", Obj_Combustible_DAL.FechaCreado);

            Obj_BD_DAL.sParametro = ConfigurationManager.AppSettings["insertarcombustibles"].ToString();

            Obj_BD_BLL.Excute_Scalar(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_Combustible_DAL.sMgsError = string.Empty;
                //Obj_Combustible_DAL.iCod_Combustible = Convert.ToInt32(Obj_BD_DAL.sValorScalar.ToString());
            }
            else
            {
                Obj_Combustible_DAL.sMgsError = Obj_BD_DAL.sMsError;
                //Obj_Combustible_DAL.iCod_Combustible = -1;
            }
        }
Example #3
0
        public void Fill_Combustible(ref cls_Combustible_DAL Obj_Combustible_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_Combustible_DAL.sDescripcion);

            Obj_BD_DAL.sParametro   = ConfigurationManager.AppSettings["filtrarcombustibles"].ToString();
            Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablacombustibles"].ToString();

            Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_Combustible_DAL.dData     = Obj_BD_DAL.Ds;
                Obj_Combustible_DAL.sMgsError = string.Empty;
            }
            else
            {
                Obj_Combustible_DAL.dData     = null;
                Obj_Combustible_DAL.sMgsError = Obj_BD_DAL.sMsError;
            }
        }
Example #4
0
        public void Update_Combustible(ref cls_Combustible_DAL Obj_Combustible_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("@Descripcion", "1", Obj_Combustible_DAL.sDescripcion);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@Estado", "7", Obj_Combustible_DAL.cEstado);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@Id_Actualiza_Empleados", "2", Obj_Combustible_DAL.iCod_EmpleCreador);
            Obj_BD_DAL.Dt_Parametros.Rows.Add("@FechaActualizado", "6", Obj_Combustible_DAL.FechaCreado);

            Obj_BD_DAL.sParametro = ConfigurationManager.AppSettings["modificarcombustibles"].ToString();

            Obj_BD_BLL.Excute_NonQuery(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_Combustible_DAL.sMgsError = string.Empty;
            }
            else
            {
                Obj_Combustible_DAL.sMgsError = Obj_BD_DAL.sMsError;
            }
        }
Example #5
0
        public void List_Combustible(ref cls_Combustible_DAL Obj_Combustible_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["listarcombustibles"].ToString();
            Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablacombustibles"].ToString();

            Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL);

            if (Obj_BD_DAL.sMsError == string.Empty)
            {
                Obj_Combustible_DAL.dData     = Obj_BD_DAL.Ds;
                Obj_Combustible_DAL.sMgsError = string.Empty;
            }
            else
            {
                Obj_Combustible_DAL.dData     = null;
                Obj_Combustible_DAL.sMgsError = Obj_BD_DAL.sMsError;
            }
        }
        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
        }