コード例 #1
0
        public bool Exists(string email)
        {
            bool      exist = false;
            Passenger pas   = db.Passengers.ToList().Find(x => x.EmailAddress == email);

            if (pas != null)
            {
                exist = true;
            }

            Owner owner = db.Owners.ToList().Find(x => x.Email == email);

            if (owner != null)
            {
                exist = true;
            }
            Driver driver = db.Drivers.ToList().Find(x => x.Email == email);

            if (driver != null)
            {
                exist = true;
            }
            RankManager rankManager = db.RankManagers.ToList().Find(x => x.Email == email);

            if (rankManager != null)
            {
                exist = true;
            }

            return(exist);
        }
コード例 #2
0
        public string Dashboard(string email)
        {
            string dashboard = "Error";

            try
            {
                Admin ad = db.Admins.ToList().Find(x => x.Email == email);
                if (ad != null)
                {
                    dashboard = "Admin";
                }

                RankManager rm = db.RankManagers.ToList().Find(x => x.Email == email);
                if (rm != null)
                {
                    dashboard = "RankManager";
                }

                Owner ow = db.Owners.ToList().Find(x => x.Email == email);
                if (ow != null)
                {
                    dashboard = "Owner";
                }

                Driver dr = db.Drivers.ToList().Find(x => x.Email == email);
                if (dr != null)
                {
                    dashboard = "Driver";
                }

                Passenger pas = db.Passengers.ToList().Find(x => x.EmailAddress == email);
                if (pas != null)
                {
                    dashboard = "Passenger";
                }
            }
            catch (Exception)
            {
                return(dashboard);
            }

            return(dashboard);
        }