示例#1
0
        public void retornaTarefa(int IdProjeto)
        {
            ListViewItem selectItem = listViewProj.SelectedItems[0];

            IdProjeto = (int)selectItem.Tag;

            this.Hide();
            Form f = new list_task(IdProjeto);

            f.Closed += (s, args) => this.Close();
            f.Show();
        }
        public actionDialog(list_task listagem, int IdProjeto, string Status)
        {
            Label label = new Label();

            label.Text     = "Oque você deseja fazer a seguir?";
            label.Font     = new Font("Arial", 10, FontStyle.Regular);
            label.Size     = new Size(230, 25);
            label.Location = new Point(35, 20);
            this.Controls.Add(label);

            if (Status == "DONE")
            {
                MaterialFlatButton complete = new MaterialFlatButton();
                complete.Text = "Refazer";
                // adiciona ação ao clique do button
                complete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.alteraStatusTarefa(IdProjeto, "TODO"); };
                complete.Location = new Point(85, 50);
                this.Controls.Add(complete);
            }
            else
            {
                MaterialFlatButton complete = new MaterialFlatButton();
                complete.Text = "Completar";
                // adiciona ação ao clique do button
                complete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.alteraStatusTarefa(IdProjeto, "DONE"); };
                complete.Location = new Point(85, 50);
                this.Controls.Add(complete);
            }

            MaterialFlatButton edit = new MaterialFlatButton();

            edit.Text = "Editar";
            // adiciona ação ao clique do button
            edit.Click   += delegate(object sender, EventArgs args) { this.Close(); /* Chamar tela de edição passando o id */ };
            edit.Location = new Point(10, 50);
            this.Controls.Add(edit);

            MaterialRaisedButton delete = new MaterialRaisedButton();

            delete.Text = "Remover";
            // adiciona ação ao clique do button
            delete.Click   += delegate(object sender, EventArgs args) { this.Close(); listagem.removerTarefa(IdProjeto); };
            delete.Location = new Point(190, 50);
            this.Controls.Add(delete);
        }