protected void btnSubmit_Click(object sender, EventArgs e) { Accordion a = new Accordion(); a.Name = tbName.Text; a.Description = tbDescription.Text; a.Created = DateTime.Now; a.Active = cbActive.Checked; a.Node = this._Module.Section.Node; this._Module._cuyAccordionDao.SaveAccordion(a); lblMessages.Text = "Accordion " + a.Name + " added."; DatabindAccordions(); tbName.Text = ""; tbDescription.Text = ""; }
public int GetActiveAccordionItemsCount(Accordion accordion) { try { string hql = "select c from Cuyahoga.Modules.CuyAccordion.Domain.AccordionItem c where c.Active = :active and c.Accordion = :accordion"; IQuery q = this._sessionManager.OpenSession().CreateQuery(hql); q.SetBoolean("active", true); q.SetEntity("accordion", accordion); return q.List().Count; } catch (Exception x) { throw new Exception("Could not get the 'AccordionItem' count: " + x.Message); } }
public IList GetAllAccordionSpecificItems(Accordion accordion) { try { string hql = "select c from Cuyahoga.Modules.CuyAccordion.Domain.AccordionItem c where c.Accordion = :accordion order by c.ZIndex"; IQuery q = this._sessionManager.OpenSession().CreateQuery(hql); q.SetEntity("accordion", accordion); return q.List(); } catch (Exception x) { throw new Exception("Could not get the 'AccordionItem' object list: " + x.Message); } }
public void DeleteAccordion(Accordion accordionToDelete) { try { ISession currentSession = this._sessionManager.OpenSession(); currentSession.Delete(accordionToDelete); currentSession.Flush(); } catch (Exception x) { throw new Exception("Could not delete the 'Accordion object: " + x.Message); } }