private async Task FillCombosRun()
        {
            DateTime   todayyo = DateTime.Today;
            string     none    = "none";
            SQLExecute sqlexec = new SQLExecute();

            taxi = await sqlexec.SQLGetTaxi(Properties.Settings.Default.DBName, 0, none, 0, none, none, none, 0, none, none, 0, todayyo, none, true);

            owner.Clear();
            owner.Clear();
            driver.Clear();
            depthsAll.Clear();
            depthsAllPaid.Clear();
            person.Clear();

            owner = await sqlexec.SQLGetPerson(Properties.Settings.Default.DBName, 0, none, none, none, 0, 0, none, 0, todayyo, none, 2, false);

            driver = await sqlexec.SQLGetPerson(Properties.Settings.Default.DBName, 0, none, none, none, 0, 0, none, 0, todayyo, none, 1, false);

            depthsAll = await sqlexec.SQLGetDepth(Properties.Settings.Default.DBName, 0, 0, none, todayyo, null, none, 0, none, 0, none, false);

            depthsAllPaid = await sqlexec.SQLGetDepth(Properties.Settings.Default.DBName, 0, 0, none, todayyo, "", none, 0, none, 0, none, false);

            person.AddRange(driver);
            person.AddRange(owner);
        }
Exemplo n.º 2
0
        private async void Button_Click_Save(object sender, RoutedEventArgs e)
        {
            //depthsUpdate
            string query = "";

            if (depthsUpdate.Count == 0)
            {
                return;
            }
            foreach (Depth d in depthsUpdate)
            {
                //query += $"UPDATE Depth SET Paid = '{d.Paid}' WHERE DepthID = '{d.DepthID}'; ";
                query += $"UPDATE Depth SET RepaidAmount = '{d.RepaidAmount}' WHERE DepthID = '{d.DepthID}';";
                if (d.Amount == d.RepaidAmount)
                {
                    query += $"UPDATE Depth SET Paid = '' WHERE DepthID = '{d.DepthID}'; ";
                    //Create Income's
                    if (true)
                    {
                    }
                }
                else
                {
                    query += $"UPDATE Depth SET Paid = NULL WHERE DepthID = '{d.DepthID}'; ";
                }
            }

            SQLExecute sqlexec = new SQLExecute();
            await Task.Run(() => sqlexec.SQLCommand(Properties.Settings.Default.DBName, query));

            string   none    = "none";
            DateTime todayyo = DateTime.Today;

            //Create Income's
            depthsAll = await sqlexec.SQLGetDepth(Properties.Settings.Default.DBName, 0, 0, none, todayyo, null, none, 0, none, 0, none, false);

            depthsAllPaid = await sqlexec.SQLGetDepth(Properties.Settings.Default.DBName, 0, 0, none, todayyo, "", none, 0, none, 0, none, false);
            await refreshAll();
        }