Beispiel #1
0
 public bool GetPasswordReset(string password, Faculty facultyModel)
 {
     using (FacultyContext db = new FacultyContext())
     {
         try
         {
             if (facultyModel != null)
             {
                 facultyModel.Password        = password;
                 facultyModel.ModifiedDate    = DateTime.Now;
                 db.Entry(facultyModel).State = EntityState.Modified;
                 db.SaveChanges();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
Beispiel #2
0
 public Faculty VerifyPasswordRecoveryDetails(Faculty facultyModel)
 {
     using (FacultyContext db = new FacultyContext())
     {
         var userId = db.Faculties.Where(s => s.SecurityQuestion == facultyModel.SecurityQuestion && s.SecurityQueAnswer == facultyModel.SecurityQueAnswer && s.UserId == facultyModel.UserId).FirstOrDefault();
         return(userId);
     }
 }
Beispiel #3
0
 public IEnumerable <Faculty> GetFacultyStatus()
 {
     using (FacultyContext db = new FacultyContext())
     {
         var facultyModel = db.Faculties.Where(s => s.RegistrationStatus == "Pending" && s.IsDeleted == false).ToList();
         return(facultyModel);
     }
 }
Beispiel #4
0
 public Faculty GetFacultyDetailsById(int id)
 {
     using (FacultyContext db = new FacultyContext())
     {
         var facultyModel = db.Faculties.Where(s => s.UserId == id).FirstOrDefault();
         return(facultyModel);
     }
 }
Beispiel #5
0
 public int GetFacultyId(Faculty facultyModel)
 {
     using (FacultyContext db = new FacultyContext())
     {
         var userId = db.Faculties.Where(s => s.SecurityQuestion == facultyModel.SecurityQuestion && s.SecurityQueAnswer == facultyModel.SecurityQueAnswer && (s.Contact == facultyModel.Contact || s.Email == facultyModel.Email)).Select(s => s.UserId).SingleOrDefault();
         return(userId);
     }
 }
Beispiel #6
0
 public IEnumerable <Faculty> GetFacultyDetails()
 {
     using (FacultyContext db = new FacultyContext())
     {
         var facultyModel = db.Faculties.Where(s => s.IsDeleted == false).ToList();
         return(facultyModel);
     }
 }
Beispiel #7
0
 public bool LoginCredentials(Faculty facultyModel)
 {
     using (FacultyContext db = new FacultyContext())
     {
         var status = db.Faculties.Where(s => s.UserId == facultyModel.UserId && s.Password == facultyModel.Password).FirstOrDefault();
         if (status != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Beispiel #8
0
 public bool EditFacultyDetails(Faculty faculty, string status, bool isdeleted)
 {
     using (FacultyContext db = new FacultyContext())
     {
         if (faculty != null)
         {
             faculty.RegistrationStatus = status;
             faculty.IsDeleted          = isdeleted;
             db.Entry(faculty).State    = EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Beispiel #9
0
 public bool DeleteFaculty(int id, Faculty faculty)
 {
     using (FacultyContext db = new FacultyContext())
     {
         var facultyModel = db.Faculties.Find(id);
         if (facultyModel != null)
         {
             facultyModel.IsDeleted          = true;
             facultyModel.RegistrationStatus = "Rejected";
             db.Entry(facultyModel).State    = EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Beispiel #10
0
 public LoginController(FacultyContext context)
 {
     _context = context;
 }
 public TeachersController(FacultyContext context, IWebHostEnvironment hostEnvironment)
 {
     _context            = context;
     _webHostEnvironment = hostEnvironment;
 }
Beispiel #12
0
 public NicknameNameRepository(FacultyContext context)
 {
     this.db = context;
 }
Beispiel #13
0
 public TopicRepository(FacultyContext context)
 {
     this.db = context;
 }
Beispiel #14
0
 public HomeController(ILogger <HomeController> logger, FacultyContext context)
 {
     _logger  = logger;
     _context = context;
     faceRecognitionHelper = new FaceRecognitionHelper(context);
 }
Beispiel #15
0
 public StudentsApiController(FacultyContext context)
 {
     _context = context;
 }
Beispiel #16
0
 public LearnerRepository(FacultyContext context)
 {
     this.db = context;
 }
Beispiel #17
0
 public EFUnitOfWork(string connectionString)
 {
     db = new FacultyContext(connectionString);
 }
Beispiel #18
0
 public LogRepository(FacultyContext context)
 {
     this.db = context;
 }
 public TeachersApiController(FacultyContext context)
 {
     _context = context;
 }
Beispiel #20
0
 public DetailsController(FacultyContext context)
 {
     _context = context;
 }
 public CoursesController(FacultyContext context)
 {
     _context = context;
 }
Beispiel #22
0
 public EnrollmentsApiController(FacultyContext context)
 {
     _context = context;
 }
Beispiel #23
0
 public FaceRecognitionHelper(FacultyContext context)
 {
     modelDirectory = Path.Combine(Environment.CurrentDirectory, @"FaceRecognitionModels");
     _context       = context;
 }
Beispiel #24
0
 public CourseRepository(FacultyContext context)
 {
     this.db = context;
 }
 public EnrollmentsController(FacultyContext context, IWebHostEnvironment webHostEnvironment)
 {
     _context            = context;
     _webHostEnvironment = webHostEnvironment;
 }
Beispiel #26
0
 public TeacherRepository(FacultyContext context)
 {
     this.db = context;
 }