-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 2 Tables are declared, but the programm give a mistake
PostPosted: Sat Dec 17, 2011 6:58 pm 
Newbie

Joined: Sat Dec 17, 2011 6:49 pm
Posts: 1
Heyyy :)

I am searching for a solution a few hours ago, but i dont find some... so I hope, you can help me :)
I get a Database with 2 different table, the first is teacher and the second is student. The programm should controll at the logIn the email- adresses and should knew, if the person is a teacher or a student.
If I only work with one table, my function starts, but if I activated both, it didnĀ“t debbug :(
I post my Code, which shows mistakes and I hope you can help me :)

public ActionResult LogOn(UserViewModel model)
{

if (string.IsNullOrEmpty(model.EMail) || string.IsNullOrEmpty(model.Password))
return View();

//Have I to do a JOIN??

Teacher teacher = NHibernateSession.QueryOver<Teacher>().Where(x => x.EMail == model.EMail).List().ToList().First();
Student student = NHibernateSession.QueryOver<Student>().Where(x => x.EMail == model.EMail).List().ToList().First();


if (model.EMail == student.EMail && model.Password == student.Password)
{
FormsAuthentication.SetAuthCookie(model.EMail, false);
return RedirectToAction("Index", "Student");
}

regrads,
Elma


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.