public IList <Serie> GetAllSeries() { try { return(_repositorioSerie.GetAll()); } catch (Exception e) { throw new Exception(e.Message); } }
private void BindGrid() { try { grdSerie.DataSource = SerieDAO.GetAll(); grdSerie.DataBind(); } catch (Exception ex) { (Master as layout).SetAlert("alert-danger", $"Errore durante il BindGrid in GestisciSerie ===> {ex.Message}"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlFiltroSerie.Items.Clear(); DropDownListManager.FillDdlSerie(SerieDAO.GetAll(), ref ddlFiltroSerie); ddlScegliSerie.Items.Clear(); DropDownListManager.FillDdlSerie(SerieDAO.GetAll(), ref ddlScegliSerie); BindGrid(true); } (Master as layout).HideAlert(); }
protected void grdSerie_RowCommand(object sender, GridViewCommandEventArgs e) { try { long idSerie = Convert.ToInt64(e.CommandArgument); if (e.CommandName == "Modifica") { hfIdSerie.Value = idSerie.ToString(); txtNomeSerie.Text = SerieDAO.GetAll().Where(w => w.IdSerie == idSerie).FirstOrDefault().NomeSerie; btnInserisciSerie.Visible = false; btnModificaSerie.Visible = !btnInserisciSerie.Visible; } else if (e.CommandName == "Elimina") { SerieDAO.Delete(idSerie); BindGrid(); (Master as layout).SetAlert("alert-success", $"Serie eliminata con successo"); } } catch (Exception ex) { (Master as layout).SetAlert("alert-danger", $"Errore durante il grdSerie_RowCommand in GestisciSerie ===> {ex.Message}"); } }
protected void FillDdlScegliSerie() { ddlScegliSerie.Items.Clear(); ddlScegliSerie.Items.Add(new ListItem("", "-1")); DropDownListManager.FillDdlSerie(SerieDAO.GetAll(), ref ddlScegliSerie); }
public List <Serie> GetAll() { return(_DAO.GetAll()); }