Пример #1
0
        private void btnDatThe_Click(object sender, EventArgs e)
        {
            Visible_Sao();
            if (Compelete() == false)
            {
            }
            else if ((DateTime.Now.Year - dateTimePicker1.Value.Year) <= TuoiMuonSach)
            {
                MetroFramework.MetroMessageBox.Show(this, "Độc Giả Chưa Đủ Độ Tuổi Mượn Sách", "Không Được Phép", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }


            else if (MetroFramework.MetroMessageBox.Show(this, "Chắc Chắn Hay Không", "Bạn Muốn Sửa Thẻ Này", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Class.TheDocGia The = new Class.TheDocGia();


                The.HoTen    = txtHoTen.Text;
                The.DiaChi   = txtDiaChi.Text;
                The.Phone    = ntxtPhone.Text;
                The.NgaySinh = dateTimePicker1.Text.ToString();

                if (rdNam.Checked == true)
                {
                    The.GioiTinh = "Nam";
                }
                else
                {
                    The.GioiTinh = "Nữ";
                }
                The.Mail       = txtEmail.Text;
                The.CMND       = ntxtCMND.Text;
                The.LoaiDocGia = txtLoaiDocGia.Text;
                The.MaVe       = lblMaThe.Text;
                The.NgayLapThe = lblNgayLap.Text;



                Class.XuLyThuVien KiemTra = new Class.XuLyThuVien();
                KiemTra.SuaTheDocGia(The, IdDocGia_FormMain);
                MetroFramework.MetroMessageBox.Show(this, string.Format("Sửa Thẻ Thành Công Cho Độc Giả :{0} ", The.HoTen));
                this.Close();
            }
        }