-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminShoppingCart.aspx.cs
37 lines (32 loc) · 1.09 KB
/
AdminShoppingCart.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class AdminShoppingCart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
// counts old shopping carts
protected void countButton_Click(object sender, EventArgs e)
{
byte days = byte.Parse(daysList.SelectedItem.Value);
int oldItems = ShoppingCartAccess.CountOldCarts(days);
if (oldItems == -1)
countLabel.Text = "Could not count the old shopping carts!";
else if (oldItems == 0)
countLabel.Text = "There are no old shopping carts.";
else
countLabel.Text = "There are " + oldItems.ToString() +
" old shopping carts.";
}
// deletes old shopping carts
protected void deleteButton_Click(object sender, EventArgs e)
{
byte days = byte.Parse(daysList.SelectedItem.Value);
ShoppingCartAccess.DeleteOldCarts(days);
countLabel.Text = "The old shopping carts were removed from the database";
}
}