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); }
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); } }
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); } }
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); } }
partial void DeleteSecretaria(Secretaria instance);
partial void UpdateSecretaria(Secretaria instance);
partial void InsertSecretaria(Secretaria instance);