Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }