Exemple #1
0
        /// <summary>
        /// Method for update task list raised when added,deleted or modify task
        /// </summary>
        private void updateTaskList()
        {
            // Searching of tasks
            dbrespons = DBOperation.getTaskList(ref task);
            if (dbrespons.resultOperation() != DBStatus.SelectSuccessful)
            {
                MessageBox.Show("Error durning searching for tasks " + dbrespons.errorMessage(), "Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            todoGridView.DataSource = task;

            // FIXME dosn't work don't know why
            // task finished
            foreach (DataGridViewRow row in todoGridView.Rows)
            {
                if ((bool)row.Cells["finished"].Value)
                {
                    DataGridViewCell cell = row.Cells["taskDesc"];
                    cell.Style = strikedOut;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Working with SQL
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mainWindow_Load(object sender, EventArgs e)
        {
            // on start hide panel2
            splitContainer.Panel2Collapsed = true;
            splitContainer.BorderStyle = BorderStyle.FixedSingle;

            // menu for treeView
            showInformation = new MenuItem();
            showInformation.Text = "Show task information";
            showInformation.Click += new EventHandler(showInformation_Click);
            cont_menu.MenuItems.Add(showInformation);

            // Initialization DB
            dbrespons = DBOperation.initDateBase();
            if (dbrespons.resultOperation() != DBStatus.InitDBSuccessful)
            {
                MessageBox.Show("Error durning initialization DB" + dbrespons.errorMessage(), "Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //seting up position of task board
            int x = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
            int y = 10;
            x -= (10 + taskBoard.Width);

            taskBoard.StartPosition = FormStartPosition.Manual;
            taskBoard.Location = new Point(x, y);
            taskBoard.Visible = true;

            // creating new tree folder list
            updateTaskList();
            createTreeView.initTreeView();
            updateTaskBoard();
        }