コード例 #1
0
        private void updateOtherSiblings(PXCache sender, object row)
        {
            bool needRefresh = false;

            if (_parentAttribute == null)
            {
                return;
            }
            PXFieldState state = (PXFieldState)sender.GetStateExt(row, _FieldName);

            if (state.DataType != typeof(bool))
            {
                return;
            }
            if ((bool?)sender.GetValue(row, _FieldName) == false)
            {
                return;
            }
            foreach (object sibling in PXParentAttribute.SelectSiblings(sender, row, _parentAttribute.ParentType))
            {
                if (!sender.ObjectsEqual(sibling, row))
                {
                    if ((bool?)sender.GetValue(sibling, _FieldName) == true)
                    {
                        sender.SetValue(sibling, _FieldName, false);
                        sender.Update(sibling);
                        needRefresh = true;
                    }
                }
            }

            if (needRefresh)
            {
                foreach (var kvp in sender.Graph.Views)
                {
                    PXView view = kvp.Value;
                    if (_BqlTable.IsAssignableFrom(view.GetItemType()))
                    {
                        view.RequestRefresh();
                    }
                }
            }
        }