예제 #1
0
 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}");
     }
 }
예제 #3
0
        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);
 }
예제 #6
0
파일: SerieBO.cs 프로젝트: daniellxc/Ged
 public List <Serie> GetAll()
 {
     return(_DAO.GetAll());
 }