public IEnumerable <MOD_cargo> Update(MOD_cargo cargo) { try { if (cargo == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } objBLL_Cargo = new BLL_cargo(); List <MOD_cargo> listaCargo = new List <MOD_cargo>(); if (objBLL_Cargo.Update(cargo, out listaCargo) == true) { return(listaCargo); } else { throw new HttpResponseException(HttpStatusCode.NotFound); } } catch (SqlException exl) { throw exl; } catch (Exception ex) { throw ex; } }
public bool Delete(int codCargo) { try { //Busca o Registro Informado para Exclusão MOD_cargo cargo = BuscaCargoPorCodigo(codCargo).First(); if (cargo == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } objBLL_Cargo = new BLL_cargo(); return(objBLL_Cargo.Delete(cargo)); } catch (SqlException exl) { throw exl; } catch (Exception ex) { throw ex; } }