예제 #1
0
        public string Register(String Uemail, String Upassword)
        {
            string judge;
            OxcoderDataContext personDataContext = new OxcoderDataContext();
            Person person = new Person();
            var query = from s in personDataContext.Person
                        where s.Uemail == Uemail
                        select s;

            //返回Student表中的记录数
            var count = query.Count();
            if (count == 0)//如果有重复的
            {

                person.Uemail = Uemail;
                person.Upassword = Upassword;
                personDataContext.Person.InsertOnSubmit(person);
                personDataContext.SubmitChanges();
                judge = "注册成功";

            }
            else
            {
                judge = "该账号已经被注册";
            }

            return judge;
        }
        public string Register(String Eemail, String Epassword)
        {
            string judge;
            OxcoderDataContext enterpriseDataContext = new OxcoderDataContext();
            Enterprise enterprise = new Enterprise();
            var query = from k in enterpriseDataContext.Enterprise
                        where k.Eemail == Eemail
                        select k;

            //返回Student表中的记录数
            var count = query.Count();
            if (count == 0)//如果有重复的
            {
                enterprise.Eemail = Eemail;
                enterprise.Epassword = Epassword;
                enterpriseDataContext.Enterprise.InsertOnSubmit(enterprise);
                enterpriseDataContext.SubmitChanges();
                judge = "注册成功";

            }
            else
            {
                judge = "该账号已经被注册";
            }

            return judge;
        }
예제 #3
0
        public string Login(string Uemail, string Upassword)
        {
            string judge;
            OxcoderDataContext personDataContext = new OxcoderDataContext();
            Person person = new Person();
            var queryUser = from s in personDataContext.Person
                        where s.Uemail == Uemail
                        select s;
            var countForUser = queryUser.Count();
            if (countForUser == 0)//如果没有这个用户
             {
                 judge = "用户不存在";
             }
             else
             {
                 var queryPassword = from s in personDataContext.Person
                        where s.Uemail == Uemail&&s.Upassword == Upassword
                        select s;
                 var countForPassword = queryUser.Count();
                 if (countForPassword == 0)//如果密码错误
                 {
                     judge = "密码错误";
                 }
                 else
                 {
                     judge = "登录成功";
                 }
             }

            return judge;
        }
        public string Login(string Eemail, string Epassword)
        {
            string judge;
            OxcoderDataContext enterpriseDataContext = new OxcoderDataContext();
            Enterprise enterprise = new Enterprise();
            var queryUser = from k in enterpriseDataContext.Enterprise
                        where k.Eemail == Eemail
                        select k;
            var countForUser = queryUser.Count();
            if (countForUser == 0)//如果没有这个用户
            {
                judge = "用户不存在";
            }
            else
            {
                var queryPassword = from k in enterpriseDataContext.Enterprise
                                    where k.Eemail == Eemail&&k.Epassword == Epassword
                                    select k;
                var countForPassword = queryUser.Count();
                if (countForPassword == 0)//如果密码错误
                {
                    judge = "密码错误";
                }
                else
                {
                    judge = "登录成功";
                }
            }

            return judge;
        }