Esempio n. 1
0
 public ActionResult StudentLogin(LoginStudent StuLog)
 {
     if (ModelState.IsValid)
     {
         if (db.tbl_Student.Where(m => m.Student_Email == StuLog.Student_Email && m.Student_Password == StuLog.Password && m.IsDeleted == false).FirstOrDefault() == null)
         {
             ViewBag.msg = "كلمة السر أو البريد الإلكتروني غير صحيح";
         }
         else
         {
             // إرسال بيانات المسئول إلي الكنترولر الخاص به
             var name = db.tbl_Student.Single(x => x.Student_Email == StuLog.Student_Email);
             Session["Studnet_Id"]    = name.Student_Id;
             Session["Studnet_Name"]  = name.Student_Name;
             Session["Department_Id"] = name.Department_Id;
             Session["Level_Id"]      = name.Level_Id;
             return(RedirectToAction("Index", "Student"));
         }
     }
     return(View());
 }
Esempio n. 2
0
 public void StartPageLogStud()
 {
     loginStudent = new LoginStudent();
     Application.Current.MainWindow.Close();
     loginStudent.Show();
 }