internal IEnumerable addItemsbyClass(PXAdapter adapter)
 {
     if (ClassInfo.AskExt() == WebDialogResult.OK)
     {
         if (ClassInfo.Current.AddItemsTypes == AddItemsTypesList.AddAllItems)
         {
             foreach (InventoryItem pxResult in PXSelect <InventoryItem, Where <InventoryItem.itemStatus, NotEqual <InventoryItemStatus.unknown> > > .Select(this))
             {
                 INItemCategory insertnode = Members.Cache.CreateInstance() as INItemCategory;
                 insertnode.InventoryID      = pxResult.InventoryID;
                 insertnode.CategorySelected = false;
                 Members.Cache.Update(insertnode);
             }
         }
         else
         {
             foreach (InventoryItem pxResult in PXSelect <InventoryItem, Where <InventoryItem.itemClassID, Equal <Required <InventoryItem.itemClassID> >, And <InventoryItem.itemStatus, NotEqual <InventoryItemStatus.unknown> > > > .Select(this, ClassInfo.Current.ItemClassID))
             {
                 INItemCategory insertnode = Members.Cache.CreateInstance() as INItemCategory;
                 insertnode.InventoryID      = pxResult.InventoryID;
                 insertnode.CategorySelected = false;
                 Members.Cache.Update(insertnode);
             }
         }
     }
     Actions.PressSave();
     return(adapter.Get());
 }
        protected virtual void INItemCategory_RowInserted(PXCache cache, PXRowInsertedEventArgs e)
        {
            INItemCategory row = e.Row as INItemCategory;

            if (row != null)
            {
                PXDefaultAttribute.SetDefault <INItemCategory.categorySelected>(cache, row, false);
            }
        }
 internal IEnumerable paste(PXAdapter adapter)
 {
     foreach (INItemCategoryBuffer pxResult in Buffer.Cache.Cached)
     {
         INItemCategory insertnode = Members.Cache.CreateInstance() as INItemCategory;
         insertnode.InventoryID = pxResult.InventoryID;
         Members.Cache.Insert(insertnode);
     }
     return(adapter.Get());
 }
예제 #4
0
        protected virtual void INItemCategory_CategoryID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
        {
            INItemCategory row = e.Row as INItemCategory;

            if (row == null)
            {
                return;
            }
            e.NewValue = this.CurrentSelected.CategoryID ?? 0;
            e.Cancel   = true;
        }