protected void Gravar() { Comando obj = PreecherObjeto(); if (!boComando.ValidarCamposObrigatorio(obj)) { ExibirMensagem("a", "Preencha todos os campos necessario"); } else if (txtMatriculaComando.Text != "") { ExibirMensagem("s", boComando.Alterar(obj)); } else if (txtMatriculaComando.Text == "") { ExibirMensagem("s", boComando.Gravar(obj)); } Session["objComando"] = obj; PreencherFormulario(obj); CarregarControle(obj.ObjControle); divCadastrarComando.Attributes.Add("class", "invisible"); }