Beispiel #1
0
        //To end placeholders
        public void btnAdd_Click(object sender, EventArgs e)
        {
            bool result;
            int  maxAuth = authBUS.getMaxNumberofAuth();
            int  temp    = authBUS.getNumberofAuth(); // to get present number of author

            if (temp >= maxAuth && maxAuth != 0)
            {
                MessageBox.Show("Số tác giả đã hơn số qui định");
            }
            else
            {
                //map data from gui
                authDTO.MaTacGia  = tbAuthCode.Text;
                authDTO.TenTacGia = tbName.Text;
                authDTO.NgaySinh  = dtpDob.Value;

                //add into db
                result = authBUS.add(authDTO);
                if (result == false)
                {
                    MessageBox.Show("Thêm thất bại.");
                }
                else
                {
                    MessageBox.Show("Thêm thành công.");
                }
            }
        }
Beispiel #2
0
        //To end placeholders
        public void btnAdd_Click(object sender, EventArgs e)
        {
            bool result;

            //map data from gui
            authDTO.MaTacGia  = tbAuthCode.Text;
            authDTO.TenTacGia = tbName.Text;
            authDTO.NgaySinh  = dtpDob.Value;

            //add into db
            result = authBUS.add(authDTO);
            if (result == false)
            {
                MessageBox.Show("Thêm thất bại.");
            }
            else
            {
                MessageBox.Show("Thêm thành công.");
            }
        }