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

                return(true);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Tipo_Iva" + e.ToString());
            }
        }
Exemplo n.º 4
0
        public static bool Insert(string orcamentoidv, string fornecedoridv, string VoosFornecedor, CambioIntern cambioidv, IvasIntern ivaidv, TypeOfCostIntern tipocustoidv, string v_partida, string v_destino, string v_nomevoo, double v_preco, double v_comissao, double v_net, double v_valorcambio, double v_valoreuros, double v_margemvenda, double v_markup, double v_taxaA, double v_taxaB, int v_numeropessoas, int v_disponibilidade, double v_valortotalpvp, double v_valorporpessoapvp)
        {
            try
            {
                Voos cntr = new Voos(orcamentoidv, fornecedoridv, VoosFornecedor, cambioidv, ivaidv, tipocustoidv, v_partida, v_destino, v_nomevoo, v_preco, v_comissao, v_net, v_valorcambio, v_valoreuros, v_margemvenda, v_markup, v_taxaA, v_taxaB, v_numeropessoas, v_disponibilidade, v_valortotalpvp, v_valorporpessoapvp);
                DB.Voos.InsertOne(cntr);

                return(true);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir Voos" + e.ToString());
            }
        }
Exemplo n.º 5
0
        public static Voos Get(string id)
        {
            try
            {
                ObjectId nid  = ObjectId.Parse(id);
                Voos     pais = DB.Voos.Find(x => x.Id == nid).FirstOrDefault();
                if (pais != null)
                {
                    return(pais);
                }

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