示例#1
0
        public bool GetInfo(string name)
        {
            SearchDataCoach = null;
            SearchDataClien = null;
            try
            {
                var co = from t in x.Users
                         join f in x.Coach
                         on t.id equals f.id_user
                         where t.name.CompareTo(name) == 0
                         select t;

                var cli = from t in x.Users
                          join f in x.Client
                          on t.id equals f.id_user
                          where t.name.CompareTo(name) == 0
                          select t;

                if (co.Count() > 0)
                {
                    var rez = from t in infoCoach()
                              where t.Name.CompareTo(name) == 0
                              select t;
                    SearchDataCoach = rez.First();
                }
                else if (cli.Count() > 0)
                {
                    var rez = from t in infoClients()
                              where t.Name.CompareTo(name) == 0
                              select t;
                    SearchDataClien = rez.First();
                }
                else
                {
                    MessageBox.Show("Такого человека не зарегестрировано в спорт-зале");
                }


                return(true);
            }
            catch
            {
                return(false);
            }
        }
示例#2
0
        public bool GetInfo(string name)
        {
            SearchDataCoach = null;
            SearchDataClien = null;
            try
            {
                var co = from t in x.Users
                         join f in x.Coach
                         on t.id equals f.id_user
                         where t.name.CompareTo(name) == 0
                         select t;

                var cli = from t in x.Users
                          join f in x.Client
                          on t.id equals f.id_user
                          where t.name.CompareTo(name) == 0
                          select t;

                if (co.Count() > 0)
                {
                    var rez = from t in infoCoach()
                              where t.Name.CompareTo(name) == 0
                              select t;
                    SearchDataCoach = rez.First();
                }
                else if (cli.Count() > 0)
                {
                    var rez = from t in infoClients()
                              where t.Name.CompareTo(name) == 0
                              select t;
                    SearchDataClien = rez.First();
                }
                else
                    MessageBox.Show("Такого человека не зарегестрировано в спорт-зале");

                return true;

            }
            catch
            {
                return false;
            }
        }