コード例 #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 Đặt Thẻ ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Class.TheDocGia The = new Class.TheDocGia();

                The.IdNguoiLap = IdNguoiDung_FormMain;
                The.HoTen      = txtHoTen.Text;
                The.DiaChi     = txtDiaChi.Text;
                The.Phone      = ntxtPhone.Text;
                The.NgaySinh   = dateTimePicker1.Value.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;
                The.IdDocGia   = Convert.ToInt32(lblMaThe.Text);


                Class.XuLyThuVien KiemTra = new Class.XuLyThuVien();
                KiemTra.LapTheDocGia(The);
                MetroFramework.MetroMessageBox.Show(this, string.Format("Đặt Thẻ Thành Công Cho Đôc Giả :{0} ", The.HoTen));
                LapTheDocGia_Load(sender, e);
            }
        }