public void DeleteAccordionItem(AccordionItem accordionItemToDelete)
 {
     try
     {
         ISession currentSession = this._sessionManager.OpenSession();
         currentSession.Delete(accordionItemToDelete);
         currentSession.Flush();
     }
     catch (Exception x)
     {
         throw new Exception("Could not delete the 'AccordionItem object: " + x.Message);
     }
 }
        protected void btnSubmitItem_Click(object sender, EventArgs e)
        {
            AccordionItem i = new AccordionItem();
            i.Title = tbTitle.Text;

            int aId = Convert.ToInt32(this._Module.Section.Settings["ACCORDION_ID"]);

            Accordion a = this._Module._cuyAccordionDao.GetAccordion(aId);

            int zindex = this._Module._cuyAccordionDao.GetActiveAccordionItemsCount(a);

            i.Accordion = a;
            i.ZIndex = zindex;
            i.HTML = fckEditor.Value;

            i.Active = cbItemActive.Checked;
            i.Created = DateTime.Now;

            this._Module._cuyAccordionDao.SaveAccordionItem(i);

            lblMessages.Text = "Accordion Item " + i.Title + " added.";
            DatabindAccordionItems(Convert.ToInt32(this._Module.Section.Settings["ACCORDION_ID"]));

            //Reset inputs
            tbTitle.Text = "";
            fckEditor.Value = "";
            cbItemActive.Checked = false;
        }