Exemplo n.º 1
0
        public void ShowDialog(RosterMysqlDataContext _context, Student _student)
        {
            Context = _context;
            _Student = _student;

            studentBindingSource.DataSource = _student;

            if (_student.DropInfo != null)
            dropInfoBindingSource.DataSource = _student.DropInfo;

            ShowDialog();
        }
 private void detach_Students(Student entity)
 {
     this.SendPropertyChanging("Students");
     entity.DropInfo = null;
 }
Exemplo n.º 3
0
        private void studentBindingSource_PositionChanged(object sender, EventArgs e)
        {
            _Student = (Student)studentBindingSource.Current;

            if (studentBindingSource.Count > 0) {

                if (StudentMainTab.SelectedTab == DropTab)    DropTab_Enter(sender, e);
                if (StudentMainTab.SelectedTab == GraduatedTab) GraduatedTab_Enter(sender, e);
                if (StudentMainTab.SelectedTab == EnrollmentTab) EnrollmentTab_Enter(sender, e);

                if (_Student.Graduated == null) Security.Hide("GraduatedTab");
                else
                    Security.Show("GraduatedTab");

                if (_Student.DropInfo == null) StudentMainTab.TabPages.Remove(DropTab);
                else if (!StudentMainTab.TabPages.Contains(DropTab)) StudentMainTab.TabPages.Add(DropTab);

                //--- load the image ---
                if (_Student.Picture != null) studentImage.Image = ImageManager.byteArrayToImage(_Student.Picture);
                else studentImage.Image = global::roster_visual.Properties.Resources.noimage;
            }
        }
Exemplo n.º 4
0
        private string GeneraCv(Student student)
        {
            /*int i = 0;
            var year_students = Context.Students.Where(e => e.StartDate.Year == student.StartDate.Year);
            foreach (Student item in year_students)
            {
                if (item == student) break;
                i++;
            }

            string b;

            if (i < 9) b = "00" + i.ToString();
                else
                    if (i < 99) b = "0" + i.ToString();
                        else b = i.ToString();

            string year = student.StartDate.Year.ToString();
            year = year[0].ToString() + year[2].ToString() + year[3].ToString();

            return year + b;*/
            return "";
        }
partial         void UpdateStudent(Student instance);
partial         void InsertStudent(Student instance);
partial         void DeleteStudent(Student instance);