Beispiel #1
0
 void InitGroupBoxes(COneRecord record)
 {
     semesters = new MyGroupBox[StringEquivalents.Nsemestrs];
     for (int i = 0; i < StringEquivalents.Nsemestrs; i++)
     {
         InitGroupBox(record, i);
     }
 }
Beispiel #2
0
        public void Add(CStudent student, bool IsActive)
        {
            count++;
            COneRecord record = new COneRecord(student, count);

            record.IsActive = IsActive;
            list.Add(record);
            record.AddToPanel(this.panel, 0, 28 * count);
        }
Beispiel #3
0
        public void Add(bool IsActive)
        {
            count++;
            CStudent Nst = new CStudent();

            Source.Add(Nst);
            COneRecord record = new COneRecord(Nst, count);

            record.IsActive = IsActive;
            list.Add(record);
            record.AddToPanel(this.panel, 0, 28 * count);
        }
Beispiel #4
0
        void InitCapt(COneRecord record)
        {
            form.Name = "Show/edit exams";
            info      = new Label[4];
            cont      = new TextBox[4];
            for (int i = 0; i < 4; i++)
            {
                info[i]           = new Label();
                cont[i]           = new TextBox();
                info[i].Font      = cont[i].Font = new System.Drawing.Font("Times New Roman", 10);
                info[i].TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                cont[i].TextAlign = HorizontalAlignment.Left;
            }
            info[0].Text = "FIO";
            info[1].Text = "Course";
            info[2].Text = "Specialization";
            info[3].Text = "Group";

            cont[0].Text = string.Join(" ", record.GetFIO());
            cont[1].Text = record.GetCourse().ToString();
            cont[2].Text = (StringEquivalents.Specializations[(int)record.GetSp()]);
            cont[3].Text = record.GetGroup().ToString();
            for (int i = 0; i < 4; i++)
            {
                cont[i].ReadOnly = true;
            }
            info[0].Width = cont[0].Width = 300;
            info[1].Width = cont[1].Width = 70;
            info[2].Width = cont[2].Width = 100;
            info[3].Width = cont[3].Width = 70;
            System.Drawing.Point loc  = new System.Drawing.Point(5, 5);
            System.Drawing.Point loct = new System.Drawing.Point(5, 25);

            info[0].Location = loc;
            cont[0].Location = loct;
            loc.X           += 300; loct.X += 300;

            info[1].Location = loc;
            cont[1].Location = loct;
            loc.X           += 70; loct.X += 70;

            info[2].Location = loc;
            cont[2].Location = loct;
            loc.X           += 100; loct.X += 100;

            info[3].Location = loc;
            cont[3].Location = loct;
            for (int i = 0; i < 4; i++)
            {
                form.Controls.Add(info[i]);
                form.Controls.Add(cont[i]);
            }
        }
Beispiel #5
0
 public ShowEditMarks(COneRecord record)
 {
     this.record          = record;
     form                 = new Form();
     form.Width           = 610;
     form.Height          = 560;
     form.FormBorderStyle = FormBorderStyle.FixedDialog;
     InitCapt(record);
     InitGroupBoxes(record);
     OK           = new Button();
     OK.Text      = "OK";
     OK.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     OK.Font      = new System.Drawing.Font("Times New Roman", 12);
     OK.Width     = 70;
     OK.Height    = 30;
     OK.Location  = new System.Drawing.Point(5, 460);
     OK.Click    += OK_Click;
     form.Controls.Add(OK);
 }
Beispiel #6
0
 void InitGroupBox(COneRecord record, int index)
 {
     semesters[index] = new MyGroupBox(record, index);
     form.Controls.Add(semesters[index].GetBox());
 }
Beispiel #7
0
            public MyGroupBox(COneRecord record, int index)
            {
                Main      = new GroupBox();
                Main.Text = "Semestr " + (index + 1).ToString();

                condition = record.GetExams().Semesters[index].Condition;
                //MessageBox.Show("Comd" + (int)condition);
                System.Drawing.Point location;
                if (index < 4)
                {
                    location = new System.Drawing.Point(5, 90 * (index + 1));
                }
                else
                {
                    location = new System.Drawing.Point(5 + 280, 90 * (index - 4 + 1));
                }
                Main.Width    = 270;
                Main.Height   = 90;
                Main.Location = location;
                switch (condition)
                {
                case EConditions.MustBeFilled:
                    Main.BackColor = System.Drawing.Color.FromArgb(127, 255, 255, 0);
                    break;

                case EConditions.CanBeFilled:
                    Main.BackColor = System.Drawing.Color.FromArgb(127, 0, 0, 255);
                    break;

                case EConditions.CanTBeFilled:
                    Main.BackColor = System.Drawing.Color.FromArgb(127, 128, 128, 128);
                    break;
                }
                System.Drawing.Point loc  = new System.Drawing.Point(5, 25);
                System.Drawing.Point locm = new System.Drawing.Point(5, 50);
                Sub     = new Label[StringEquivalents.NExams];
                Results = new ComboBox[StringEquivalents.NExams];
                for (int i = 0; i < StringEquivalents.NExams; i++)
                {
                    Sub[i]     = new Label();
                    Results[i] = new ComboBox();
                    switch (condition)
                    {
                    case EConditions.MustBeFilled:
                    case EConditions.CanBeFilled:
                        Results[i].Enabled = true;
                        break;

                    case EConditions.CanTBeFilled:
                        Results[i].Enabled = false;
                        break;
                    }
                    Sub[i].Width    = Results[i].Width = 40;
                    Sub[i].Text     = StringEquivalents.SubjectNames[(int)(record.GetExams()[index, i].Subject)];
                    Results[i].Text = StringEquivalents.Marks[(int)record.GetExams()[index, i].Mark];
                    Sub[i].Font     = Results[i].Font = new System.Drawing.Font("Times New Roman", 10);
                    Results[i].Items.AddRange(StringEquivalents.Marks);
                    Sub[i].Location         = loc;
                    Results[i].Location     = locm;
                    Results[i].TextChanged += ShowEditMarks_TextChanged;
                    Main.Controls.Add(Sub[i]);
                    Main.Controls.Add(Results[i]);
                    loc.X  += 40;
                    locm.X += 40;
                }
            }