Esempio n. 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                Book l_Book = new Book();
                l_Book.Library = mLibrary.Ask;
                if (!mMasterBLL.isExistData("LMS_Book", l_Book, 6))
                {
                    if (MessageBox.Show(Constant.delete_successful_message, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        bindLObj();
                        if (mMasterBLL.deleteObj("LMS_Library", mLibrary, 1))
                        {
                            clearUI();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Can't delete. It is already used");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }


            //try
            //{
            //    if (MessageBox.Show(Constant.delete_successful_message, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            //    {
            //        bindLObj();
            //        if (mMasterBLL.deleteObj("LMS_Library", mLibrary, 1))
            //        {
            //            clearUI();
            //        }
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.ToString());
            //}
        }