public int CreateOrderLine(OrderLineEN orderLine) { try { SessionInitializeTransaction(); session.Save(orderLine); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is P2GenNHibernate.Exceptions.ModelException) { throw ex; } throw new P2GenNHibernate.Exceptions.DataLayerException("Error in OrderLineCAD.", ex); } finally { SessionClose(); } return(orderLine.Id); }
public OrderLineEN ReadOIDDefault(int id) { OrderLineEN orderLineEN = null; try { SessionInitializeTransaction(); orderLineEN = (OrderLineEN)session.Get(typeof(OrderLineEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is P2GenNHibernate.Exceptions.ModelException) { throw ex; } throw new P2GenNHibernate.Exceptions.DataLayerException("Error in OrderLineCAD.", ex); } finally { SessionClose(); } return(orderLineEN); }
public void ModifyLine(OrderLineEN orderLine) { try { SessionInitializeTransaction(); OrderLineEN orderLineEN = (OrderLineEN)session.Load(typeof(OrderLineEN), orderLine.Id); orderLineEN.Quantity = orderLine.Quantity; orderLineEN.Number = orderLine.Number; session.Update(orderLineEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is P2GenNHibernate.Exceptions.ModelException) { throw ex; } throw new P2GenNHibernate.Exceptions.DataLayerException("Error in OrderLineCAD.", ex); } finally { SessionClose(); } }
public void ModifyLine(int p_oid, int p_quantity, int p_number) { OrderLineEN orderLineEN = null; //Initialized OrderLineEN orderLineEN = new OrderLineEN(); orderLineEN.Id = p_oid; orderLineEN.Quantity = p_quantity; orderLineEN.Number = p_number; //Call to OrderLineCAD _IOrderLineCAD.ModifyLine(orderLineEN); }
public int CreateOrderLine(int p_quantity, int p_number) { OrderLineEN orderLineEN = null; int oid; //Initialized OrderLineEN orderLineEN = new OrderLineEN(); orderLineEN.Quantity = p_quantity; orderLineEN.Number = p_number; //Call to OrderLineCAD oid = _IOrderLineCAD.CreateOrderLine(orderLineEN); return(oid); }