示例#1
0
        /*
         * /// <summary>
         * /// Método que consulta las tallas para un articulo dado
         * /// Este método maneja un dataAQUARELLApter debido a que carga la información devuelta
         * /// desde la base de datos en un Dataset XSD, el cual es provisto desde el llamado.
         * /// </summary>
         * /// <param name="dtsOrders"></param>
         * /// <param name="_articulo"></param>
         * /// <param name="_company"></param>
         * /// <returns></returns>
         * public static DataSetPurchaseOrder cargarArticles_Sizes(DataSetPurchaseOrder dtsOrders, String _articulo, String _company)
         * {
         *  Database db = DatabaseFactory.CreateDatabase();
         *  object results = new object[1];
         *
         *  String sqlCommand = "SP_LOAD_SIZES_VARTICLE";
         *
         * //String sqlCommand = "SELECT asv_co, asv_article, asv_size_display, arv_name " +
         * //                          "  FROM maestros.article_sizes INNER JOIN maestros.v_articles " +
         * //                                 " ON (asv_co = arv_co AND asv_article = arv_article) " +
         * //                            " WHERE asv_article = '" + _articulo + "' AND asv_co = '" + _company + "' " +
         * //                        " ORDER BY asv_size_display";
         * //  //DbCommand dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, results);
         *
         * //  ///return db.ExecuteDataSet(dbCommandWrapper);
         * //  ///
         *
         *  DbDataAQUARELLApter custDA = db.GetDataAQUARELLApter();
         *  custDA.SelectCommand = db.GetStoredProcCommand(sqlCommand, _company, _articulo, results);//db.GetSqlStringCommand(sqlCommand);
         *  try
         *  {
         *      custDA.SelectCommand.Connection = db.CreateConnection();
         *      custDA.Fill(dtsOrders, "Articles_Sizes");
         *      //custDA.SelectCommand.Connection.Close();
         *
         *  }
         *  catch (Exception e)
         *  { }
         *  return dtsOrders;
         * }
         */

        /*
         * /// <summary>
         * /// Método que consulta las tallas para un articulo dado
         * /// Este método maneja un dataAQUARELLApter debido a que carga la información devuelta
         * /// desde la base de datos en un Dataset XSD, el cual es provisto desde el llamado.
         * /// </summary>
         * /// <param name="dtsOrders"></param>
         * /// <param name="_articulo"></param>
         * /// <param name="_company"></param>
         * /// <returns></returns>
         * public static DataSetPurchaseOrder cargarArticles_Sizes_Orders(DataSetPurchaseOrder dtsOrders, String _articulo, String _company)
         * {
         *  Database db = DatabaseFactory.CreateDatabase();
         *  object results = new object[1];
         *
         *  String sqlCommand = "MAESTROS.SP_LOAD_SIZES_VARTICLE_ORDERS";
         *  //String sqlCommand = "SELECT asv_co, asv_article, asv_size_display, arv_name " +
         *  //                        "  FROM maestros.article_sizes INNER JOIN maestros.v_articles " +
         *  //                               " ON (asv_co = arv_co AND asv_article = arv_article) " +
         *  //                          " WHERE asv_article = '" + _articulo + "' AND asv_co = '" + _company + "' " +
         *  //                      " ORDER BY asv_size_display";
         *  ////DbCommand dbCommandWrapper = db.GetStoredProcCommand(sqlCommand, results);
         *
         *  /////return db.ExecuteDataSet(dbCommandWrapper);
         *  /////
         *
         *  DbDataAQUARELLApter custDA = db.GetDataAQUARELLApter();
         *  custDA.SelectCommand = db.GetStoredProcCommand(sqlCommand, _company, _articulo, results);//db.GetSqlStringCommand(sqlCommand);
         *  try
         *  {
         *      custDA.SelectCommand.Connection = db.CreateConnection();
         *      custDA.Fill(dtsOrders, "Articles_Sizes");
         *      //custDA.SelectCommand.Connection.Close();
         *
         *  }
         *  catch (Exception e)
         *  { }
         *  return dtsOrders;
         * }
         */

        /// <summary>
        /// Metodo Estatico para la Actualización de un registro
        /// Nota: No intente agragar un nuevo registro con esta metodo esta valídado.
        /// </summary>
        /// <param name="ASV_CO"></param>
        /// <param name="ASV_ARTICLE"></param>
        /// <param name="ASV_SIZE_DISPLAY"></param>
        /// <returns> actalizo(true) o no actualizo(false)</returns>
        static public bool actualizarARTICLE_SIZES(string ASV_CO, string ASV_ARTICLE, string ASV_SIZE_DISPLAY, Decimal user, String machine)
        {
            //Intanciación de ARTICLE_SIZES
            Articles_Sizes X = new Articles_Sizes(ASV_CO, ASV_ARTICLE, ASV_SIZE_DISPLAY);

            //Validadcion de existencia de ARTICLE_SIZES
            if (Articles_Sizes.Existe(X.ASV_ARTICLE, X.ASV_CO, X.ASV_SIZE_DISPLAY))
            {
                //Update
                X.IsNew = false;
                //Guardar
                if (X.Save(user, machine))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        /// <summary>
        /// Verificacion de la existencia dela relacion especificAQUARELLA.
        /// </summary>
        /// <param name="ASV_ARTICLE"></param>
        /// <param name="ASV_CO"></param>
        /// <param name="ASV_SIZE_DISPLAY"></param>
        /// <returns></returns>
        public static bool Existe(string ASV_ARTICLE, string ASV_CO, string ASV_SIZE_DISPLAY)
        {
            Articles_Sizes X = new Articles_Sizes();

            ///
            X.Load(ASV_ARTICLE, ASV_CO, ASV_SIZE_DISPLAY);
            if (!(X.ASV_ARTICLE == string.Empty) && !(X.ASV_CO == string.Empty) && !(X.ASV_SIZE_DISPLAY == string.Empty))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }