Example #1
0
 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;
     }
 }
Example #2
0
        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;
            }
        }