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, string p_descripcion) { PredefinidaEN predefinidaEN = null; int oid; //Initialized PredefinidaEN predefinidaEN = new PredefinidaEN(); predefinidaEN.Precio = p_precio; predefinidaEN.Nombre = p_nombre; predefinidaEN.Foto = p_foto; predefinidaEN.NumVeces = p_numVeces; predefinidaEN.Tamaño = p_tamaño; predefinidaEN.Masa = p_masa; predefinidaEN.Descripcion = p_descripcion; //Call to PredefinidaCAD oid = _IPredefinidaCAD.New_(predefinidaEN); return(oid); }
// Modify default (Update all attributes of the class) public void ModifyDefault(PredefinidaEN predefinida) { try { SessionInitializeTransaction(); PredefinidaEN predefinidaEN = (PredefinidaEN)session.Load(typeof(PredefinidaEN), predefinida.Id); predefinidaEN.Descripcion = predefinida.Descripcion; session.Update(predefinidaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PredefinidaCAD.", ex); } finally { SessionClose(); } }
public PredefinidaEN ReadOIDDefault(int id ) { PredefinidaEN predefinidaEN = null; try { SessionInitializeTransaction(); predefinidaEN = (PredefinidaEN)session.Get(typeof(PredefinidaEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PredefinidaCAD.", ex); } finally { SessionClose(); } return(predefinidaEN); }
public void Destroy(int id ) { try { SessionInitializeTransaction(); PredefinidaEN predefinidaEN = (PredefinidaEN)session.Load(typeof(PredefinidaEN), id); session.Delete(predefinidaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PredefinidaCAD.", ex); } finally { SessionClose(); } }
public int New_(PredefinidaEN predefinida) { try { SessionInitializeTransaction(); session.Save(predefinida); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PredefinidaCAD.", ex); } finally { SessionClose(); } return(predefinida.Id); }
public PredefinidaEN ReadOID(int id ) { PredefinidaEN predefinidaEN = null; predefinidaEN = _IPredefinidaCAD.ReadOID(id); return(predefinidaEN); }
public Predefinida ConvertENToModelUI(PredefinidaEN en) { Predefinida pred = new Predefinida(); pred.Id = en.Id; pred.Descripcion = en.Descripcion; double precio = Convert.ToDouble(pred.precio); precio = en.Precio; pred.Nombre = en.Nombre; pred.Foto = en.Foto; pred.NumVeces = en.NumVeces; pred.tamaño = en.Tamaño; pred.masa = en.Masa; return(pred); }
public void Modify(PredefinidaEN predefinida) { try { SessionInitializeTransaction(); PredefinidaEN predefinidaEN = (PredefinidaEN)session.Load(typeof(PredefinidaEN), predefinida.Id); predefinidaEN.Precio = predefinida.Precio; predefinidaEN.Nombre = predefinida.Nombre; predefinidaEN.Foto = predefinida.Foto; predefinidaEN.NumVeces = predefinida.NumVeces; predefinidaEN.Tamaño = predefinida.Tamaño; predefinidaEN.Masa = predefinida.Masa; predefinidaEN.Descripcion = predefinida.Descripcion; session.Update(predefinidaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PracticaGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PracticaGenNHibernate.Exceptions.DataLayerException("Error in PredefinidaCAD.", ex); } finally { SessionClose(); } }
public void Modify(int p_Predefinida_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, string p_descripcion) { PredefinidaEN predefinidaEN = null; //Initialized PredefinidaEN predefinidaEN = new PredefinidaEN(); predefinidaEN.Id = p_Predefinida_OID; predefinidaEN.Precio = p_precio; predefinidaEN.Nombre = p_nombre; predefinidaEN.Foto = p_foto; predefinidaEN.NumVeces = p_numVeces; predefinidaEN.Tamaño = p_tamaño; predefinidaEN.Masa = p_masa; predefinidaEN.Descripcion = p_descripcion; //Call to PredefinidaCAD _IPredefinidaCAD.Modify(predefinidaEN); }