Esempio n. 1
0
        public List <Biopsy> GetUserBiopsy(ProviderUser user)
        {
            if (user != null)
            {
                var           query      = from u in _context.ProviderUser where u.ProviderUserId == user.ProviderUserId select u;
                var           item_query = from i in _context.Biopsy where i.Owner.ProviderUserId == user.ProviderUserId select i;
                List <Biopsy> my_biopsy  = item_query.ToList();
                ProviderUser  found_user = query.SingleOrDefault <ProviderUser>();


                if (found_user == null)
                {
                    return(new List <Biopsy>());
                }
                if (my_biopsy == null)
                {
                    return(new List <Biopsy>());
                }
                else
                {
                    return(my_biopsy);
                }
            }
            else
            {
                return(new List <Biopsy>());
            }
        }
Esempio n. 2
0
        public bool AddNewBiopsy(ProviderUser user, int id, string date, string type, string pathclass, string pathtype, string ptname, string ptdob, string provname, string tech)

        {
            bool   is_added   = true;
            Biopsy new_biopsy = new Biopsy
            {
                Owner              = user,
                BioDate            = date,
                BioType            = type,
                PathClassification = pathclass,
                PathType           = pathtype,
                PatLastName        = ptname,
                PatDOB             = ptdob,
                ProvLastName       = provname,
                TechnologistName   = tech
            };

            try
            {
                Biopsy added_biopsy = _context.Biopsy.Add(new_biopsy);
                _context.SaveChanges();
            }
            catch (Exception)
            {
                is_added = false;
            }
            return(is_added);
        }
Esempio n. 3
0
        public bool AddNewUser(ApplicationUser user)
        {
            ProviderUser new_user = new ProviderUser {
                RealUser = user, Email = user.Email
            };
            bool is_added = true;

            try
            {
                ProviderUser added_user = _context.ProviderUser.Add(new_user);
                _context.SaveChanges();
            }
            catch (Exception)
            {
                is_added = false;
            }
            return(is_added);
        }