Beispiel #1
0
        //Consulta visita na tabela Visita
        public static Visita ConsultaVisita(int idVisita)
        {
            RecepcaoDataClassesDataContext Db = new RecepcaoDataClassesDataContext();
            Visita iVisita = (from selecao in Db.Visita where selecao.IdVisita == idVisita select selecao).SingleOrDefault();

            return(iVisita);
        }
Beispiel #2
0
        //Insere visita na tabela visita
        public static bool Criar(Visita visita)
        {
            try {
                RecepcaoDataClassesDataContext Db = new RecepcaoDataClassesDataContext();
                Db.Visita.InsertOnSubmit(visita);
                Db.SubmitChanges();
                Db.Dispose();

                return(true);
            } catch (Exception) {
                return(false);
            }
        }
Beispiel #3
0
        //Deleta visita utilizando id, na tabela Visita
        public static bool Deleta(int visita)
        {
            try {
                RecepcaoDataClassesDataContext Db = new RecepcaoDataClassesDataContext();
                Visita ivisita = (from selecao in Db.Visita where selecao.IdVisita == visita select selecao).SingleOrDefault();

                Db.Visita.DeleteOnSubmit(ivisita);
                Db.SubmitChanges();
                Db.Dispose();

                return(true);
            } catch (Exception) {
                return(false);
            }
        }
Beispiel #4
0
        //Atualizar visita utilizando id, na tabela Visita
        public static bool Atualiza(Visita idVisita)
        {
            try {
                RecepcaoDataClassesDataContext Db = new RecepcaoDataClassesDataContext();
                Visita iVisita = (from selecao in Db.Visita where selecao.IdVisita == idVisita.IdVisita select selecao).SingleOrDefault();

                iVisita.Setor          = idVisita.Setor;
                iVisita.Secretaria     = idVisita.Secretaria;
                iVisita.Liberacao      = idVisita.Liberacao;
                iVisita.ContatoInterno = idVisita.ContatoInterno;
                Db.SubmitChanges();
                Db.Dispose();

                return(true);
            } catch (Exception) {
                return(false);
            }
        }
Beispiel #5
0
 private void detach_Visita(Visita entity)
 {
     this.SendPropertyChanging();
     entity.Visitante = null;
 }
Beispiel #6
0
 private void attach_Visita(Visita entity)
 {
     this.SendPropertyChanging();
     entity.Visitante = this;
 }
Beispiel #7
0
 partial void DeleteVisita(Visita instance);
Beispiel #8
0
 partial void UpdateVisita(Visita instance);
Beispiel #9
0
 partial void InsertVisita(Visita instance);
Beispiel #10
0
 private void detach_Visita(Visita entity)
 {
     this.SendPropertyChanging();
     entity.Funcionario = null;
 }