Пример #1
0
        private void ExecuteDoubleClick(object obj)
        {
            if (obj.GetType().Equals(typeof(TVCustomerViewModel)))
            {
                IMessageBoxService msgbox = new MessageBoxService();
                CustomerViewModel  result = (CustomerViewModel)msgbox.OpenCustomerDlg((obj as TVCustomerViewModel).Customer.ID);
                if (result.Customer.Name != null && result.Customer.ID != -1)
                {
                    (obj as TVCustomerViewModel).Customer.Name = result.Customer.Name;
                }
            }
            else
            {
                if (obj.GetType().Equals(typeof(TVAssetViewModel)))
                {
                    if (!(obj as TVAssetViewModel).IsSelected)
                    {
                        return;
                    }

                    int ID = (obj as TVAssetViewModel).Asset.ID;
                    if (!OpenAssetWindow(ID))
                    {
                        IMessageBoxService msgbox = new MessageBoxService();
                        _ = (bool)msgbox.OpenAssetDlg(this, (TVAssetViewModel)obj);
                    }
                }
                else
                {
                    return;
                }
            }
        }
Пример #2
0
        private void ExecuteAddNewAsset(object parameter)
        {
            IMessageBoxService msg    = new MessageBoxService();
            AssetModel         result = msg.OpenAssetDlg(0, 0);

            if (result != null)
            {
                AddAssetNode(result);
            }

            msg = null;
        }
Пример #3
0
        private void ExecuteAddNewAssetCM(object parameter)
        {
            IMessageBoxService msg = new MessageBoxService();

            if (parameter.GetType().Equals(typeof(TVAssetViewModel)))
            {
                TVAssetViewModel asset  = parameter as TVAssetViewModel;
                AssetModel       result = msg.OpenAssetDlg(asset.Asset.CustomerID, asset.Asset.ID);
                if (result != null)
                {
                    AddAssetNode(result);
                }
            }
            else
            if (parameter.GetType().Equals(typeof(TVCustomerViewModel)))
            {
                TVCustomerViewModel customer = parameter as TVCustomerViewModel;
                AssetModel          result   = msg.OpenAssetDlg(customer.Customer.ID, 0);
                if (result != null)
                {
                    AddAssetNode(result);
                }
            }
        }