Example #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow current = dataGridView1.CurrentRow;

            ProductoCEN pCEN = new ProductoCEN();
            productoSeleccionado = pCEN.LeerPorOID(Convert.ToInt32(current.Cells[0].Value));
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        public void DisminuirStock(int p_Producto_OID)
        {
            /*PROTECTED REGION ID(InfoCosteProgramaGenNHibernate.CEN.InfoCoste_Producto_disminuirStock_customized) START*/

            ProductoEN productoEN = null;

            //Initialized ProductoEN
            productoEN = new ProductoEN ();
            productoEN.Id = p_Producto_OID;
            //Call to ProductoCAD

            _IProductoCAD.DisminuirStock (productoEN);

            /*PROTECTED REGION END*/
        }
        public void SetNombre(int p_Producto_OID, string p_nombre)
        {
            /*PROTECTED REGION ID(InfoCosteProgramaGenNHibernate.CEN.InfoCoste_Producto_setNombre_customized) START*/

            ProductoEN productoEN = null;

            //Initialized ProductoEN
            productoEN = new ProductoEN ();
            productoEN.Id = p_Producto_OID;
            productoEN.Nombre = p_nombre;
            //Call to ProductoCAD

            _IProductoCAD.SetNombre (productoEN);

            /*PROTECTED REGION END*/
        }
        public void SetDescription(int p_Producto_OID, string p_descripcion)
        {
            /*PROTECTED REGION ID(InfoCosteProgramaGenNHibernate.CEN.InfoCoste_Producto_setDescription_customized) START*/

            ProductoEN productoEN = null;

            //Initialized ProductoEN
            productoEN = new ProductoEN ();
            productoEN.Id = p_Producto_OID;
            productoEN.Descripcion = p_descripcion;
            //Call to ProductoCAD

            _IProductoCAD.SetDescription (productoEN);

            /*PROTECTED REGION END*/
        }
        public void SetPrecio(int p_Producto_OID, double p_precio)
        {
            /*PROTECTED REGION ID(InfoCosteProgramaGenNHibernate.CEN.InfoCoste_Producto_setPrecio_customized) START*/

            ProductoEN productoEN = null;

            //Initialized ProductoEN
            productoEN = new ProductoEN ();
            productoEN.Id = p_Producto_OID;
            productoEN.Precio = p_precio;
            //Call to ProductoCAD

            _IProductoCAD.SetPrecio (productoEN);

            /*PROTECTED REGION END*/
        }
Example #6
0
        public void DisminuirStock(ProductoEN producto)
        {
            try
            {
                SessionInitializeTransaction ();
                ProductoEN productoEN = (ProductoEN)session.Load (typeof(ProductoEN), producto.Id);
                session.Update (productoEN);
                SessionCommit ();
            }

            catch (Exception ex) {
                SessionRollBack ();
                if (ex is InfoCosteProgramaGenNHibernate.Exceptions.ModelException)
                        throw ex;
                throw new InfoCosteProgramaGenNHibernate.Exceptions.DataLayerException ("Error in ProductoCAD.", ex);
            }

            finally
            {
                SessionClose ();
            }
        }
Example #7
0
        public int Producto(int p_id, string p_nombre, string p_descripcion, double p_precio, string p_familia, int p_stock)
        {
            ProductoEN productoEN = null;
            int oid;

            //Initialized ProductoEN
            productoEN = new ProductoEN ();
            productoEN.Id = p_id;

            productoEN.Nombre = p_nombre;

            productoEN.Descripcion = p_descripcion;

            productoEN.Precio = p_precio;

            productoEN.Familia = p_familia;

            productoEN.Stock = p_stock;

            //Call to ProductoCAD

            oid = _IProductoCAD.Producto (productoEN);
            return oid;
        }
Example #8
0
 public ProductoEN(ProductoEN producto)
 {
     this.init (producto.Id, producto.Nombre, producto.Descripcion, producto.Precio, producto.Familia, producto.Stock, producto.LineaPedido, producto.LineaPedidoProveedor);
 }
Example #9
0
        public int Producto(ProductoEN producto)
        {
            try
            {
                SessionInitializeTransaction ();

                session.Save (producto);
                SessionCommit ();
            }

            catch (Exception ex) {
                SessionRollBack ();
                if (ex is InfoCosteProgramaGenNHibernate.Exceptions.ModelException)
                        throw ex;
                throw new InfoCosteProgramaGenNHibernate.Exceptions.DataLayerException ("Error in ProductoCAD.", ex);
            }

            finally
            {
                SessionClose ();
            }

            return producto.Id;
        }