public ActionResult StudentLessonListPartial(string fromDate, string toDate, string id)
        {
            Student student = new Student();

            student.id = id;


            if (IsValidDate(fromDate))
            {
                student.fromDate = Convert.ToDateTime(fromDate);
            }

            if (IsValidDate(toDate))
            {
                student.toDate = Convert.ToDateTime(toDate);
            }


            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            student.name     = WS.GetStudentsName(sesId, student.id);
            student.logoLink = WS.GetCollegeLogo(sesId);



            student.StudentLessons = WS.GetStudentsTimeTable(sesId, student.id, student.fromDate, student.toDate);

            return(PartialView("_StudentLessonListPartial", student));
        }
Example #2
0
        public ActionResult OpenStudentInLesson(string courseNo, string lessonNo, string lessonDate)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.fromDate = DateTime.Now;

            //lecturer.id = id;
            lecturer.toDate = DateTime.Now.AddDays(7);
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            DateTime lessonDateDt = DateTime.Now;

            if (IsValidDate(lessonDate))
            {
                lessonDateDt = Convert.ToDateTime(lessonDate);
            }

            lecturer.studentInLesson = WS.GetStudentsInLesson(sesId, courseNo, Convert.ToInt32(lessonNo), lessonDateDt);

            lecturer.name     = WS.GetLecturerName(sesId, lecturer.id);
            lecturer.logoLink = WS.GetCollegeLogo(sesId);


            return(RedirectToAction("StudentsInLessonList", lecturer));
        }
Example #3
0
        public ActionResult LecturerLessonListPartial(string fromDate, string toDate, string id)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.id = id;


            if (IsValidDate(fromDate))
            {
                lecturer.fromDate = Convert.ToDateTime(fromDate);
            }

            if (IsValidDate(toDate))
            {
                lecturer.toDate = Convert.ToDateTime(toDate);
            }


            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            lecturer.name     = WS.GetLecturerName(sesId, lecturer.id);
            lecturer.logoLink = WS.GetCollegeLogo(sesId);


            lecturer.lecturerLessons = WS.GetLecturerTimeTable(sesId, lecturer.id, lecturer.fromDate, lecturer.toDate);

            return(PartialView("_LecturerLessonListPartial", lecturer));
        }
Example #4
0
        public ActionResult BtnloginClicked(string id)
        {
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            //WS.getstudentcom

            if (!WS.ValidIdNumber(id))
            {
                return(JavaScript("window.alert('.  תעודת זהות שהוזנה אינה במבנה תקין. אנא הזן שנית');"));
            }
            if (WS.LecturerIdNumberExist(sesId, id))
            {
                if (string.IsNullOrEmpty(WS.GetLecturerMobileById(sesId, id)))
                {
                    return(JavaScript("window.alert('. לא הוגדר טלפון נייד ברטיס שלך, יש לפנות למכללה לטיפול');"));
                }

                // return RedirectToAction("OpenStudentsLoginValidationPage", "CollegeLoginS");

                var picture = WS.GetCollegeLogo(sesId);

                LogInScreenData logInScreenData = new LogInScreenData();
                logInScreenData.logoLink = picture;

                Random rnd          = new Random();
                int    code         = 1000 + rnd.Next(8999);
                var    mobileNumber = WS.GetLecturerMobileById(sesId, id);

                #if DEBUG
                mobileNumber = "0528692703";
                #endif

                WS.Send_Sms_msg(sesId, mobileNumber, "קוד האימות שלך הוא: " + code.ToString());
                logInScreenData.mobileValidationCode = code.ToString();


                if (_validationCodesHashTable.ContainsKey(id))
                {
                    _validationCodesHashTable[id] = code.ToString();
                }
                else
                {
                    _validationCodesHashTable.Add(id, code.ToString());
                }

                logInScreenData.id = id;

                //return PartialView("CollegeLoginSPartial", logInScreenData);

                return(RedirectToAction("OpenLecturerValidationPage", "CollegeLoginL", new { id = id })); // redirects to internal url
            }
            else
            {
                return(JavaScript("window.alert('. יש לפנות למכללה. תעודת זהות לא מופיעה במערכת');"));
            }
        }
Example #5
0
        // GET: CollegeLoginS
        public ActionResult OpenLecturesLoginPage()
        {
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            var picture = WS.GetCollegeLogo(sesId);

            LogInScreenData logInScreenData = new LogInScreenData();

            logInScreenData.logoLink = picture;

            return(View("CollegeLoginL", logInScreenData));
        }
Example #6
0
        public ActionResult OpenLecturerValidationPage(string id)
        {
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            var picture = WS.GetCollegeLogo(sesId);

            LogInScreenData logInScreenData = new LogInScreenData();

            logInScreenData.logoLink             = picture;
            logInScreenData.id                   = id;
            logInScreenData.mobileValidationCode = _validationCodesHashTable[id].ToString();
            return(View("CollegeLoginLVald", logInScreenData));
        }
Example #7
0
        public ActionResult SaveApproveHealthStatment(string id)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.fromDate = DateTime.Now;

            lecturer.id     = id;
            lecturer.toDate = DateTime.Now.AddDays(7);
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            WS.SaveLecturerHealthStatement(sesId, lecturer.id, DateTime.Now);


            return(View("LecturerHealthStatement", lecturer));
        }
        // GET: StudentTimeTable
        public ActionResult StudentLessonList(string id)
        {
            Student student = new Student();

            student.fromDate = DateTime.Now;
            student.id       = id;
            student.toDate   = DateTime.Now.AddDays(7);
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            student.StudentLessons = WS.GetStudentsTimeTable(sesId, student.id, student.fromDate, student.toDate);
            student.name           = WS.GetStudentsName(sesId, student.id);
            student.logoLink       = WS.GetCollegeLogo(sesId);


            return(View("StudentLessonList", student));
        }
Example #9
0
        public ActionResult BtnValidationloginClicked(string inputVcode, string mobileValidationCode, string id)
        {
            if (inputVcode != mobileValidationCode)
            {
                return(JavaScript("window.alert('. קוד אימות אינו נכון. אנא הזן קוד אימות שנית');"));
            }
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            var picture = WS.GetCollegeLogo(sesId);

            LogInScreenData logInScreenData = new LogInScreenData();

            logInScreenData.logoLink = picture;

            return(RedirectToAction("LecturerLessonList", "LecturerTimeTable", new { id = id }));
        }
Example #10
0
        public ActionResult LecturerLessonList(string id)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.fromDate = DateTime.Now;

            lecturer.id     = id;
            lecturer.toDate = DateTime.Now.AddDays(7);
            CollegeWS.College WS = new CollegeWS.College();
            var sesId            = utils.GetSesId();

            lecturer.lecturerLessons = WS.GetLecturerTimeTable(sesId, lecturer.id, lecturer.fromDate, lecturer.toDate);
            lecturer.name            = WS.GetLecturerName(sesId, lecturer.id);
            lecturer.logoLink        = WS.GetCollegeLogo(sesId);


            return(View("LecturerLessonList", lecturer));
        }
Example #11
0
        public ActionResult OpenLecturerHealthStatement(string id)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.fromDate = DateTime.Now;

            lecturer.id     = id;
            lecturer.toDate = DateTime.Now.AddDays(7);
            CollegeWS.College WS            = new CollegeWS.College();
            var  sesId                      = utils.GetSesId();
            bool lecturerHasHealthStatement = WS.LecturerHasHealthStatement(sesId, lecturer.id, DateTime.Now);

            lecturer.name     = WS.GetLecturerName(sesId, lecturer.id);
            lecturer.logoLink = WS.GetCollegeLogo(sesId);


            return(RedirectToAction("LecturerHealthStatement", lecturer));
        }
Example #12
0
        public ActionResult LecturerHealthStatement(string id)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.fromDate = DateTime.Now;

            lecturer.id     = id;
            lecturer.toDate = DateTime.Now.AddDays(7);
            CollegeWS.College WS            = new CollegeWS.College();
            var  sesId                      = utils.GetSesId();
            bool lecturerHasHealthStatement = WS.LecturerHasHealthStatement(sesId, lecturer.id, DateTime.Now);

            if (lecturerHasHealthStatement)
            {
                return(JavaScript("window.alert('. הצהרת בריאות עבור יום נוכחי כבר נחתמה.אין צורך בחתימה נוספת');"));
            }

            lecturer.name     = WS.GetLecturerName(sesId, lecturer.id);
            lecturer.logoLink = WS.GetCollegeLogo(sesId);
            lecturer.approveHealthStatmentId = false;

            return(View("LecturerHealthStatement", lecturer));
        }
Example #13
0
 public static string GetSesId()
 {
     CollegeWS.College ws = new CollegeWS.College();
     return(ws.GetSessionId(1573, "college", "", 1, false));
 }