Example #1
0
 /**
  *  Parent Constructor
  *	@param resource parent
  *	@param resourceType resource type
  */
 public MProduct(MResource resource, MResourceType resourceType)
     : this(resource.GetCtx(), 0, resource.Get_TrxName())
 {
     SetProductType(X_M_Product.PRODUCTTYPE_Resource);
     SetResource(resource);
     SetResource(resourceType);
 }
Example #2
0
        /**
         *  Set Resource
         *	@param parent resource
         *	@return true if changed
         */
        public bool SetResource(MResource parent)
        {
            bool changed = false;

            if (!PRODUCTTYPE_Resource.Equals(GetProductType()))
            {
                SetProductType(PRODUCTTYPE_Resource);
                changed = true;
            }
            if (parent.GetS_Resource_ID() != GetS_Resource_ID())
            {
                SetS_Resource_ID(parent.GetS_Resource_ID());
                changed = true;
            }
            if (parent.IsActive() != IsActive())
            {
                SetIsActive(parent.IsActive());
                changed = true;
            }
            //
            if (!parent.GetValue().Equals(GetValue()))
            {
                SetValue(parent.GetValue());
                changed = true;
            }
            if (!parent.GetName().Equals(GetName()))
            {
                SetName(parent.GetName());
                changed = true;
            }
            if ((parent.GetDescription() == null && GetDescription() != null) ||
                (parent.GetDescription() != null && !parent.GetDescription().Equals(GetDescription())))
            {
                SetDescription(parent.GetDescription());
                changed = true;
            }
            //
            return(changed);
        }