Esempio n. 1
0
        public StudentC [] GetStudents()
        {
            try
            {
                StudentLogic sl  = new StudentLogic();
                DataTable    dt  = sl.GetStudent();
                StudentC []  std = new StudentC[dt.Rows.Count];


                int i = 0;
                foreach (DataRow row in dt.Rows)
                {
                    std[i]           = new StudentC();
                    std[i].StudentId = Int32.Parse(row[0].ToString());
                    std[i].Name      = row[1].ToString();
                    std[i].DOB       = DateTime.Parse(row[2].ToString());
                    std[i].GPA       = (double)Decimal.Parse(row[3].ToString());
                    std[i].Active    = bool.Parse(row[4].ToString());
                    i++;
                }
                return(std);
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Esempio n. 2
0
        public StudentC GetStudent(int StudentId)
        {
            StudentC std = new StudentC();

            try
            {
                StudentLogic sl = new StudentLogic();
                Student stdc = sl.GetStudent(StudentId);

                std.StudentId = stdc.StudentId;
                std.Name = stdc.Name;
                std.DOB = stdc.DOB;
                std.GPA = stdc.GPA;
                std.Active = stdc.Active;
            }
            catch (Exception exc)
            {
                throw exc;
            }

            return std;
        }
Esempio n. 3
0
        public StudentC GetStudent(int StudentId)
        {
            StudentC std = new StudentC();

            try
            {
                StudentLogic sl   = new StudentLogic();
                Student      stdc = sl.GetStudent(StudentId);

                std.StudentId = stdc.StudentId;
                std.Name      = stdc.Name;
                std.DOB       = stdc.DOB;
                std.GPA       = stdc.GPA;
                std.Active    = stdc.Active;
            }
            catch (Exception exc)
            {
                throw exc;
            }

            return(std);
        }
Esempio n. 4
0
        public void AddStudent(StudentC []stdc)
        {
            try
            {
                StudentLogic sl = new StudentLogic();

                Student[] std = new Student[stdc.Length];

                for (int i = 0; i < stdc.Length; i++)
                {
                    std[i] = new Student();
                    std[i].Name = stdc[i].Name;
                    std[i].DOB = stdc[i].DOB;
                    std[i].GPA = stdc[i].GPA;
                    std[i].Active = stdc[i].Active;
                }
                sl.AddStudent(std);
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Esempio n. 5
0
        public StudentC[] GetStudents()
        {
            try
            {
                StudentLogic sl = new StudentLogic();
                DataTable dt = sl.GetStudent();
                StudentC [] std = new StudentC[dt.Rows.Count];

                int i = 0;
                foreach (DataRow row in dt.Rows)
                {
                    std[i] = new StudentC();
                    std[i].StudentId = Int32.Parse( row[0].ToString());
                    std[i].Name = row[1].ToString();
                    std[i].DOB = DateTime.Parse( row[2].ToString());
                    std[i].GPA = (double)Decimal.Parse(row[3].ToString());
                    std[i].Active = bool.Parse( row[4].ToString());
                    i++;

                }
                return std;
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }