public void atualizalista() { ListaConta.Items.Clear(); SqlDataReader leitor; string DESCRI, SITU; int COD; DateTime DATAV; double VL; SqlCommand selecionafilme = new SqlCommand(); SqlConnection conexao = new SqlConnection(); conexao = new SqlConnection("Data Source = DESKTOP-L0FTKI7; Initial Catalog = ALTERNATIVA; Integrated Security=SSPI"); conexao.Open(); selecionafilme = new SqlCommand("select CODIGO AS COD, DESCRICAO as DESCRI,VALOR as VL,DATAV as DATAV, SITUACAO AS SITU from CONTAS WHERE DATAV >= '" + DTVencimento.Value + "' AND SITUACAO != 'Paga' ORDER BY DATAV ASC", conexao); leitor = selecionafilme.ExecuteReader(); while (leitor.Read() == true) { COD = int.Parse(leitor["COD"].ToString()); DESCRI = leitor["DESCRI"].ToString(); VL = double.Parse(leitor["VL"].ToString()); DATAV = DateTime.Parse(leitor["DATAV"].ToString()); SITU = leitor["SITU"].ToString(); ListViewItem itemLista = new ListViewItem(COD.ToString()); ListViewItem.ListViewSubItem subitemLista = new ListViewItem.ListViewSubItem(itemLista, DESCRI); itemLista.SubItems.Add(subitemLista); subitemLista = new ListViewItem.ListViewSubItem(itemLista, VL.ToString("0.00")); itemLista.SubItems.Add(subitemLista); subitemLista = new ListViewItem.ListViewSubItem(itemLista, DATAV.ToShortDateString()); itemLista.SubItems.Add(subitemLista); subitemLista = new ListViewItem.ListViewSubItem(itemLista, SITU); itemLista.SubItems.Add(subitemLista); ListaConta.Items.Add(itemLista); } leitor.Close(); conexao.Close(); contasdodia(); }
public String ToJSONString() { var phStr = "PH: " + PH.ToString("F5"); var doStr = "DO: " + DO.ToString("F5"); var bod5Str = "BOD5: " + BOD5.ToString("F5"); var codStr = "COD: " + COD.ToString("F5"); var nh4nStr = "NH4-N: " + NH4N.ToString("F5"); var no2nStr = "NO2-N: " + NO2N.ToString("F5"); var no3nStr = "NO3-N: " + NO3N.ToString("F5"); var ssStr = "SS: " + SS.ToString("F5"); var clStr = "CL: " + CL.ToString("F5"); var cbStr = "CB: " + CB.ToString("F5"); return(phStr + ", " + doStr + ", " + bod5Str + ", " + codStr + ", " + nh4nStr + ", " + no2nStr + ", " + no3nStr + ", " + ssStr + ", " + clStr + ", " + cbStr); }