Exemplo n.º 1
0
        private void BtnInput_Click(object sender, EventArgs e)
        {
            id_delete = Convert.ToInt32(txtInput.Text);
            LinkListStudent temp = new LinkListStudent();

            F = temp.loadListStudent(F);
            LinkListScore tempsc = new LinkListScore();

            sc     = tempsc.loadListScore(sc);
            F      = Deletestudent(F, id_delete);
            sc     = Deletescore(sc, id_delete);
            datas  = F.changest(F);
            datas1 = sc.changesc(sc);
            foreach (string s in datas)
            {
                txtShowStudent.Text = string.Join(Environment.NewLine, datas);
            }
            foreach (string s in datas1)
            {
                txtShowScore.Text = string.Join(Environment.NewLine, datas1);
            }
        }
Exemplo n.º 2
0
        public LinkListFullInfo loadStudentType(LinkListFullInfo F, int type)
        {
            Console.OutputEncoding = Encoding.Unicode;
            LinkListStudent S = new LinkListStudent();

            S.loadListStudent(S);
            LinkListScore L = new LinkListScore();

            L.loadListScore(L);
            DateTime temp = DateTime.Now;
            int      ID, type1, dut;
            string   sex;
            string   lastName, name, rank = null;
            DateTime birthdate;
            double   mathScore, literatureScore, englishScore, totalScore, minScore;

            while (S != null && L != null)
            {
                if (S.type != type)
                {
                    S = S.Next;
                    L = L.Next;
                    continue;
                }
                else
                {
                    LinkListFullInfo p = new LinkListFullInfo();
                    ID              = S.ID;
                    lastName        = S.lastName;
                    name            = S.name;
                    sex             = S.sex;
                    type1           = S.type;
                    mathScore       = L.mathScore;
                    literatureScore = L.literatureScore;
                    englishScore    = L.englishScore;
                    minScore        = scoreMin(L.mathScore, L.literatureScore, L.englishScore);

                    if (S.type == 1)
                    {
                        dut = 2;
                    }
                    else if (S.type == 2)
                    {
                        dut = 1;
                    }
                    else
                    {
                        dut = 3;
                    }
                    birthdate  = S.birthDate;
                    totalScore = L.mathScore + L.literatureScore + L.englishScore + dut;
                    if (totalScore >= 24 && minScore >= 7)
                    {
                        rank = "Giỏi";
                    }
                    if (totalScore >= 21 && totalScore < 24)
                    {
                        if (minScore >= 6)
                        {
                            rank = "Khá";
                        }
                    }
                    if (totalScore >= 15 && totalScore < 21)
                    {
                        if (minScore >= 4)
                        {
                            rank = "Trung Bình";
                        }
                    }
                    if (totalScore < 15 || totalScore < 15 && minScore < 4 || minScore < 4)
                    {
                        rank = "Trượt";
                    }
                    addFullInfo(p, ID, lastName, name, sex, birthdate, mathScore, literatureScore, englishScore, minScore, totalScore, rank, type);
                    addFull(ref F, p);
                }
                S = S.Next;
                L = L.Next;
            }
            return(F);
        }
Exemplo n.º 3
0
        private void BtnAddFront_Click(object sender, EventArgs e)
        {
            LinkListStudent temp = new LinkListStudent();

            F = temp.loadListStudent(F);
            LinkListStudent p          = new LinkListStudent();
            int             ID         = Convert.ToInt32(txtID.Text);
            string          lastName   = txtLastName.Text;
            string          name       = txtName.Text;
            string          sex        = txtSex.Text;
            int             type       = Convert.ToInt32(txtType.Text);
            DateTime        birthDate1 = dateTimePicker1.Value;

            LinkListStudent L = null;

            while (F != null && F.ID < ID)
            {
                LinkListStudent k = new LinkListStudent {
                    ID = F.ID, name = F.name, lastName = F.lastName, sex = F.sex, birthDate = F.birthDate, type = F.type
                };
                temp.addst(ref L, k);
                F = F.Next;
            }
            //temp.addst(ref L, F);
            temp.addStudent1(p, ID, lastName, name, sex, birthDate1, type);
            temp.addst(ref L, p);
            while (F != null)
            {
                LinkListStudent k = new LinkListStudent {
                    ID = F.ID + 1, name = F.name, lastName = F.lastName, sex = F.sex, birthDate = F.birthDate, type = F.type
                };
                temp.addst(ref L, k);
                F = F.Next;
            }

            LinkListScore tempsc = new LinkListScore();

            sc = tempsc.loadListScore(sc);
            LinkListScore P               = new LinkListScore();
            int           id              = Convert.ToInt32(txtID.Text);
            double        mathScore       = Convert.ToDouble(txtMathScore.Text);
            double        literatureScore = Convert.ToDouble(txtLiteratureScore.Text);
            double        englishScore    = Convert.ToDouble(txtEnglishScore.Text);
            LinkListScore Lsc             = null;

            while (sc != null && sc.id < id)
            {
                LinkListScore k = new LinkListScore {
                    id = sc.id, mathScore = sc.mathScore, literatureScore = sc.literatureScore, englishScore = sc.englishScore
                };
                sc.addS(ref Lsc, k);
                sc = sc.Next;
            }
            //temp.addst(ref L, F);
            sc.addScore(P, id, mathScore, literatureScore, englishScore);
            sc.addS(ref Lsc, P);
            while (sc != null)
            {
                LinkListScore k = new LinkListScore {
                    id = (sc.id) + 1, mathScore = sc.mathScore, literatureScore = sc.literatureScore, englishScore = sc.englishScore
                };
                sc.addS(ref Lsc, k);
                sc = sc.Next;
            }
            datas = Change(L, Lsc);
            foreach (string s in datas)
            {
                txtShow.Text = string.Join(Environment.NewLine, datas);
            }
        }
Exemplo n.º 4
0
        public LinkListFullInfo setStTruot(LinkListFullInfo F)
        {
            Console.OutputEncoding = Encoding.Unicode;
            LinkListStudent S = new LinkListStudent();

            S.loadListStudent(S);
            LinkListScore L = new LinkListScore();

            L.loadListScore(L);
            DateTime temp = DateTime.Now;
            int      ID, type, dut;
            string   sex;
            string   lastName, name, rank = null;
            double   mathScore, literatureScore, englishScore, totalScore, minScore;
            DateTime birthdate;

            while (S != null && L != null)
            {
                LinkListFullInfo p = new LinkListFullInfo();
                ID              = S.ID;
                lastName        = S.lastName;
                name            = S.name;
                sex             = S.sex;
                type            = S.type;
                mathScore       = L.mathScore;
                literatureScore = L.literatureScore;
                englishScore    = L.englishScore;
                minScore        = scoreMin(L.mathScore, L.literatureScore, L.englishScore);
                if (S.type == 1)
                {
                    dut = 2;
                }
                else if (S.type == 2)
                {
                    dut = 1;
                }
                else
                {
                    dut = 3;
                }
                totalScore = L.mathScore + L.literatureScore + L.englishScore + dut;
                birthdate  = S.birthDate;
                if (mathScore == 0 || literatureScore == 0 || englishScore == 0)
                {
                    S = S.Next;
                    L = L.Next;
                    continue;
                }
                if (totalScore < 15 || minScore < 4)
                {
                    rank = "Trượt";
                    addFullInfo(p, ID, lastName, name, sex, birthdate, mathScore, literatureScore, englishScore, minScore, totalScore, rank, type);
                    addFull(ref F, p);
                }


                S = S.Next;
                L = L.Next;
            }
            return(F);
        }