public StudentInsertWindow()
 {
     InitializeComponent();
     //Student = item;
     Student = new StudentItem();
     Groups = new GroupRepository().GetAll();
     //SelectedGroup = new GroupItem(item.GroupId, item.GroupName);
     DataContext = this;
 }
Esempio n. 2
0
 public StudentEditWindow(StudentItem item)
 {
     InitializeComponent();
     Student = item;
     Groups = new GroupRepository().GetAll();
     SelectedGroup = Groups[0];
     //SelectedGroup = new DeaneryLibrary.GroupItem();
     //SelectedGroup.Id = item.GroupId; SelectedGroup.Name = item.GroupName;
     DataContext = this;
 }
Esempio n. 3
0
        public List <GradeItem> GetGradeBySheetId(int id)
        {
            List <GradeItem> result = new List <GradeItem>();

            try
            {
                StudentRepository _repo = new StudentRepository();

                SqlCommand com = base._cnn.CreateCommand();
                com.CommandType = CommandType.Text;
                com.CommandText = "select top 1000 * from get_grade_by_sheet_id(" + id + ")";

                SqlDataReader dr = com.ExecuteReader();

                /*
                 * g.GradeId, t.TypeOfGradeName as [Type],
                 * g.GradeValue,
                 * s.StudentId, s.StudentFirstName, s.StudentMiddleName, s.StudentLastName
                 * int id, string type, int value, StudentItem student
                 */
                while (dr.Read())
                {
                    StudentItem s = _repo.GetOneById((int)dr["StudentId"]);

                    result.Add(
                        new GradeItem(

                            (int)dr["GradeId"],
                            dr["Type"].ToString(),
                            (int)dr["GradeValue"],
                            s
                            )
                        );
                }
            }
            catch (Exception e) { throw e; }
            return(result);
        }
Esempio n. 4
0
 public GradeItem(int id, string type, int value, StudentItem student)
     : base(id, type)
 {
     this.Value = value;
     this.Student = student;
 }
Esempio n. 5
0
 public GradeItem(int id, string type, int value, StudentItem student)
     : base(id, type)
 {
     this.Value   = value;
     this.Student = student;
 }