private void BindOrder()
        {
            Order order = (Order)Session["ViewCurrentOrder"];
            uiLabelOrderNumber.Text = order.OrderNumber;
            OrderStatus status = new OrderStatus ();
            status.LoadByPrimaryKey(order.OrderStatusID);
            uiLabelStatus.Text = status.Name;
            uiLabelDate.Text = order.Orderdate.ToString("dd/MM/yyyy");

            uiLabelFullName.Text = order.FirstName + " " + order.LastName;
            uiLabelCity.Text = order.City;
            uiLabelCountry.Text = order.Country;
            uiLabelFax.Text = order.Fax;
            uiLabelTele.Text = order.Phone;
            uiLabelMail.Text = order.Mail;

            uiHyperLinkInvoice.NavigateUrl = "ViewOrder.aspx?oid=" + order.OrderID.ToString();

            BindDetails();
            BindHistory();
        }
        protected void uiGridViewStatus_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditStatus")
            {
                OrderStatus orderStatus = new EGEMech.BLL.OrderStatus();
                orderStatus.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument));
                CurrentStatus = orderStatus;

                uiTextBoxName.Text = orderStatus.Name;

                uiPanelViewStatus.Visible = false;
                uiPanelEdit.Visible = true;
            }
            else if (e.CommandName == "DeleteStatus")
            {
                try
                {
                    OrderStatus orderStatus = new EGEMech.BLL.OrderStatus();
                    orderStatus.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument));
                    orderStatus.MarkAsDeleted();
                    orderStatus.Save();
                    BindData();
                }
                catch (Exception ex)
                {
                    uiLabelError.Visible = true;
                }

            }
        }