// list the orders that happened between specified dates protected void byDateGo_Click(object sender, EventArgs e) { try { string startDate = startDateTextBox.Text; string endDate = endDateTextBox.Text; List <OrderInfo> orders = CommerceLibAccess.GetOrdersByDate(startDate, endDate); grid.DataSource = orders; if (orders.Count == 0) { errorLabel.Text = "No orders between selected dates."; } grid.DataBind(); } catch { errorLabel.Text = "Couldn't get the requested orders!"; } }
// Display orders that happened in a specified period of time protected void byDateGo_Click(object sender, EventArgs e) { try { string startDate = startDateTextBox.Text; string endDate = endDateTextBox.Text; List <CommerceLibOrderInfo> orders = CommerceLibAccess.GetOrdersByDate(startDate, endDate); grid.DataSource = orders; if (orders.Count == 0) { errorLabel.Text = "Няма поръчки между избраните дати."; } grid.DataBind(); } catch { errorLabel.Text = "Поисканите поръчки не бяха намерени!"; } }