Exemplo n.º 1
0
 public RoomExtra(Student Student)
 {
     InitializeComponent();
     dao                   = new StudentDAL();
     this.student          = Student;
     completeFeeLabel.Text = "";
 }
Exemplo n.º 2
0
        public ActionResult NewStudent()
        {
            StudentDAL dal = new StudentDAL();

            ViewBag.cities = dal.GetCities();
            return(View());
        }
Exemplo n.º 3
0
        public JsonResult GetById(int tid)
        {
            StudentDAL dal = new StudentDAL();
            var        obj = dal.GetById(tid);

            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult search(string key)
        {
            StudentDAL dal = new StudentDAL();
            List <StudentProjectionModel> list = dal.Search(key);

            return(View(list));
        }
Exemplo n.º 5
0
        public ActionResult Edit(int id)
        {
            StudentDAL   dal   = new StudentDAL();
            StudentModel model = dal.Find(id);

            return(View(model));
        }
Exemplo n.º 6
0
        private void BuildGridJournalNewLesson()
        {
            studentsOnTheLesson = StudentDAL.GetAllStudentsOnTheLesson(newLesson.LessonID);

            gridJournal.Columns.AddRange(new DataGridViewTextBoxColumn {
                Name = "Name", HeaderText = "Last name, First name"
            },
                                         new DataGridViewTextBoxColumn {
                Name = "Mark", HeaderText = "Mark", ValueType = typeof(decimal?)
            },
                                         new DataGridViewCheckBoxColumn {
                Name = "IsPresent", HeaderText = "Is Present"
            });

            foreach (StudentInfo s in studentsOnTheLesson)
            {
                gridJournal.Rows.Add(string.Format("{0} {1}", s.LastName, s.FirstName),
                                     string.Empty,
                                     false);
            }

            gridJournal.AllowUserToAddRows      = false;
            gridJournal.AllowUserToDeleteRows   = false;
            gridJournal.AllowUserToOrderColumns = false;
            gridJournal.Update();
        }
Exemplo n.º 7
0
 static void Main()
 {
     StudentDAL.printStudents(StudentDAL.getAllStudents());
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Main());
 }
Exemplo n.º 8
0
        /// <summary>
        /// This function is used to update a particular entry in the database
        /// </summary>
        public void update(StudentDTO dtoobj)
        {
            Studentmapper mapperobj     = new Studentmapper();
            StudentDAL    studentdalobj = new StudentDAL();

            studentdalobj.update(mapperobj.to_modelobj(dtoobj));
        }
Exemplo n.º 9
0
        private void UpdateChart()
        {
            this.subjects = new SortedSet <string>();

            sbjcts = SubjectsDAL.GetGradeSubjects(StudentDAL.GetStudentGradeID(this.StudentID));
            foreach (Subject s in sbjcts)
            {
                this.subjects.Add(s.Title);
            }

            //gain marks list on each subject
            List <string>           seriesList = new List <string>();
            List <List <MarkInfo> > marksList  = new List <List <MarkInfo> >();

            DateTime studyYearStart;                                        //= new DateTime(yearStart, 9, 1); //1st Septemper

            if (DateTime.Now.Month <= 7)                                    //it's previous study year
            {
                studyYearStart = new DateTime(DateTime.Now.Year - 1, 9, 1); //1st Septemper
            }
            else
            {
                studyYearStart = new DateTime(DateTime.Now.Year, 9, 1);
            }

            this.Text = string.Format("My overall progress - School Journal" +
                                      " - Results on the {0}/{1} study year", studyYearStart.Year, studyYearStart.Year + 1);

            foreach (Subject s in this.sbjcts)
            {
                if (seriesList.Contains(s.Title))
                {
                    continue;
                }
                seriesList.Add(s.Title);

                //select student marks
                marksList.Add(StudentDAL.GetStudentSubjectMarks(this.StudentID, s.SubjectID, studyYearStart));
            }

            this.chartProgress.Series.Clear();
            for (int i = 0; i < seriesList.Count; i++)
            {
                // Add series.
                Series series = this.chartProgress.Series.Add(seriesList[i]);

                series.XValueType = ChartValueType.Date;
                series.YValueType = ChartValueType.Double;

                if (marksList[i].Count > 0)
                {
                    this.chartProgress.BackImage = string.Empty;
                }
                series.Points.Clear();
                foreach (MarkInfo info in marksList[i])
                {
                    series.Points.AddXY(info.Date, (double)info.MarkValue);
                }
            }
        }
 public static Student GetById(long studentId)
 {
     using (StudentDAL studentDAL = new StudentDAL())
     {
         return(studentDAL.GetById(studentId));
     }
 }
 public static List <Student> GetAll()
 {
     using (StudentDAL studentDAL = new StudentDAL())
     {
         return(studentDAL.GetAll());
     }
 }
Exemplo n.º 12
0
        private void btnMyProfile_Click(object sender, EventArgs e)
        {
            StudentInfo info = null;

            try
            {
                info = StudentDAL.GetStudentInfo(this.StudentID);
            }
            catch (ArgumentOutOfRangeException ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ProfileWindow wnd = null;

            if (info.DateOfJoin.HasValue)
            {
                wnd = new ProfileWindow(info, "Grade", info.GradeName, "Date of join", info.DateOfJoin.Value.ToString());
            }
            else
            {
                wnd = new ProfileWindow(info, "Grade", info.GradeName);
            }

            wnd.FormClosed += ((o, s) =>
            {
                this.Show();
            });
            wnd.Owner = this;
            wnd.Show();
            this.Hide();
        }
        private void UpdateSubjectsComboBox()
        {
            this.subjects = new SortedSet <string>();

            sbjcts = SubjectsDAL.GetGradeSubjects(StudentDAL.GetStudentGradeID(this.StudentID));
            foreach (Subject s in sbjcts)
            {
                this.subjects.Add(s.Title);
            }


            this.comboSubject.Items.Clear();
            foreach (string sTitle in this.subjects)
            {
                this.comboSubject.Items.Add(sTitle);
            }
            if (comboSubject.Items.Count > 0)
            {
                comboSubject.SelectedItem = comboSubject.Items[0];
            }
            else
            {
                comboSubject.Enabled = false;
            }
        }
Exemplo n.º 14
0
        public JsonResult StudentLastRegInfo()
        {
            StudentDAL sDAL     = new StudentDAL();
            var        jsonData = sDAL.StudentGetAll().OrderByDescending(p => p.StudentId).FirstOrDefault();

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 15
0
        public IActionResult StudentListView()
        {
            StudentDAL     dal      = new StudentDAL();
            List <Student> students = (List <Student>)dal.GetAllStudents();

            ViewData["students"] = students;

            Student first = students.FirstOrDefault();

            ViewData["first"] = first;

            Student last = students.LastOrDefault();

            ViewData["last"] = last;

            Student elementAt = students.ElementAtOrDefault(2);

            ViewData["elementAt"] = elementAt;

            Student single = students.SingleOrDefault(st => st.MarksPercent == 800);

            ViewData["single"] = single;

            List <Student>        emptyList      = new List <Student>();
            IEnumerable <Student> defaultIfEmpty = (IEnumerable <Student>)emptyList.DefaultIfEmpty();

            ViewData["defaultIfEmpty"] = defaultIfEmpty;

            return(View());
        }
Exemplo n.º 16
0
        public IActionResult StudentListView()
        {
            StudentDAL     dal      = new StudentDAL();
            List <Student> students = (List <Student>)dal.GetAllStudents();

            ViewData["students"] = students;

            var filter = (from st in students
                          where st.MarksPercent > 80
                          select st);
            List <Student> filterStudent = filter.ToList <Student>();

            ViewData["filter"] = filterStudent;

            students.ForEach(student =>
                             student.subjects = Enumerable.Range(0, 4)
                                                .Select((item, i) => $"Subject {item*4+i}").ToList());


            var           many     = students.SelectMany(st => st.subjects);
            List <String> manyList = many.ToList <String>();

            ViewData["many"] = manyList;

            return(View());
        }
Exemplo n.º 17
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            int choice = comboBoxChoiceSearchby.SelectedIndex;

            switch (choice)
            {
            case -1:
                MessageBox.Show("Please select search optn");
                break;

            case 0:
                Student std = StudentDAL.Search(Convert.ToInt32(textBoxInputInfo.Text));
                if (std != null)
                {
                    textBoxStudentID.Text         = (std.StudentId).ToString();
                    textBoxFirstName.Text         = std.FirstName;
                    textBoxLastName.Text          = std.LastName;
                    maskedTextBoxPhoneNumber.Text = std.PhoneNumber;
                }
                else
                {
                    MessageBox.Show("Student not found");
                    textBoxInputInfo.Clear();
                    textBoxInputInfo.Focus();
                }
                break;



            default:
                break;
            }
        }
Exemplo n.º 18
0
        private void SearchStudentByTagId(string tagId)
        {
            StudentDAL stddal = new StudentDAL();

            std = stddal.SearchStudentByTagId(tagId);

            studentId                      = std.StudentId;
            lblStudentId.Text              = "Student Id  : " + studentId;
            lblName1.Text                  = std.Name;
            lblRollNo1.Text                = std.RollNo;
            lblGender1.Text                = std.Gender;
            lblDOB1.Text                   = std.DOB;
            lblClass1.Text                 = std.Class;
            lblSection1.Text               = std.Section;
            lblClassTeacher1.Text          = std.ClassTeacher;
            lblClassTeacherContactNo1.Text = std.ClassTeacherContactNo;
            lblGuardianName1.Text          = std.GuardianName;
            lblGuardianContactNo1.Text     = std.GuardianContactNo;
            lblHomeAddress1.Text           = std.HomeAddress;
            lblSiblingInfo1.Text           = std.SiblingInformation;
            lblJoinSchoolDate1.Text        = std.JoinedSchoolDate;
            lblBloodGroup1.Text            = std.BloodGroup;
            lblNotes1.Text                 = std.Notes;
            lblWarning1.Text               = std.Notes;

            string img = std.StudentPhoto;

            if (img != null)
            {
                pbStudentPhoto.Image = Base64ToImage(img);
            }
        }
Exemplo n.º 19
0
        protected void Page_Init(object sender, EventArgs e)
        {
            StudentDAL studentDAL = new StudentDAL();
            StudentDS  studentDS  = new StudentDS();

            studentDS.Clear();
            studentDS = studentDAL.GetStudents();

            _reportDocument.Load(Server.MapPath("~/studentDetails.rpt"));
            _reportDocument.SetDataSource(studentDS);

            int        totalStudents = studentDS.Tables["Student"].Rows.Count;
            TextObject totalStd;

            if (_reportDocument.ReportDefinition.ReportObjects["totalStd"] != null)
            {
                totalStd      = (TextObject)_reportDocument.ReportDefinition.ReportObjects["totalStd"];
                totalStd.Text = totalStudents.ToString();
            }

            int exportFormatFlags = (int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat);

            rptStudentList.AllowedExportFormats          = exportFormatFlags;
            rptStudentList.ToolPanelView                 = CrystalDecisions.Web.ToolPanelViewType.None;
            rptStudentList.HasToggleGroupTreeButton      = false;
            rptStudentList.HasToggleParameterPanelButton = false;
            rptStudentList.DisplayGroupTree              = false;
            rptStudentList.EnableDrillDown               = false;
            rptStudentList.HasDrilldownTabs              = false;
            rptStudentList.HasCrystalLogo                = false;
            rptStudentList.ReportSource = _reportDocument;
        }//end function
Exemplo n.º 20
0
        public StudentDTO GetStudentDTO(string Tz)
        {
            StudentDAL student    = new StudentDAL();
            Student    s          = student.GetStudent(Tz);
            StudentDTO studentDTO = new StudentDTO();

            if (s != null)
            {
                studentDTO.studentId          = s.studentId;
                studentDTO.studentTz          = s.studentTz;
                studentDTO.studentFirstName   = s.studentFirstName;
                studentDTO.studentLastName    = s.studentLastName;
                studentDTO.studentPel         = s.studentPel;
                studentDTO.studentCity        = s.studentCity;
                studentDTO.studentAddress     = s.studentAddress;
                studentDTO.studentParentName  = s.studentParentName;
                studentDTO.studentParentPel   = s.studentParentPel;
                studentDTO.studentParentEmail = s.studentParentEmail;
                return(studentDTO);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 21
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="GradePageController" /> class.
 /// </summary>
 /// <param name="gradePage">The grade page.</param>
 public GradePageController(GradePage gradePage)
 {
     this.gradePage    = gradePage;
     this.studentIds   = new Dictionary <int, string>();
     this.gradeItemDal = new GradeItemDAL();
     this.studentDal   = new StudentDAL();
 }
Exemplo n.º 22
0
 public StudentController()
 {
     this.courseDAL  = new CourseDAL();
     this.gradesDAL  = new GradeItemDAL();
     this.rubricDAL  = new RubricDAL();
     this.studentDAL = new StudentDAL();
 }
Exemplo n.º 23
0
        public ActionResult Delete(int id)
        {
            StudentDAL dal    = new StudentDAL();
            bool       status = dal.Delete(id);

            return(View());
        }
Exemplo n.º 24
0
        public JsonResult GetAll()
        {
            StudentDAL dal  = new StudentDAL();
            var        list = dal.GetAll();

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 25
0
        public ActionResult Edit(StudentModel model)
        {
            StudentDAL dal = new StudentDAL();

            dal.Update(model.studentID, model.studentpassword, model.studentmobileno);
            return(View("view_updated"));
        }
Exemplo n.º 26
0
        //added by Hafiz @ 04/3/2016
        //methods for load data from sas_studentoutstanding
        public List <StudentEn> GetOutstandingForUploadedFile(List <StudentEn> list_stud)
        {
            List <StudentEn> loEnList = new List <StudentEn>();

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    StudentDAL loDs = new StudentDAL();

                    foreach (StudentEn argEn in list_stud)
                    {
                        StudentEn loItem = new StudentEn();

                        loItem = loDs.GetOutstandingForUploadedFile(argEn);
                        loEnList.Add(loItem);
                    }
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return(loEnList);
        }
Exemplo n.º 27
0
        private void LoadStudentCourseGrid()
        {
            DataTable studentCourseResults = null;

            switch (m_dbLayer)
            {
            case "linq":
                studentCourseResults = LinqLayer.GetAllStudentCourses();
                break;

            case "lightweight":
                studentCourseResults = StudentDAL.SearchStudent();
                break;

            default:
                break;
            }

            grdStudentCourse.DataSource = null;
            grdStudentCourse.DataSource = studentCourseResults;
            grdStudentCourse.Columns["Student Name"].Width      = 200;
            grdStudentCourse.Columns["Course (Level)"].Width    = 200;
            grdStudentCourse.Columns["StudentCourseId"].Visible = false;
            grdStudentCourse.Columns["StudentId"].Visible       = false;
            grdStudentCourse.Columns["CourseId"].Visible        = false;
            grdStudentCourse.Columns["isDeleted"].Visible       = false;
        }
Exemplo n.º 28
0
        public IActionResult StudentListView()
        {
            StudentDAL     dal      = new StudentDAL();
            List <Student> students = (List <Student>)dal.GetAllStudents();

            students.Add(new GradStudent()
            {
                ID           = 100,
                Name         = "Mike",
                MarksPercent = 103
            });
            ViewData["students"] = students;

            var filter = (from st in students
                          where st.MarksPercent > 80
                          select st);
            List <Student> filter1 = filter.ToList <Student>();

            ViewData["filter1"] = filter1;

            filter = (from st in students
                      where st.Name == "June"
                      select st);
            List <Student> filter2 = filter.ToList <Student>();

            ViewData["filter2"] = filter2;

            var gradStudents = students.OfType <GradStudent>().ToList();

            ViewData["gradStudents"] = gradStudents;

            return(View());
        }
Exemplo n.º 29
0
        private void btnSignIn_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            if (username == "" || password == "") // username or password is empty
            {
                MessageBox.Show("Username and password are required!");
                return;
            }
            else   // have entered username and password
            {
                StudentAccount theAccount = new StudentDAL().studentLogin(username, password);
                if (theAccount != null) // correct username and password
                {
                    // create this student
                    Student theStudent = new StudentDAL().getTheStudent(theAccount.studentID);
                    this.Hide();
                    ManagementForm managerWindow = new ManagementForm(theAccount, theStudent);
                    managerWindow.Show();
                }
                else // wrong username or password
                {
                    errorMessage.ForeColor = Color.Yellow;
                    errorMessage.Text      = "Wrong username or password";
                }
            }
        }
Exemplo n.º 30
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            //grading procedure

            /*
             * //string connection = @"Data Source=BASMA-HP\SQLEXPRESS;Initial Catalog=ExaminationSystems;Integrated Security=True";
             * SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection(DBLayer.connection);
             * SqlCommand sqlCommand = new SqlCommand();
             * sqlConnection.Open();
             * sqlCommand.CommandText = "Exam_Correction";
             * sqlCommand.CommandType = CommandType.StoredProcedure;
             * //sqlCommand.Parameters.AddWithValue("@Exam_ID", exam_id);
             * sqlCommand.Parameters.AddWithValue("@Exam_ID", MyExam.Exam.Id);
             * //sqlCommand.Parameters.AddWithValue("@Student_ID", student_id);
             * sqlCommand.Parameters.AddWithValue("@Student_ID", MyStudent.Student.Id);
             * sqlCommand.Connection = sqlConnection;
             * sqlCommand.ExecuteNonQuery();
             * sqlConnection.Close();
             */

            StudentDAL.setFinishExam(MyExam.Exam.Id);
            Student_Profile f = new Student_Profile();

            f.Show();
            this.Close();
        }
Exemplo n.º 31
0
        public object Login(string identityCard, string passWord)
        {
            Teacher teacher = new Teacher();
            Student student = new Student();

            StudentDAL studentDAL = new StudentDAL();
            TeacherDAL teacherDAL = new TeacherDAL();

            try
            {
                student = studentDAL.SelectByProperty(s => s.IdentityCard.Trim() == identityCard.Trim()).FirstOrDefault();
                teacher = teacherDAL.SelectByProperty(t => t.IdentityCard.Trim() == identityCard.Trim()).FirstOrDefault();

                if (student !=null)
                {
                    if (student.PassWord.Trim() == passWord.Trim())
                        return student;
                    else
                        throw new ViladationException(new RuleViolation("�����ȷ."));
                }
                else if (teacher!=null)
                {
                    if (teacher.PassWord.Trim() == passWord.Trim())
                        return teacher;
                    else
                        throw new ViladationException(new RuleViolation("�����ȷ."));
                }
                else
                    throw new ViladationException(new RuleViolation("�������!"));

            }
            catch (AccessDataException ac)
            {
                throw ac;
            }
        }