public IList GetActiveLightboxSpecificImages(LightBox lightBox) { try { string hql = "select c from Cuyahoga.Modules.CuyaLightBox.Domain.LightboxImage c where c.Active = :active and c.LightBoxId = :lightBox"; IQuery q = this._sessionManager.OpenSession().CreateQuery(hql); q.SetBoolean("active", true); q.SetEntity("lightBox", lightBox); return q.List(); } catch (Exception x) { throw new Exception("Could not get the 'LightboxImage' object list: " + x.Message); } }
public void SaveLightBox(LightBox lightBoxToSave) { try { ISession currentSession = this._sessionManager.OpenSession(); currentSession.SaveOrUpdate(lightBoxToSave); currentSession.Flush(); } catch (Exception x) { throw new Exception("Could not save the 'LightBox object: " + x.Message); } }
public void DeleteLightBox(LightBox lightBoxToDelete) { try { ISession currentSession = this._sessionManager.OpenSession(); currentSession.Delete(lightBoxToDelete); currentSession.Flush(); } catch (Exception x) { throw new Exception("Could not delete the 'LightBox object: " + x.Message); } }
protected void btnLightBox_Click(object sender, EventArgs e) { LightBox l = new LightBox(); l.Name = TextBoxName.Text; l.Description = TextBoxDescription.Text; l.Created = DateTime.Now; l.Active = CheckBoxActive.Checked; l.Node = this._Module.Section.Node; this._Module._cuyaLightBoxDao.SaveLightBox(l); DatabindLightBoxes(); //Clear TextBoxes TextBoxName.Text = ""; TextBoxDescription.Text = ""; }