protected void btnFiltraBollette_Click(object sender, EventArgs e) { int anno = txtFiltroAnno.Text != "" ? Convert.ToInt32(txtFiltroAnno.Text) : 0; int idFornitore = ddlFiltroFornitore.SelectedValue != "" ? Convert.ToInt32(ddlFiltroFornitore.SelectedValue) : 0; BindGrid(BolletteDAO.GetAll(anno, idFornitore)); }
private string GetProgressivo(int anno = 0) { int progressivo = 1; List <Bolletta> items = BolletteDAO.GetAll(0, 0).Where(w => w.DataBolletta.Year == (anno > 0 ? anno : DateTime.Now.Year)).ToList(); if (items.Count > 0) { progressivo = items.Select(s => s.Progressivo).Max() + 1; } return(progressivo.ToString()); }
public IHttpActionResult GetBollette([FromUri] string year, [FromUri] string ragSocFornitore) { try { List <Bolletta> items = BolletteDAO.GetAll(Convert.ToInt32(year), ragSocFornitore); return(Ok(items)); } catch (Exception ex) { string messaggio = $"Errore durante la GetBollette in BolletteController --- {ex}"; log.Error(messaggio); return(BadRequest(messaggio)); } }
private void ResetToInitial() { int currentYear = DateTime.Today.Year; List <Bolletta> bollette = BolletteDAO.GetAll(currentYear, 0); txtDataBolletta.Text = DateTime.Now.ToString("yyyy-MM-dd"); txtDataScadenza.Text = txtDataPagamento.Text = txtTotaleBolletta.Text = ""; txtProgressivo.Text = GetProgressivo(); ddlScegliFornitore.SelectedIndex = 0; btnAggiungiBolletta.Visible = true; btnModificaBolletta.Visible = false; hfIdBolletta.Value = ""; txtFiltroAnno.Text = currentYear.ToString(); BindGrid(bollette); }