Exemplo n.º 1
0
 public static bool Update(Alojamento aloj)
 {
     try
     {
         DB.Alojamento.ReplaceOne(c => c.Id == aloj.Id, aloj);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Erro Update Alojamento :" + e.ToString());
     }
 }
Exemplo n.º 2
0
 public static bool Delete(Alojamento aloj)
 {
     try
     {
         DB.Alojamento.DeleteOne(x => x.Id == aloj.Id);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Erro delete Alojamento :" + e.ToString());
     }
 }
Exemplo n.º 3
0
        public static bool Insert(Alojamento aloj)
        {
            try
            {
                DB.Alojamento.InsertOne(aloj);

                return(true);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Alojamento" + e.ToString());
            }
        }
Exemplo n.º 4
0
        public static bool Insert(string hotelName, string OrcamentoId, string Fornecedor, List <quarto> quartos, Acordo acordo, List <Dias> dias, List <ResultRecords> Records)
        {
            try
            {
                Alojamento cntr = new Alojamento(hotelName, OrcamentoId, Fornecedor, quartos, acordo, dias, Records);
                DB.Alojamento.InsertOne(cntr);

                return(true);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Alojamento" + e.ToString());
            }
        }