Пример #1
0
 public void FillCheckOutList()
 {
     CheckOutList.Clear();
     foreach (ICheckOutObject item in _TeamCodingProvider.GetCheckOutObjectsList())
     {
         CheckOutList.Add(item);
     }
     ;
     OnPropertyChanged("CheckOutList");
 }
Пример #2
0
        /*----------------------------------------------------------------CHECKOUT MOVIES-----------------------------------------------------------------*/
        public void btnSubmit_Click_one(Object Src, EventArgs E)
        {
            CheckOutPanel.Visible = true;
            //MovieResults.Visible = false;
            get_connection();
            try
            {
                connection.Open();
                command = new SqlCommand("SELECT * FROM content", connection);
                reader  = command.ExecuteReader();
                //MovieResults.DataSource = reader;
                //MovieResults.DataBind();

                reader.Close();

                reader = command.ExecuteReader();
                CheckOutList.DataSource     = reader;
                CheckOutList.DataTextField  = "MovieTitle";
                CheckOutList.DataValueField = "MovieID";
                CheckOutList.DataBind();
                reader.Close();
            }
            catch (Exception err)
            {
                // Handle an error by displaying the information.
                lblInfo.Text  = "Error reading the database. ";
                lblInfo.Text += err.Message;
            }
            finally
            {
                // Either way, make sure the connection is properly closed.
                // (Even if the connection wasn't opened successfully,
                //  calling Close() won't cause an error.)
                connection.Close();
            }
        }