public MarcaBEList GetAll(String nomMarca, String codEstado) { MarcaBEList lista = new MarcaBEList(); IDataReader DReader = null; try { using (Database db = new Database()) { db.ProcedureName = "sgsnet_sps_bandeja_marca"; db.AddParameter("@vi_va_nom_marca", DbType.String, ParameterDirection.Input, nomMarca); db.AddParameter("@vi_int_cod_estado", DbType.String, ParameterDirection.Input, codEstado); DReader = db.GetDataReader(); } while (DReader.Read()) { lista.Add(CrearEntidad(DReader)); } DReader.Close(); } catch { if (DReader != null && !DReader.IsClosed) { DReader.Close(); } throw; } return(lista); }
public MarcaBEList GetListaMarca() { MarcaBEList lista = new MarcaBEList(); IDataReader DReader = null; try { using (Database db = new Database()) { db.ProcedureName = "sgsnet_sps_listado_marca"; DReader = db.GetDataReader(); } while (DReader.Read()) { MarcaBE oMarcaBE = CrearEntidadLista(DReader); lista.Add(oMarcaBE); } DReader.Close(); } catch { if (DReader != null && !DReader.IsClosed) { DReader.Close(); } throw; } return(lista); }
protected void btnBuscarMarca_Click(object sender, ImageClickEventArgs e) { MarcaBL oMarcaBL = new MarcaBL(); oMarcaBL.ErrorEvent += new MarcaBL.ErrorDelegate(Master.Transaction_ErrorEvent); String nomMarca = this.txtNomMarca.Text; String codEstado = this.cboEstadoMarca.SelectedValue; oMarcaBEList = oMarcaBL.GetAll(nomMarca, codEstado); if (oMarcaBEList == null || oMarcaBEList.Count == 0) { JavaScriptHelper.Alert(this, Message.keyNoRegistros, ""); if (oMarcaBEList == null) { oMarcaBEList = new MarcaBEList(); } oMarcaBEList.Add(new MarcaBE()); GuardaParametros(0); } else { GuardaParametros(1); } this.gvMarca.DataSource = oMarcaBEList; this.gvMarca.DataBind(); ViewState["oMarcaBEList"] = oMarcaBEList; this.txhIdMarca.Value = String.Empty; }
protected void gvMarca_OnPageIndexChanging(object sender, GridViewPageEventArgs e) { oMarcaBEList = (MarcaBEList)ViewState["oMarcaBEList"]; this.gvMarca.DataSource = oMarcaBEList; this.gvMarca.PageIndex = e.NewPageIndex; this.gvMarca.DataBind(); this.txhIdMarca.Value = String.Empty; }
private void InicializaPagina() { oMarcaBEList = new MarcaBEList(); oMarcaBEList.Add(new MarcaBE()); ViewState["oMarcaBEList"] = oMarcaBEList; this.gvMarca.DataSource = oMarcaBEList; this.gvMarca.DataBind(); //Combo Estado this.cboEstadoMarca.cargarCombo(ConstanteBE.OBJECTO_TIPO_TODOS); this.cboEstadoMarca.SelectedValue = ConstanteBE.FL_ESTADO_ACTIVO; //Valor Paginado this.gvMarca.PageSize = Profile.PageSize; }
protected void gvMarca_Sorting(object sender, GridViewSortEventArgs e) { oMarcaBEList = (MarcaBEList)ViewState["oMarcaBEList"]; SortDirection indOrden = (SortDirection)ViewState["ordenLista"]; if (oMarcaBEList != null) { if (indOrden == SortDirection.Ascending) { oMarcaBEList.Ordenar(e.SortExpression, direccionOrden.Descending); ViewState["ordenLista"] = SortDirection.Descending; } else { oMarcaBEList.Ordenar(e.SortExpression, direccionOrden.Ascending); ViewState["ordenLista"] = SortDirection.Ascending; } } this.gvMarca.DataSource = oMarcaBEList; this.gvMarca.DataBind(); ViewState["oMarcaBEList"] = oMarcaBEList; this.txhIdMarca.Value = String.Empty; }