Exemplo n.º 1
0
        private async void submit()
        {
            submityes = await suby
                        .Where(fthingItem => fthingItem.Year == year && fthingItem.Month == month && fthingItem.Day == day - 1 && fthingItem.User == Username)
                        .ToCollectionAsync();

            todayaddpoints tt = submityes.First();

            if (tt.Isadd == false)
            {
                todayaddpoints t = submityes.First();
                t.Isadd = true;
                await tftodoTable.UpdateAsync(t);

                pgoint += Zw;
                ptoint += Zd;
                tp.Text = ptoint.ToString();
                gp.Text = pgoint.ToString();
                uitems  = await ut
                          .Where(userItem => userItem.Username == Username)
                          .ToCollectionAsync();

                user u = uitems.First();
                u.gp = pgoint;
                u.tp = ptoint;

                await ut.UpdateAsync(u);
            }
        }
Exemplo n.º 2
0
        private async void addyestoday()
        {
            Zw = Zd = 0;
            ys = await ya.Where(fthingItem => fthingItem.Year == year && fthingItem.Month == month && fthingItem.Day == day - 1 && fthingItem.User == Username)
                 .ToCollectionAsync();

            if (ys.Count == 0)
            {
                todayaddpoints t = new todayaddpoints();
                t.Isadd = false;
                t.Year  = year;
                t.Month = month;
                t.Day   = day - 1;
                t.User  = Username;
                t.Nowgp = 0;
                t.Nowtp = 0;
                await ya.InsertAsync(t);
            }

            if (ys.Count != 0)
            {
                /*   uitems = await ut
                 *     .Where(userItem => userItem.Username == Username)
                 *     .ToCollectionAsync();
                 * user u = uitems.First();
                 * u.tp = u.tp + ys.First().Nowtp;
                 * u.gp = u.gp + ys.First().Nowgp;
                 *
                 *
                 * await ut.UpdateAsync(u);*/

                Zw += ys.First().Nowgp;
                Zd += ys.First().Nowtp;
            }
        }
Exemplo n.º 3
0
        private async void addtotodaypoints()
        {
            todaypoints = await tftodoTable
                          .Where(fthingItem => fthingItem.Year == year && fthingItem.Month == month && fthingItem.Day == day && fthingItem.User == Username)
                          .ToCollectionAsync();

            if (todaypoints.Count != 0)
            {
                todayaddpoints[] ty = todaypoints.ToArray();

                await tftodoTable.DeleteAsync(ty[0]);
            }


            var p = new todayaddpoints()
            {
                Year = year, Month = month, Day = day, User = Username, Nowgp = ngpoint, Nowtp = ntpoint
            };

            await tftodoTable.InsertAsync(p);
        }