Пример #1
0
        /// <summary>
        /// Guarda un articulo nuevo
        /// </summary>
        /// <returns></returns>
        public bool Guardar()
        {
            _Datos = new Datos.ArticuloD();
            try
            {
                DataTable _DT = _Datos.InsertarArticulo(Nombre, IVA, PrecioCompra, Porcentaje, CodigoBarra, PrecioSugerido, IdCuenta, LlevaStock, Cantidad, BloqueaPrecio, IdCategoria);
                if (_DT.Rows.Count > 0)
                {
                    Id     = Convert.ToInt32(_DT.Rows[0]["Id"].ToString());
                    Succed = true;
                    return(true);
                }
                else
                {
                    Succed = false;

                    return(false);
                }
            }
            catch (Exception EXC)
            {
                Entidades.Catcher.Catcher.Agregar_Error(this.ToString(), EXC.StackTrace);
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Guarda un articulo nuevo
        /// </summary>
        /// <returns></returns>
        public bool Guardar()
        {
            _Datos = new Datos.ArticuloD();
            try
            {
                DataTable _DT = _Datos.InsertarArticulo(Nombre, IVA, PrecioCompra, Porcentaje, CodigoBarra, PrecioSugerido, IdCuenta, LlevaStock, Cantidad, BloqueaPrecio, IdCategoria);
                if (_DT.Rows.Count > 0)
                {
                    Id = Convert.ToInt32(_DT.Rows[0]["Id"].ToString());
                    Succed = true;
                    return true;

                }
                else
                {
                    Succed = false;

                    return false;
                }

            }
            catch (Exception EXC) 
            {
                Entidades.Catcher.Catcher.Agregar_Error(this.ToString(), EXC.StackTrace);
                return false;
            }

        }