protected void EditCustomerDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     CustData.DataBind();
     SelectedCustData.DataBind();
     EditCustomerDetailsView.DataBind();
     SelectedCustDetailsView.DataBind();
 }
 protected void AllCustList_SelectedIndexChanged(object sender, EventArgs e)
 {
     // Changes from no customer select options to customer select options
     qcs.CustID = (int)AllCustList.SelectedValue;
     EditCustomerDetailsView.DataBind();
     SelectedCustData.DataBind();
     ResetPanels();
 }
 protected void CustGridView_SelectedIndexChanged(object sender, EventArgs e)
 {
     // Changes from no customer select options to customer select options
     qcs.CustID = (int)CustGridView.SelectedValue;
     SelectedCustData.DataBind();
     ResetPanels();
     NewCustActionPanel.Visible = false;
     CustList.Visible           = false;
 }
        protected void CustData_Inserted(object sender, SqlDataSourceStatusEventArgs e)
        {
            // Uses the created Primary Key to select the new customer
            CustData.DataBind();
            DbCommand dbCommand = e.Command;

            qcs.CustID = (int)dbCommand.Parameters["@New_PK"].Value;
            SelectedCustData.DataBind();
            CreateCustPanel.Visible     = false;
            CustNameSelectPanel.Visible = true;
        }
 protected void DeleteCustomerButton_Click(object sender, EventArgs e)
 {
     if (Page.User.Identity.IsAuthenticated)
     {
         SelectedCustData.Delete();
         CustData.DataBind();
         SelectedCustData.DataBind();
         qcs.CustID = 0;
         Reset();
     }
     else
     {
         FormsAuthentication.RedirectToLoginPage();
     }
 }