public PLogin Login(string user, string password, string typeUser, ref string error) { PLogin CurrentStudent = new PLogin(); try { using (NotasAcademicasEntities context = new NotasAcademicasEntities()) { if (typeUser.Equals("student")) { Estudiante estudiante = (from p in context.Estudiante where p.Documento == user & p.Clave == password select p).FirstOrDefault(); if (estudiante != null) { CurrentStudent.IdCurrentUser = estudiante.IdEstudiante; CurrentStudent.CurrentUser = estudiante.Nombres + " " + estudiante.Apellidos; CurrentStudent.CurrentUserType = studen; } } else { Profesor profesor = (from p in context.Profesor where p.Documento == user & p.Clave == password select p).FirstOrDefault(); if (profesor != null) { CurrentStudent.IdCurrentUser = profesor.IdProfesor; CurrentStudent.CurrentUser = profesor.Nombres + " " + profesor.Apellidos; CurrentStudent.CurrentUserType = teacher; } } } } catch (System.Exception ex) { error = ex.ToString(); } return(CurrentStudent); }
public async Task <IApiResult> SystemLogin([FromBody] PLogin pars) { return(await ApiAsync(pars, new LoginManager().Login)); }
public FrmPasswordRecover() { InitializeComponent(); _presenter = new PLogin(this); }
// Initilize UI components along with some data. public F000_Login() { LoginP = new PLogin(this); InitializeComponent(); }
public frmLogin() { InitializeComponent(); loginPresenter = new PLogin(this); }
public Login() { InitializeComponent(); _presenter = new PLogin(this); }