/**
         *  After Save
         *	@param newRecord new
         *	@param success success
         *	@return success
         */
        /**
         * @Modified by Vijayamurugan D
         * */
        protected override bool AfterSave(bool newRecord, bool success)
        {
            if (!success)
            {
                return(success);
            }

            if (Convert.ToString(GetVS_CATEGORY()) == "P")
            {
                MProduct prod = GetProduct();
                if (prod == null)
                {
                    if (GetValue() == null || GetValue().Length == 0)
                    {
                        SetValue(GetName());
                    }
                    _product = new MProduct(this, GetResourceType());
                    return(_product.Save(Get_TrxName()));
                }
                else
                if (prod.SetResource(this))
                {
                    prod.Save(Get_TrxName());
                }
            }
            return(success);
        }
예제 #2
0
        /**
         *  After Save
         *	@param newRecord new
         *	@param success success
         *	@return true
         */
        protected override bool AfterSave(bool newRecord, bool success)
        {
            if (!success)
            {
                return(success);
            }

            //	Update Products
            if (!newRecord)
            {
                MProduct[] products = MProduct.Get(GetCtx(), "S_Resource_ID IN "
                                                   + "(SELECT S_Resource_ID FROM S_Resource WHERE S_ResourceType_ID="
                                                   + GetS_ResourceType_ID() + ")", Get_TrxName());
                for (int i = 0; i < products.Length; i++)
                {
                    MProduct product = products[i];
                    if (product.SetResource(this))
                    {
                        product.Save(Get_TrxName());
                    }
                }
            }

            return(success);
        }