Exemplo n.º 1
0
        private void bteditar_Click(object sender, EventArgs e)
        {
            if (dataGridViewcategoria.SelectedCells.Count > 0)
            {
                classcategoria ccategoria = new classcategoria();
                ccategoria.retornacategoria(Convert.ToInt32(dataGridViewcategoria.SelectedRows[0].Cells[0].Value));
                fmrCategoria formcategoia = new fmrCategoria();

                formcategoia.tbcodigo.Text        = ccategoria.codigocategoria.ToString();
                formcategoia.tbdatacadastro.Text  = ccategoria.datacadastro.ToString();
                formcategoia.tbnomecategoria.Text = ccategoria.nome.ToString();

                if (ccategoria.status == 1)
                {
                    formcategoia.cbstatus.Checked = true;
                }
                else
                {
                    formcategoia.cbstatus.Checked = false;
                }

                formcategoia.tipo = "Atualização";

                formcategoia.ShowDialog();

                btpesquisar_Click(this, new EventArgs());
            }
            else
            {
                MessageBox.Show("Selecione a categoria a ser Atualizada !", "Sistema MasterSports", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void menucategoria_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms.OfType <fmrCategoria>().Count() > 0)
            {
                MessageBox.Show("O formulario Cliente ja esta Aberto", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            else
            {
                fmrCategoria cadcategoria = new fmrCategoria();
                cadcategoria.MdiParent = this;
                cadcategoria.Show();
            }
        }