Beispiel #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            loaisach = tLoaiSach.Text;
            tacgia   = tTacGia.Text;
            nxb      = tNXB.Text;

            Ltd.Nhap2(loaisach, tacgia, nxb);
            this.Close();
        }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (tLoaiSach.Text.CompareTo("") == 0)
     {
         ktThem = 1;
     }
     else
     {
         temp.Nhap2(tLoaiSach.Text, tTacGia.Text, tNXB.Text);
     }
     this.Close();
 }
Beispiel #3
0
        private void Doc_Click(object sender, EventArgs e)
        {
            try
            {
                myList.clear(myList);                                              //Xóa hết dữ liệu đã tồn tại trong danh sách liên kết
                StreamReader rd = new StreamReader("LoaiSach.txt", Encoding.UTF8); //Đọc file text
                if (rd == null)
                {
                    MessageBox.Show("Đọc file không thành công.", "THÔNG BÁO:");
                }
                string x = rd.ReadLine();           /// doc so cuon sach
                soloaisach = Convert.ToInt32(x);    ///
                rd.ReadLine();                      /// doc text

                for (int i = 0; i < soloaisach; i++)
                {
                    string x1 = rd.ReadLine();
                    dsChuoi.Add(x1);
                }
                for (int j = 0; j < soloaisach; j++)
                {
                    SACH     x2       = new SACH();
                    string[] thongtin = dsChuoi[j].Split('/');

                    x2.Nhap2(thongtin[1], thongtin[2], thongtin[3]);
                    myList.addHead(x2);
                }
                //myList.Sort(); /// loi
                if (rd != null)
                {
                    MessageBox.Show("Lấy dữ liệu thành công.", "THÔNG BÁO:");
                }
                rd.Close();
            }
            catch (Exception ee) { MessageBox.Show(ee.Message); }
        }