public int RegistrarPersonal([FromBody] Personal objPersonal) { clsPersonal objClsPersonal; Abm.PersonalV objValidarPersonal; try { objClsPersonal = new clsPersonal(); objValidarPersonal = new Abm.PersonalV(); objValidarPersonal = objClsPersonal.ValidarPersonal(objPersonal.per_dni); if (objValidarPersonal == null) { objClsPersonal = new clsPersonal(); return(objClsPersonal.RegistrarPersonal(objPersonal)); } else { return(0); } } catch (Exception) { throw; } finally { objClsPersonal = null; objValidarPersonal = null; } }