private void InsertFuncionario()
{
ENTFuncionario oENTFuncionario = new ENTFuncionario();
ENTResponse oENTResponse = new ENTResponse();
BPFuncionario oBPFuncionario = new BPFuncionario();
try
{
// Formulario
oENTFuncionario.idUsuario = this.wucBusquedaUsuario.UsuarioID;
oENTFuncionario.TituloId = Int16.Parse(this.ddlActionTitulo.SelectedValue);
oENTFuncionario.PuestoId = Int16.Parse(this.ddlActionPuesto.SelectedValue);
oENTFuncionario.FechaIngreso = this.wucCalendar.BeginDate;
// Transacción
oENTResponse = oBPFuncionario.InsertFuncionario(oENTFuncionario);
// Validaciones
if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }
// Transacción exitosa
ClearActionPanel();
// Actualizar grid
SelectFuncionario();
// Mensaje de usuario
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Funcionario creado con éxtito!'); focusControl('" + this.ddlArea.ClientID + "');", true);
}catch (Exception ex){
throw (ex);
}
}