protected void NextStateButton_Command(object sender, CommandEventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            Pharmacy.BusinessLayer.Data.ReplenishmentOrder order = OrderService.GetOrder(GetOrderId());
            if (order.State == OrderState.Posting)
            {
                string expectedDelivery = ((TextBox)OrderDetailsView.FindControl("ExpectedDeliveryBox")).Text;
                OrderService.UpdateExpectedDeliveryDate(order.Id, parseDateTime(expectedDelivery));
            }

            if (order.State == OrderState.Ordered)
            {
                string actualDelivery = ((TextBox)OrderDetailsView.FindControl("ActualDeliveryBox")).Text;
                OrderService.UpdateActualDeliveryDate(order.Id, parseDateTime(actualDelivery));
            }
            OrderService.ProceedToNextState(order.Id);
            // display updated data
            OrderDetailsView.DataBind();
        }
 protected void Cancel_Command(object sender, CommandEventArgs e)
 {
     OrderService.Cancel(GetOrderId());
     // display updated data
     OrderDetailsView.DataBind();
 }