Пример #1
0
        public void EditCourse(CourseDataPanel caller)
        {
            var calling = new EditCourse(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf(caller)].ID), this)
            {
                Anchor = AnchorStyles.Top | AnchorStyles.Bottom
            };

            calling.Size = this.Size;
            this.Controls.Add(calling);
            calling.BringToFront();
        }
Пример #2
0
        async void Initialize()
        {
            searched            = false;
            pictureBox1.Visible = true;
            panel1.Enabled      = false;
            panel1.Controls.Clear();
            coursesdatas.Clear();
            panel1.SuspendLayout();
            await Task.Run(() =>
            {
                if (courses.Count >= 7)
                {
                    for (int i = 0; i < courses.Count; i++)
                    {
                        var panel  = new CourseDataPanel(this);
                        panel.Dock = DockStyle.Top;
                        panel.coursenamelb.Text     = courses[i].Name;
                        panel.instrectornamelb.Text = courses[i].Instructor.FullName;
                        panel.startlb.Text         += courses[i].time.ToString() + " " + courses[i].Day.ToString();
                        panel.periodlb.Text        += courses[i].period.ToString();
                        panel.lecnolb.Text         += courses[i].Material.NumberOfLectures.ToString();
                        panel.secnolb.Text         += courses[i].Material.NumberOfSections.ToString();
                        panel.booksnolb.Text       += courses[i].Material.NumberOfBooks.ToString();
                        panel.rowdatabarpl.Width    = 764;
                        panel.Width = 764;
                        coursesdatas.Add(panel);
                    }
                }
                else
                {
                    for (int i = 0; i < courses.Count; i++)
                    {
                        var panel  = new CourseDataPanel(this);
                        panel.Dock = DockStyle.Top;
                        panel.coursenamelb.Text     = courses[i].Name;
                        panel.instrectornamelb.Text = courses[i].Instructor.FullName;
                        panel.startlb.Text         += courses[i].time.ToString() + " " + courses[i].Day.ToString();
                        panel.periodlb.Text        += courses[i].period.ToString();
                        panel.lecnolb.Text         += courses[i].Material.NumberOfLectures.ToString();
                        panel.secnolb.Text         += courses[i].Material.NumberOfSections.ToString();
                        panel.booksnolb.Text       += courses[i].Material.NumberOfBooks.ToString();
                        panel.Width = 781;
                        coursesdatas.Add(panel);
                    }
                }
            });

            panel1.Controls.AddRange(coursesdatas.ToArray());
            panel1.ResumeLayout();
            pictureBox1.Visible = false;
            panel1.Enabled      = true;
        }