Example #1
0
        public void EditInstructor(InstructorDataPanel caller)
        {
            var calling = new EditInstructor(Connector.connections[0].GetInstructor(instructors[panel1.Controls.IndexOf(caller)].ID), this)
            {
                Anchor = AnchorStyles.Top | AnchorStyles.Bottom
            };

            calling.Size = this.Size;
            this.Controls.Add(calling);
            calling.BringToFront();
        }
Example #2
0
        async void Initialize()
        {
            searched            = false;
            pictureBox1.Visible = true;
            panel1.Enabled      = false;
            panel1.Controls.Clear();
            instructordatas.Clear();
            panel1.SuspendLayout();
            await Task.Run(() =>
            {
                if (instructors.Count >= 7)
                {
                    for (int i = 0; i < instructors.Count; i++)
                    {
                        InstructorDataPanel panel = new InstructorDataPanel(this);
                        panel.Dock         = DockStyle.Top;
                        panel.namelb.Text  = instructors[i].FullName;
                        panel.emaillb.Text = instructors[i].Email;
                        panel.phonelb.Text = instructors[i].Phone;
                        panel.Width        = 764;
                        instructordatas.Add(panel);
                    }
                }
                else
                {
                    for (int i = 0; i < instructors.Count; i++)
                    {
                        var panel          = new InstructorDataPanel(this);
                        panel.Dock         = DockStyle.Top;
                        panel.namelb.Text  = instructors[i].FullName;
                        panel.emaillb.Text = instructors[i].Email;
                        panel.phonelb.Text = instructors[i].Phone;
                        panel.Width        = 781;
                        instructordatas.Add(panel);
                    }
                }
            });

            panel1.Controls.AddRange(instructordatas.ToArray());
            panel1.ResumeLayout();
            pictureBox1.Visible = false;
            panel1.Enabled      = true;
        }
Example #3
0
 void SearchInitialize(string FirstName, string LastName, string Type)
 {
     searched            = true;
     pictureBox1.Visible = true;
     panel1.Enabled      = false;
     searchinstructors   = Task.Run(() => Connector.connections[0].SearchInstructors(FirstName, LastName, Type)).Result;
     panel1.Controls.Clear();
     instructordatas.Clear();
     panel1.SuspendLayout();
     Task.Run(() =>
     {
         if (searchinstructors.Count >= 7)
         {
             for (int i = 0; i < searchinstructors.Count; i++)
             {
                 InstructorDataPanel panel = new InstructorDataPanel(this);
                 panel.Dock         = DockStyle.Top;
                 panel.namelb.Text  = searchinstructors[i].FullName;
                 panel.emaillb.Text = searchinstructors[i].Email;
                 panel.phonelb.Text = searchinstructors[i].Phone;
                 panel.Width        = 764;
                 instructordatas.Add(panel);
             }
         }
         else
         {
             for (int i = 0; i < searchinstructors.Count; i++)
             {
                 var panel          = new InstructorDataPanel(this);
                 panel.Dock         = DockStyle.Top;
                 panel.namelb.Text  = searchinstructors[i].FullName;
                 panel.emaillb.Text = searchinstructors[i].Email;
                 panel.phonelb.Text = searchinstructors[i].Phone;
                 panel.Width        = 781;
                 instructordatas.Add(panel);
             }
         }
     }).Wait();
     panel1.Controls.AddRange(instructordatas.ToArray());
     panel1.ResumeLayout();
     pictureBox1.Visible = false;
     panel1.Enabled      = true;
 }