Esempio n. 1
0
        private void TestWrite()
        {
            int res = SQLLiteHelper.Insert(new Outcome
            {
                Date        = DateTime.Now,
                Item        = "Test Item",
                Description = "Test Description",
                Category    = 1,
                Amount      = 12.98
            });

            Console.WriteLine($"Write result: {res}");
        }
Esempio n. 2
0
        private void AddTransaction(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtItem.Text) || string.IsNullOrEmpty(txtAmount.Text))
            {
                MessageBox.Show("Fill all the fields.", "ERROR", MessageBoxButtons.OK);
                return;
            }

            int res = SQLLiteHelper.Insert(new Outcome
            {
                Date        = date.SelectionStart,
                Item        = txtItem.Text,
                Description = txtDescription.Text,
                Category    = (int)cmbCategory.SelectedItem,
                Amount      = double.Parse(txtAmount.Text)
            });
        }
Esempio n. 3
0
 private void TestWriteMulti()
 {
     int res = SQLLiteHelper.Insert(
         new List <Income> {
         new Income {
             Amount = 500,
             Date   = DateTime.Now,
             Item   = "Stipendio"
         },
         new Income {
             Amount = 2500,
             Date   = DateTime.Now,
             Item   = "Accredito Pensione"
         },
         new Income {
             Amount = 900,
             Date   = DateTime.Now,
             Item   = "Sto Cazzo"
         }
     });
 }