public int Proforma(int p_id, Nullable<DateTime> p_fecha, string p_datosPago, int p_pedidoCliente) { ProformaEN proformaEN = null; int oid; //Initialized ProformaEN proformaEN = new ProformaEN (); proformaEN.Id = p_id; proformaEN.Fecha = p_fecha; proformaEN.DatosPago = p_datosPago; if (p_pedidoCliente != -1) { proformaEN.PedidoCliente = new InfoCosteProgramaGenNHibernate.EN.InfoCoste.PedidoClienteEN (); proformaEN.PedidoCliente.Id = p_pedidoCliente; } //Call to ProformaCAD oid = _IProformaCAD.Proforma (proformaEN); return oid; }
public int Proforma(ProformaEN proforma) { try { SessionInitializeTransaction (); if (proforma.PedidoCliente != null) { proforma.PedidoCliente = (InfoCosteProgramaGenNHibernate.EN.InfoCoste.PedidoClienteEN)session.Load (typeof(InfoCosteProgramaGenNHibernate.EN.InfoCoste.PedidoClienteEN), proforma.PedidoCliente.Id); proforma.PedidoCliente.TipoFactura = proforma; } session.Save (proforma); SessionCommit (); } catch (Exception ex) { SessionRollBack (); if (ex is InfoCosteProgramaGenNHibernate.Exceptions.ModelException) throw ex; throw new InfoCosteProgramaGenNHibernate.Exceptions.DataLayerException ("Error in ProformaCAD.", ex); } finally { SessionClose (); } return proforma.Id; }
public ProformaEN(ProformaEN proforma) { this.init (proforma.Id, proforma.Fecha, proforma.DatosPago, proforma.PedidoCliente); }