1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
public class LoginViewModel : ViewModelBase
{
public string code_societe { get; set; }
public string nom { get; set; }
public string mot_passe { get; set; }
public string title { get { return "Veuillez vous identifier"; } }
public string loginError { get; set; }
public RelayCommand Login { get; private set; }
private BDDDomainContext BDDContext = null;
private void LoginUser()
{
BDDContext.Load(BDDContext.GetUSERSQuery().Where(c => c.nom == nom && c.pwd == mot_passe));
USERS user = BDDContext.USERS.FirstOrDefault();
if (contact != null)
{
loginError = "Identification OK";
}
else
{
loginError = "Identification incorrect";
}
RaisePropertyChanged("loginError");
}
public LoginViewModel()
{
Login = new RelayCommand(LoginUser);
BDDContext = new BDDDomainContext();
}
public override void Cleanup()
{
base.Cleanup();
}
} |
Partager