Exemple #1
0
        public static Secretaria ObterSecretaria(int pIdSecretaria)
        {
            RecepcaoDataClassesDataContext oDB = new RecepcaoDataClassesDataContext();
            Secretaria oSecretaria             = (from selecao in oDB.Secretaria
                                                  where selecao.IdSecretaria == pIdSecretaria
                                                  select selecao).SingleOrDefault();

            return(oSecretaria);
        }
Exemple #2
0
 public static bool Insere(Secretaria pSecretariar)
 {
     try {
         RecepcaoDataClassesDataContext oDB = new RecepcaoDataClassesDataContext();
         oDB.Secretaria.InsertOnSubmit(pSecretariar);
         oDB.SubmitChanges();
         oDB.Dispose();
         return(true);
     } catch (Exception) {
         return(false);
     }
 }
Exemple #3
0
 public static bool Exclui(int pIdSecretaria)
 {
     try {
         RecepcaoDataClassesDataContext oDB = new RecepcaoDataClassesDataContext();
         Secretaria oSecretaria             = (from selecao in oDB.Secretaria
                                               where selecao.IdSecretaria == pIdSecretaria
                                               select selecao).SingleOrDefault();
         oDB.Secretaria.DeleteOnSubmit(oSecretaria);
         oDB.SubmitChanges();
         oDB.Dispose();
         return(true);
     } catch (Exception) {
         return(false);
     }
 }
Exemple #4
0
        public static bool Atualiza(Secretaria pSecretariar)
        {
            try {
                RecepcaoDataClassesDataContext oDB = new RecepcaoDataClassesDataContext();
                Secretaria oSecretaria             = (from selecao in oDB.Secretaria
                                                      where selecao.IdSecretaria == pSecretariar.IdSecretaria
                                                      select selecao).SingleOrDefault();
                oSecretaria.IdSecretaria = pSecretariar.IdSecretaria;

                oDB.SubmitChanges();
                oDB.Dispose();

                return(true);
            } catch (Exception) {
                return(false);
            }
        }
Exemple #5
0
 partial void DeleteSecretaria(Secretaria instance);
Exemple #6
0
 partial void UpdateSecretaria(Secretaria instance);
Exemple #7
0
 partial void InsertSecretaria(Secretaria instance);