Пример #1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DocumentDetails    docObj   = new DocumentDetails();
            ELibraryDocumentBL docBLObj = new ELibraryDocumentBL();

            try
            {
                if (cbnDocumentID.SelectedIndex == -1)
                {
                    throw new ELibraryException("Select Document ID");
                }
                docObj.DocumentID = Convert.ToInt32(cbnDocumentID.SelectedValue);
                if (docBLObj.DeleteDocumentBL(docObj))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Successfully Deleted')", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Deletion Failed')", true);
                }
                InitializeCombo();
            }
            catch (ELibraryException ex)
            {
                ErrorLogging erLog = new ErrorLogging();
                erLog.LogError(ex.Message);
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + ex.Message + "')", true);
            }
        }