public void cargarData() { Obj_TiposVehiculos_DAL = new cls_TiposVehiculos_DAL(); if (txt_filtrar_tipo.Text == string.Empty) { Obj_TiposVehiculos_BLL.List_TiposVehiculos(ref Obj_TiposVehiculos_DAL); } else { Obj_TiposVehiculos_DAL.sNombre = txt_filtrar_tipo.Text; Obj_TiposVehiculos_BLL.Fill_TiposVehiculos(ref Obj_TiposVehiculos_DAL); } if (Obj_TiposVehiculos_DAL.sMgsError == string.Empty) { dgv_tipo.DataSource = null; dgv_tipo.DataSource = Obj_TiposVehiculos_DAL.dData.Tables[ConfigurationManager.AppSettings["tablatiposvehiculos"].ToString()]; } else { MessageBox.Show("Error " + Obj_TiposVehiculos_DAL.sMgsError); dgv_tipo.DataSource = null; } }
public void Insert_TiposVehiculos(ref cls_TiposVehiculos_DAL obj_TiposVehiculos_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("@Nombre", "1", obj_TiposVehiculos_DAL.sNombre); Obj_BD_DAL.Dt_Parametros.Rows.Add("@Estado", "7", obj_TiposVehiculos_DAL.bEstado); Obj_BD_DAL.Dt_Parametros.Rows.Add("@Id_Crea_Empleados", "2", obj_TiposVehiculos_DAL.iId_Empleado); Obj_BD_DAL.Dt_Parametros.Rows.Add("@FechaCreado", "6", obj_TiposVehiculos_DAL.Fecha); Obj_BD_DAL.sParametro = ConfigurationManager.AppSettings["insertartiposvehiculos"].ToString(); Obj_BD_BLL.Excute_Scalar(ref Obj_BD_DAL); if (Obj_BD_DAL.sMsError == string.Empty) { obj_TiposVehiculos_DAL.sMgsError = string.Empty; //obj_TiposVehiculos_DAL.iCod_TiposVehiculos = Convert.ToInt32(Obj_BD_DAL.sValorScalar.ToString()); } else { obj_TiposVehiculos_DAL.sMgsError = Obj_BD_DAL.sMsError; obj_TiposVehiculos_DAL.iCod_TiposVehiculos = -1; } }
public void Fill_TiposVehiculos(ref cls_TiposVehiculos_DAL Obj_TiposVehiculos_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_TiposVehiculos_DAL.sNombre); Obj_BD_DAL.sParametro = ConfigurationManager.AppSettings["filtrartiposvehiculos"].ToString(); Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablatiposvehiculos"].ToString(); Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL); if (Obj_BD_DAL.sMsError == string.Empty) { Obj_TiposVehiculos_DAL.dData = Obj_BD_DAL.Ds; Obj_TiposVehiculos_DAL.sMgsError = string.Empty; } else { Obj_TiposVehiculos_DAL.dData = null; Obj_TiposVehiculos_DAL.sMgsError = Obj_BD_DAL.sMsError; } }
public void Update_TiposVehiculos(ref cls_TiposVehiculos_DAL obj_TiposVehiculos_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("@Nombre", "1", obj_TiposVehiculos_DAL.sNombre); Obj_BD_DAL.Dt_Parametros.Rows.Add("@Estado", "7", obj_TiposVehiculos_DAL.bEstado); Obj_BD_DAL.Dt_Parametros.Rows.Add("@Id_Actualiza_Empleados", "2", obj_TiposVehiculos_DAL.iId_Empleado); Obj_BD_DAL.Dt_Parametros.Rows.Add("@FechaActualizado", "6", obj_TiposVehiculos_DAL.Fecha); Obj_BD_DAL.sParametro = ConfigurationManager.AppSettings["modificarcapacitacion"].ToString(); Obj_BD_BLL.Excute_NonQuery(ref Obj_BD_DAL); if (Obj_BD_DAL.sMsError == string.Empty) { obj_TiposVehiculos_DAL.sMgsError = string.Empty; } else { obj_TiposVehiculos_DAL.sMgsError = Obj_BD_DAL.sMsError; } }
public void List_TiposVehiculos(ref cls_TiposVehiculos_DAL Obj_TiposVehiculos_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["listartiposvehiculos"].ToString(); Obj_BD_DAL.sNombreTabla = ConfigurationManager.AppSettings["tablatiposvehiculos"].ToString(); Obj_BD_BLL.Excute_DataAdapter(ref Obj_BD_DAL); if (Obj_BD_DAL.sMsError == string.Empty) { Obj_TiposVehiculos_DAL.dData = Obj_BD_DAL.Ds; Obj_TiposVehiculos_DAL.sMgsError = string.Empty; } else { Obj_TiposVehiculos_DAL.dData = null; Obj_TiposVehiculos_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 }