/// <summary>
        /// Resets the Visualization Grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ConsolidationResetClick(object sender, RoutedEventArgs e)
        {
            MatrixVisualizationGrid.ItemsSource = null;
            MatrixVisualizationGrid.ItemsSource = MainWindow.MatrixSelection.MatrixFields;
            ListOfChoosenProcessModels.Clear();

            EventListBox.UnselectAll();
            QuicksearchTextField.Text  = "";
            NumberOfEventsSlider.Value = 1;
            ConsolidationListBox.UnselectAll();
        }
Exemple #2
0
        protected void LocationViewDDL_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Queries Relevant to home page, fetching event info student info and more
            String sqlQuery =
                "Select * from Location where LocationID = " +
                LocationViewDDL.SelectedItem.Value;
            String sqlQuery1 =
                "SELECT StaffID, FirstName + ' ' + LastName as Name from Staff " +
                "where LocationID = " + LocationViewDDL.SelectedItem.Value;
            String sqlQuery3 =
                "select * from Event where LocationID = " +
                LocationViewDDL.SelectedItem.Value;
            String sqlQuery2 =
                "select StaffID, FirstName + ' ' + LastName as Name from Staff where Type = 'Admin' and LocationID = " +
                LocationViewDDL.SelectedItem.Value;

            //Get connection string from web.config file
            string strcon = ConfigurationManager.ConnectionStrings["CARESconnection"].ConnectionString;
            //create new sqlconnection and connection to database by using connection string from web.config file
            SqlConnection con = new SqlConnection(strcon);

            con.Open();
            SqlDataAdapter sqlAdapter  = new SqlDataAdapter(sqlQuery, con);
            SqlDataAdapter sqlAdapter1 = new SqlDataAdapter(sqlQuery1, con);
            SqlDataAdapter sqlAdapter2 = new SqlDataAdapter(sqlQuery2, con);
            SqlDataAdapter sqlAdapter3 = new SqlDataAdapter(sqlQuery3, con);

            var items = new List <string>();

            using (SqlCommand command = new SqlCommand(sqlQuery2, con))
            {
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        //Read info into List
                        items.Add(reader.GetString(1));
                    }
                }
            }

            Repeater1.DataSource = items;
            Repeater1.DataBind();
            //Fill table with data
            DataTable dt = new DataTable();

            sqlAdapter1.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                WorkerListLabel.Text = "Employees At This Location: ";

                WorkerListBox.DataSource     = dt;
                WorkerListBox.DataValueField = "StaffID";

                WorkerListBox.DataTextField = "Name";
                WorkerListBox.DataBind();
            }
            DataTable dt2 = new DataTable();

            sqlAdapter3.Fill(dt2);

            if (dt2.Rows.Count > 0)
            {
                EventListBox.DataSource     = dt2;
                EventListBox.DataValueField = "EventID";
                EventListBox.DataTextField  = "EventName";
                EventListBox.DataBind();
            }
            DataSet ds = new DataSet();

            sqlAdapter.Fill(ds);

            FormView2.DataSource = ds;
            FormView2.DataBind();
            con.Close();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal1();", true);
        }