private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Update project name
            MySqlDataReader reader = ChaoticaDBManager.Query("UPDATE projects SET Title = '" + xTitle.Text.ToString() + "' WHERE ID = '" + this.proj.ID + "';");

            reader.Close();
        }
        public MainPage()
        {
            this.InitializeComponent();


            this.MyProjects = new ObservableCollection <ChaoticaProject>();
            this.MyBugs     = new ObservableCollection <ChaoticaBug>();
            this.MyProjects.Clear();

            c_ProjectsPanel.ItemsSource = this.MyProjects;

            /*ENCODING BEGIN*/
            System.Text.EncodingProvider ppp;
            ppp = System.Text.CodePagesEncodingProvider.Instance;
            System.Text.Encoding.RegisterProvider(ppp);
            /*ENCODING END*/

            //MySQL Query
            MySqlDataReader reader = ChaoticaDBManager.Query("SELECT * FROM projects;");

            //Loop Tables
            while (reader.Read())
            {
                //Add Project [Get Project Title]
                this.MyProjects.Add(new ChaoticaProject(reader.GetString("ID"), reader.GetString("Title")));
            }

            reader.Close();
        }
Esempio n. 3
0
        public void LoadBugList(ChaoticaProject proj)
        {
            //Clear bug list
            this.Bugs.Clear();

            //MySQL Query
            MySqlDataReader reader = ChaoticaDBManager.Query("SELECT * FROM `bugs` WHERE PID = '" + this.ID + "';");

            //Loop Tables
            while (reader.Read())
            {
                //Add Project [Get Project Title]
                this.AddBug(new ChaoticaBug(reader.GetString("ID"), reader.GetString("Title"), reader.GetString("Description"), reader.GetString("TimeStamp"), reader.GetInt32("Priority"), reader.GetBoolean("Resolved"), proj));
            }

            //Close reader
            reader.Close();
        }
        public void RefreshProjectsList()
        {
            //Clear project list
            this.MyProjects.Clear();

            btnn = c_CreateProject;

            //MySQL Query
            MySqlDataReader reader = ChaoticaDBManager.Query("SELECT * FROM projects;");

            //Loop Tables
            while (reader.Read())
            {
                //Add Project [Get Project Title]
                this.MyProjects.Add(new ChaoticaProject(reader.GetString("ID"), reader.GetString("Title")));
            }

            reader.Close();
        }
Esempio n. 5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (xTitle.Text == "")
            {
                return;
            }

            //Query existing project
            MySqlDataReader reader = ChaoticaDBManager.Query("SELECT * FROM projects WHERE Title = '" + xTitle.Text.ToString() + "';");

            int x = 0;
            int y = 0;

            while (reader.Read())
            {
                if (xTitle.Text.ToString() == reader.GetString("Title"))
                {
                    x++;
                    break;
                }
            }

            //Close reader
            reader.Close();

            //If project not found
            if (x <= 0)
            {
                //Insert project
                reader = ChaoticaDBManager.Query("INSERT INTO projects (Title) VALUES ('" + xTitle.Text + "')");

                //Close reader
                reader.Close();

                FinishProjectCreation();
            }
            else
            {
            }
        }