Beispiel #1
0
 public static bool Delete(ServicosTT_Tipos ServicosTT_Tipos)
 {
     try
     {
         DB.ServicosTT_Tipos.DeleteOne(x => x.Id == ServicosTT_Tipos.Id);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Erro delete ServicosTT_Tipos :" + e.ToString());
     }
 }
Beispiel #2
0
 public static bool Update(ServicosTT_Tipos ServicosTT_Tipos)
 {
     try
     {
         DB.ServicosTT_Tipos.ReplaceOne(c => c.Id == ServicosTT_Tipos.Id, ServicosTT_Tipos);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Erro Update ServicosTT_Tipos :" + e.ToString());
     }
 }
Beispiel #3
0
        public static ServicosTT_Tipos Get(string name)
        {
            try
            {
                ServicosTT_Tipos pais = DB.ServicosTT_Tipos.Find(x => x.name == name).FirstOrDefault();
                if (pais != null)
                {
                    return(pais);
                }

                return(null);
            }
            catch (Exception e)
            {
                throw new Exception("Erro Inserir ServicosTT_Tipos" + e.ToString());
            }
        }
Beispiel #4
0
        public static bool Insert(string name)
        {
            try
            {
                var t   = GetAll();
                int val = t.Count();



                ServicosTT_Tipos cntr = new ServicosTT_Tipos(name, val);
                DB.ServicosTT_Tipos.InsertOne(cntr);

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