Пример #1
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        try
        {
            Formularioref novoForm = new Formularioref()
            {
                Nome            = txtNome.Text,
                Setor           = txtSetor.Text,
                Registro        = txtRegistro.Text,
                Funcao          = txtFuncao.Text,
                Justificativa   = Justificativa.Value,
                OutrasSituacoes = OutraSitu.Value,
                DataOcorrido    = calendarioData.Value,
                HorarioOcorrido = horario.Value
            };

            Formulario.AdicionarFormulario(novoForm);

            txtFuncao.Text       = "";
            txtNome.Text         = "";
            txtRegistro.Text     = "";
            txtSetor.Text        = "";
            OutraSitu.Value      = "";
            calendarioData.Value = "";
            horario.Value        = "";

            MessageBox.Show("Formulario Salvo");
        }

        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }