// Modify default (Update all attributes of the class) public void ModifyDefault(PizzaEN pizza) { try { SessionInitializeTransaction(); PizzaEN pizzaEN = (PizzaEN)session.Load(typeof(PizzaEN), pizza.Id); pizzaEN.Tamaño = pizza.Tamaño; pizzaEN.Masa = pizza.Masa; session.Update(pizzaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PizzaCAD.", ex); } finally { SessionClose(); } }
public PizzaEN ReadOIDDefault(int id ) { PizzaEN pizzaEN = null; try { SessionInitializeTransaction(); pizzaEN = (PizzaEN)session.Get(typeof(PizzaEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PizzaCAD.", ex); } finally { SessionClose(); } return(pizzaEN); }
public void Destroy(int id ) { try { SessionInitializeTransaction(); PizzaEN pizzaEN = (PizzaEN)session.Load(typeof(PizzaEN), id); session.Delete(pizzaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PizzaCAD.", ex); } finally { SessionClose(); } }
public int New_(PizzaEN pizza) { try { SessionInitializeTransaction(); session.Save(pizza); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PizzaCAD.", ex); } finally { SessionClose(); } return(pizza.Id); }
public PizzaEN ReadOID(int id ) { PizzaEN pizzaEN = null; pizzaEN = _IPizzaCAD.ReadOID(id); return(pizzaEN); }
public void Modify(int p_Pizza_OID, double p_precio, string p_nombre, string p_foto, int p_numVeces, PracticaGenNHibernate.Enumerated.Practica.TamanyoEnum p_tamaño, PracticaGenNHibernate.Enumerated.Practica.TipoMasaEnum p_masa) { PizzaEN pizzaEN = null; //Initialized PizzaEN pizzaEN = new PizzaEN(); pizzaEN.Id = p_Pizza_OID; pizzaEN.Precio = p_precio; pizzaEN.Nombre = p_nombre; pizzaEN.Foto = p_foto; pizzaEN.NumVeces = p_numVeces; pizzaEN.Tamaño = p_tamaño; pizzaEN.Masa = p_masa; //Call to PizzaCAD _IPizzaCAD.Modify(pizzaEN); }
public int New_(double p_precio, string p_nombre, string p_foto, int p_numVeces, PracticaGenNHibernate.Enumerated.Practica.TamanyoEnum p_tamaño, PracticaGenNHibernate.Enumerated.Practica.TipoMasaEnum p_masa) { PizzaEN pizzaEN = null; int oid; //Initialized PizzaEN pizzaEN = new PizzaEN(); pizzaEN.Precio = p_precio; pizzaEN.Nombre = p_nombre; pizzaEN.Foto = p_foto; pizzaEN.NumVeces = p_numVeces; pizzaEN.Tamaño = p_tamaño; pizzaEN.Masa = p_masa; //Call to PizzaCAD oid = _IPizzaCAD.New_(pizzaEN); return(oid); }