Exemplo n.º 1
0
        public List <VwDoentesPresentes> GetCondListDoentesPresentes(string servicoCod, string ultLocalCod, bool viewOnlocal)
        {
            try
            {
                DBDeslocacoesContext      efInt  = new DBDeslocacoesContext();
                List <VwDoentesPresentes> listVw = efInt.vwDoentesPresentes.OrderBy(q => q.DESCR_SERV).ToList();

                if (!String.IsNullOrEmpty(servicoCod))
                {
                    listVw = listVw.Where(q => q.COD_SERV == servicoCod).ToList();
                }
                if (!String.IsNullOrEmpty(ultLocalCod))
                {
                    listVw = listVw.Where(q => q.U_LOCAL == ultLocalCod).ToList();
                }
                if (viewOnlocal)
                {
                    listVw = listVw.Where(q => q.U_LOCAL != null).ToList();
                }
                return(listVw);
            }
            catch (Exception err)
            {
                string str = err.Message;
            }
            return(null);
        }
Exemplo n.º 2
0
 public List <VwDeslocProd> ListDeslocProd(string tdoente, string doente, string numCons)
 {
     try
     {
         DBDeslocacoesContext efInt = new DBDeslocacoesContext();
         return(efInt.vwDeslocProd.Where(q => q.T_DOENTE == tdoente && q.DOENTE == doente && q.N_CONS == numCons).ToList());
     }
     catch (Exception err)
     {
         string str = err.Message;
     }
     return(null);
 }
Exemplo n.º 3
0
 public VwDoentesPresentes GetDeslocUserComNcons(string tdoente, string doente, string ncons)
 {
     try
     {
         DBDeslocacoesContext      efInt = new DBDeslocacoesContext();
         List <VwDoentesPresentes> list  = efInt.vwDoentesPresentes.Where(q => q.T_DOENTE == tdoente && q.DOENTE == doente && q.N_CONS == ncons).OrderByDescending(q => q.DT_CONS).ToList();//&& q.N_CONS ==
         return(list.First());
     }
     catch
     {
         return(null);
     }
 }
Exemplo n.º 4
0
 public List <VwDoentesPresentes> GetListDoentesPresentes()
 {
     try
     {
         DBDeslocacoesContext efInt = new DBDeslocacoesContext();
         return(efInt.vwDoentesPresentes.OrderBy(q => q.DESCR_SERV).ToList());
     }
     catch (Exception err)
     {
         string str = err.Message;
     }
     return(null);
 }
Exemplo n.º 5
0
        public bool InsertDoenteDesloc(TblDesloc desloc)
        {
            bool res = false;

            try
            {
                DBDeslocacoesContext efInt = new DBDeslocacoesContext();
                efInt.tblDesloc.Add(desloc);
                efInt.SaveChanges();
                res = true;
            } catch (Exception err)
            {
            }

            return(res);
        }
Exemplo n.º 6
0
        public VwDeslocProd GetDeslocProdUser(string tdoente, string doente, string numCons)
        {
            try
            {
                DBDeslocacoesContext efInt = new DBDeslocacoesContext();
                List <VwDeslocProd>  list;

                if (!String.IsNullOrEmpty(numCons))
                {
                    list = efInt.vwDeslocProd.Where(q => q.T_DOENTE == tdoente && q.DOENTE == doente && q.N_CONS == numCons).OrderByDescending(q => q.DT_CRI).ToList();
                }
                else
                {
                    list = efInt.vwDeslocProd.Where(q => q.T_DOENTE == tdoente && q.DOENTE == doente).OrderByDescending(q => q.DT_CRI).ToList();
                }


                return(list.First());
            }
            catch
            {
                return(null);
            }
        }