private void OnOpenPopup(string value)
        {
            PopupWindow popupWindow;

            int module;

            module = Convert.ToInt32(value);
            if (module >= 1 && module <= 6)
            {
                popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "CommonControls.NewReceiptBatch", true);
                popupWindow.Parameters.Add(module);
                Popup.Raise(popupWindow, (popupCallBack) => { if (popupWindow.ReturnValue != null) Shared.AddLoadedItem((NavigationItem)popupWindow.ReturnValue); });
            }
        }      
Example #2
0
    public void Open()
    {
        // Check if we don't have a colorpicker window already open
        if (instance == null)
        {
            // Open new colorpicker window
            instance = PopupWindow.Open(container, transform as RectTransform, windowPrefab);
            ColorPicker picker = instance.GetComponentInChildren<ColorPicker>();

            // Set picker's color to ours
            picker.CurrentColor = GetComponent<Image>().color;

            // Set method to execute when color changes
            picker.OnColorChanged.AddListener(OnColorChanged);
        }

        // bring this colorpicker window to front
        instance.transform.SetAsLastSibling();
    }
        public override void OnGUI(LocalizedTablePropertyDrawerPropertyData data, Rect position, SerializedProperty property, GUIContent label)
        {
            var dropDownPosition = EditorGUI.PrefixLabel(position, label);

            if (EditorGUI.DropdownButton(dropDownPosition, data.FieldLabel, FocusType.Passive))
            {
                var treeSelection = new TableTreeView(typeof(TCollection) == typeof(StringTableCollection) ? typeof(StringTable) : typeof(AssetTable), collection =>
                {
                    data.SelectedTableCollection = collection as TCollection;

                    // Will be called outside of OnGUI so we need to call ApplyModifiedProperties.
                    data.serializedObject.ApplyModifiedProperties();
                });

                PopupWindow.Show(dropDownPosition, new TreeViewPopupWindow(treeSelection)
                {
                    Width = dropDownPosition.width
                });
            }
        }
        private void setupStartTimeEntryOnboardingStep()
        {
            clearPreviousOnboardingSetup();

            onboardingPopupWindow = PopupWindowFactory.PopupWindowWithText(
                this,
                Resource.Layout.TooltipWithCenteredBottomArrow,
                Resource.Id.TooltipText,
                Resource.String.OnboardingAddProjectOrTag);

            var storage = ViewModel.OnboardingStorage;

            onboardingDisposable = new AddProjectOrTagOnboardingStep(storage, ViewModel.DataSource)
                                   .ManageDismissableTooltip(
                Observable.Return(true),
                onboardingPopupWindow,
                selectProjectToolbarButton,
                (popup, anchor) => popup.TopHorizontallyCenteredOffsetsTo(anchor, 8),
                storage);
        }
Example #5
0
        public void     OpenError(Rect position)
        {
            if (this.workingException == null)
            {
                this.workingException = this.exception;
            }

            this.fullError = this.workingException.ToString();

            this.size    = GUI.skin.textArea.CalcSize(new GUIContent(this.fullError));
            this.size.y += ErrorPopup.Height;

            try
            {
                PopupWindow.Show(position, this);
            }
            catch (ExitGUIException)
            {
            }
        }
Example #6
0
        public void ShowWindow(PopupWindow window, object dataContext, double parentLeftPosition, double parentTopPosition)
        {
            if (openWindows.ContainsKey(window))
            {
                CloseWindow(window);
            }
            switch (window)
            {
            case PopupWindow.AddShortcut:
                ShowAddShortcut(dataContext, parentLeftPosition, parentTopPosition);
                break;

            case PopupWindow.Settings:
                ShowSettings(dataContext, parentLeftPosition, parentTopPosition);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(window));
            }
        }
Example #7
0
        static public void ShowCommandMenu(Rect position, string currentHandlerName, Block block, int width, int height)
        {
            curBlock = block;


            if (FungusEditorPreferences.useExperimentalMenus)
            {
                var win = new CommandSelectorPopupWindowContent(currentHandlerName,
                                                                width, (int)(height - EditorGUIUtility.singleLineHeight * 3));
                PopupWindow.Show(position, win);
            }
            else
            {
                //need to ensure we have filtered data
                filteredAttributes = GetFilteredSupportedCommands(curBlock.GetFlowchart());
            }

            //old method
            DoOlderMenu();
        }
Example #8
0
        public override void OnInspectorGUI()
        {
            var e      = Event.current;
            var states = motor.States;
            //motor.DefaultState = (MovementState) EditorGUILayout.ObjectField("Default State", motor.DefaultState, typeof(State), false);
            //motor.CollisionMask = UPMEditor.LayerMaskField("Collision Mask", motor.CollisionMask);
            var notEmpty = states.Count > 0;

            EditorGUILayout.PrefixLabel((notEmpty ? states.Count.ToString() : "No") + " states found");

            if (notEmpty)
            {
                var toRemove = new List <MovementState>();
                foreach (var state in states)
                {
                    EditorGUILayout.BeginHorizontal();
                    state.name = EditorGUILayout.TextField(state.name);
                    if (GUILayout.Button("Delete"))
                    {
                        toRemove.Add(state);
                    }

                    EditorGUILayout.EndHorizontal();
                }

                foreach (var state in toRemove)
                {
                    motor.RemoveState(state);
                    DestroyImmediate(state, true);
                }
            }

            if (!GUILayout.Button("Add State"))
            {
                return;
            }

            var rect = new Rect(e.mousePosition, stateSelector.GetWindowSize());

            PopupWindow.Show(rect, stateSelector);
        }
        /// <summary>
        /// 初始化页面控件
        /// </summary>
        protected void InitViews(View view)
        {
            tv_sumAccount_dynamicTitle_currentSum  = view.FindViewById <TextView>(Resource.Id.tv_sumAccount_dynamicTitle_currentSum);
            tv_sumAccount_dynamicTitle_lastYearSum = view.FindViewById <TextView>(Resource.Id.tv_sumAccount_dynamicTitle_lastYearSum);

            tv_year     = view.FindViewById <TextView>(Resource.Id.tv_year);
            tv_district = view.FindViewById <TextView>(Resource.Id.tv_district);
            tv_grade    = view.FindViewById <TextView>(Resource.Id.tv_grade);
            tv_course   = view.FindViewById <TextView>(Resource.Id.tv_course);

            //添加按钮的事件监控
            tv_year.SetOnClickListener(this);
            tv_district.SetOnClickListener(this);
            tv_grade.SetOnClickListener(this);
            tv_course.SetOnClickListener(this);

            mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher);
            mRecyclerView       = (RecyclerView)view.FindViewById(Resource.Id.recycler_view);

            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));

            //adapter展示列表数据
            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new SumAccountAdapter(CurrActivity, sumList, this.avgGrowthRate, mRecyclerView);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            mSwipeRefreshLayout.SetOnRefreshListener(this);
            //RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);
            //mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));

            //搜索条件弹框
            popYear     = null;
            popGrade    = null;
            popCourse   = null;
            popDistrict = null;

            //初始化查询类型
            dataType = 1;
        }
Example #10
0
        public static PopupWindow PopupWindowWithText(Context context, int contentViewLayoutId, int tooltipTextViewId, string tooltipTextString)
        {
            Ensure.Argument.IsNotNull(context, nameof(context));
            Ensure.Argument.IsNotNull(tooltipTextViewId, nameof(tooltipTextViewId));
            Ensure.Argument.IsNotZero(tooltipTextViewId, nameof(tooltipTextViewId));
            Ensure.Argument.IsNotNullOrEmpty(tooltipTextString, nameof(tooltipTextString));

            var popupWindow            = new PopupWindow(context);
            var popupWindowContentView = LayoutInflater.From(context).Inflate(contentViewLayoutId, null, false);
            var tooltipTextView        = popupWindowContentView.FindViewById <TextView>(tooltipTextViewId);

            if (tooltipTextView == null)
            {
                throw new AndroidRuntimeException("The tooltipTextViewId must be present and must be a TextView");
            }

            tooltipTextView.Text    = tooltipTextString;
            popupWindow.ContentView = popupWindowContentView;
            popupWindow.SetBackgroundDrawable(null);
            return(popupWindow);
        }
Example #11
0
 public void GUITick(Action repaintAction)
 {
     Init(repaintAction);
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button("S", EditorStyles.miniButton, GUILayout.Width(20)))
     {
         PopupWindow.Show(this.buttonRect, this.TreePickerPopup);
     }
     if (!string.IsNullOrEmpty(this.selectedKey))
     {
         var oldBackgroundColor = GUI.backgroundColor;
         GUI.backgroundColor = Color.green;
         EditorGUILayout.LabelField(this.selectedKey, this.selectedItemLabelStyle);
         GUI.backgroundColor = oldBackgroundColor;
     }
     EditorGUILayout.EndHorizontal();
     if (Event.current.type == EventType.Repaint)
     {
         buttonRect = GUILayoutUtility.GetLastRect();
     }
 }
Example #12
0
        protected override void OnElementChanged(ElementChangedEventArgs <Overlay> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                this.Pop        = new PopupWindow(this.Context);
                this.Pop.Height = ViewGroup.LayoutParams.MatchParent;
                this.Pop.Width  = ViewGroup.LayoutParams.MatchParent;

                this.Frame = new AW.FrameLayout(this.Context);
                this.Frame.SetBackgroundColor(this.Element.MaskColor.ToAndroid());


                this.Pop.ContentView = this.Frame;
                this.Pop.Focusable   = true;

                this.UpdateVisible();
                this.UpdateContent();
            }
        }
Example #13
0
        // EVENTS
        public override void eventHandler(GameObject gameObject, Event currentEvent, Rect curRect)
        {
            if (currentEvent.isMouse && currentEvent.type == EventType.MouseDown && currentEvent.button == 0 && curRect.Contains(currentEvent.mousePosition))
            {
                if (currentEvent.type == EventType.MouseDown)
                {
                    Color color = QResources.getInstance().getColor(QColor.Background);
                    color.a = 0.1f;



                    try
                    {
                        PopupWindow.Show(curRect, new QColorPickerWindow(Selection.Contains(gameObject) ? Selection.gameObjects : new GameObject[] { gameObject }, colorSelectedHandler, colorRemovedHandler));
                    }
                    catch
                    {}
                }
                currentEvent.Use();
            }
        }
        private static bool EnsurePopupWindow()
        {
            if (popupWindow != null)
            {
                return(true);
            }

            var modTools = Object.FindObjectOfType <MainWindow>();

            if (modTools == null)
            {
                return(false);
            }

            if (modTools.GetComponent <PopupWindow>() == null)
            {
                popupWindow = modTools.gameObject.AddComponent <PopupWindow>();
            }

            return(popupWindow != null);
        }
Example #15
0
        private void TransitionGUI(int transitionIdx)
        {
            Transition t = transitionEd.transitions[transitionIdx];

            int toDelete = -1;

            //show conditions settings (if not hidden)
            for (int i = 0; i < t.conditions.Count; ++i)
            {
                EditorGUILayout.BeginHorizontal();

                transitionEd.foldCondition[transitionIdx].list[i] =
                    EditorGUILayout.Foldout(transitionEd.foldCondition[transitionIdx].list[i], t.conditions[i].GetType().Name);
                if (GUILayout.Button("X"))
                {
                    toDelete = i;
                }

                EditorGUILayout.EndHorizontal();

                if (transitionEd.foldCondition[transitionIdx].list[i])
                {
                    CreateEditor(t.conditions[i]).OnInspectorGUI(); //show condition inspector
                }
            }

            if (toDelete >= 0)
            {
                transitionEd.RemoveCondition(transitionIdx, toDelete);
            }

            //rect of button "Add Condition", to spawn popup window in the right place
            Rect buttonRect = GUILayoutUtility.GetLastRect();

            //show add behaviour popup
            if (GUILayout.Button("Add Condition"))
            {
                PopupWindow.Show(buttonRect, new AddConditionPopup(transitionEd, transitionIdx));
            }
        }
Example #16
0
    private void Toolbar()
    {
        GUILayout.BeginHorizontal("toolbar");

        var currentIndex = _tilesetIndex;

        _tilesetIndex = EditorGUILayout.Popup(_tilesetIndex, _tilesetNames, EditorStyles.toolbarPopup);

        if (currentIndex != _tilesetIndex)
        {
            SetTileSet(_tilesetList[_tilesetIndex].InstanceID);
            UpdateTextureList();
        }

        GUILayout.FlexibleSpace();
        EditorGUILayout.Space();

        if (GUILayout.Button("X", EditorStyles.toolbarButton))
        {
            SetBrush(-1);
        }
        EditorGUILayout.Space();

        GUILayout.Box("Filter", EditorStyles.toolbarDropDown);
        Rect last = GUILayoutUtility.GetLastRect();

        if (MyGUI.ButtonMouseDown(last))
        {
            var win = PopupWindow.ShowAtPosition <FilterPopup>(new Rect(last.x, last.y + last.height, 100f, 150f));
            win.Setup(_filter, UpdateTextureList);
            GUIUtility.ExitGUI();
        }
        else if (MyGUI.ButtonMouseDown(last, 1))
        {
            _filter.Reset();
            UpdateTextureList();
        }

        GUILayout.EndHorizontal();
    }
Example #17
0
        public void ButtomQH(FrameworkElement element, Window Owener, int Contickettime, BussinessQueueOR _CureentObj)
        {
            if (element.DataContext is QhandyOR)
            {
                var qhandy = element.DataContext as QhandyOR;
                if (!qhandy.Buttomtype)
                {
                    //连续取号限制
                    int TimeLen = GetTimeLen(LastGetTime, DateTime.Now);

                    if (TimeLen < Contickettime && Contickettime > 0)
                    {
                        ShowErrorMsg(string.Format("连续取号隔不能小于:{0}秒。", Contickettime));
                        return;
                    }
                    LastGetTime = DateTime.Now;

                    //BussinessQueueOR _CureentObj = GetBussinessByID(qhandy.LabelJobno);
                    if (_CureentObj == null)
                    {
                        ShowErrorMsg("无法获取按钮业务类型。");
                        return;
                    }
                    string mCard = string.Empty;
                    if (_CureentObj.Ticketmethod != 2)
                    {
                        CreditCardWindow ccw = null;
                        if (_CureentObj.Ticketmethod == 1)
                        {
                            ccw = new CreditCardWindow(TickModth.SK);
                        }
                        else
                        {
                            ccw = new CreditCardWindow();
                        }
                        ccw.Owner = Owener;
                        ccw.ShowDialog();
                        if (!ccw.IsOK)
                        {
                            return;
                        }
                        mCard = ccw.CardNo;
                    }

                    string mErrorMsg = string.Empty;
                    if (WebViewModel.Instance.QH(qhandy.LabelJobno, mCard, out mErrorMsg))
                    {
                        //成功不处理
                       MessageBox.Show(mErrorMsg);
                    }
                    else
                    {
                        MessageBox.Show(mErrorMsg);
                    }
                }
                else
                {
                    var pageWinOR = WebViewModel.Instance.GetPageWinById(qhandy.Windowonid);
                    PopupWindow pw = new PopupWindow(pageWinOR);
                    pw.Owner = Application.Current.MainWindow;

                    double mWidht = pageWinOR.Width < 300 ? 300 : pageWinOR.Width;
                    double mHeight = pageWinOR.Height < 300 ? 300 : pageWinOR.Height;
                    pw.Width = mWidht;
                    pw.Height = mHeight;
                    pw.Name = pageWinOR.Name;
                    pw.ShowDialog();
                }
            }
        }
        private void OnEdit()
        {
            PopupWindow popupWindow;

            if (receiptID == 0)
            {
                return;
            }

            IsBusy = true;
            if (receiptBatchType == ReceiptBatchType.Dishonour || receiptBatchType == ReceiptBatchType.Reversals)
            {
                popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.NewDishonourReversalReceipt", true);
            }
            else
            {
                popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "CommonControls.NewReceipt", true);
            }

            popupWindow.Parameters.Add(receiptBatchType);
            popupWindow.Parameters.Add(batchID);
            popupWindow.Parameters.Add(receiptBatch.BatchStatusID);
            popupWindow.Parameters.Add(receiptID);

            Popup.Raise(popupWindow, (popupCallBack) => { OnRefresh(); });
            IsBusy = false;
        }
Example #19
0
        public override void Init()
        {
            #region A LOT OF SINGLETONS
            PlayerCar playerCar = PlayerCar.Singleton;
            Player player = Player.Singleton;
            RivalCar rivalCar = RivalCar.Singleton;
            CarGarage garage = CarGarage.Singleton;
            NpcManager npcManager = NpcManager.Singleton;
            ItemManager itemManager = ItemManager.Singleton;
            Game1 game = Game1.Singleton;
            ContentManager content = game.Content;
            #endregion

            player.Reward = 0;

            game.IsMouseVisible = false;

            ScrollingBackground background = new ScrollingBackground();
            background.TexturePath = "Backgrounds\\Stage2";
            entities.Add(background);

            cashSound = content.Load<SoundEffect>("Sounds\\Cash");
            boostSound = content.Load<SoundEffect>("Sounds\\Boost");
            playerCar.CopyCat(garage.Get(player.CarName));

            entities.Add(playerCar);

            rivalCar.CopyCat(garage.Get("Rival_Normal"));
            rivalCar.AiType = 1;
            entities.Add(rivalCar);

            npcManager.MaxCount = 8;
            npcManager.Interval = 20.0f;
            itemManager.Interval = 80.0f;

            npcManager.OnAdd = new NpcManager.NpcManagerOnAddDelegate(NpcManager_OnAdd);
            npcManager.OnRemove = new NpcManager.NpcManagerOnRemoveDelegate(NpcManager_OnRemove);
            npcManager.OnCollisionCheck = new NpcCar.NpcCarOnWantsCollisionCheckDelegate(NpcManager_OnCollisionCheck);

            itemManager.OnAdd = new ItemManager.ItemManagerOnAddDelegate(ItemManager_OnAdd);
            itemManager.OnRemove = new ItemManager.ItemManagerOnRemoveDelegate(ItemManager_OnRemove);
            itemManager.OnCollisionCheck = new Item.ItemOnWantsCollisionCheckDelegate(ItemManager_OnCollisionCheck);

            Entity statusBackground = new Entity();
            statusBackground.TexturePath = "HUD\\Status";
            statusBackground.X = 580;
            entities.Add(statusBackground);

            Text newText;
            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(585, 80);
            newText.String = "Pickup:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(585, 100);
            newText.String = "$" + player.Money;
            newText.Type = "PlayerMoneyText";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(585, 130);
            newText.String = "Speed:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(585, 150);
            newText.String = 0 + "km/h";
            newText.Type = "PlayerSpeedText";
            entities.Add(newText);

            Entity minimapBackground = new Entity();
            minimapBackground.TexturePath = "HUD\\Minimap";
            minimapBackground.X = 695;
            entities.Add(minimapBackground);

            Entity minimapCar;

            minimapCar = new Entity();
            minimapCar.Type = "PlayerMiniCar";
            minimapCar.TexturePath = "HUD\\Car_Player";
            minimapCar.Position = new Vector2(704, 586);
            entities.Add(minimapCar);

            minimapCar = new Entity();
            minimapCar.Type = "RivalMiniCar";
            minimapCar.TexturePath = "HUD\\Car_Enemy";
            minimapCar.Position = new Vector2(755, 586);
            entities.Add(minimapCar);
            counter.Init();
            entities.Add(counter);

            PopupWindow exitPopup = new PopupWindow();
            exitPopup.Style = PopupStyle.YesNo;
            exitPopup.Text = "      Exit to menu?";
            exitPopup.OnResult = new PopupWindow.PopupOnResultEventDelegate(PopupWindow_OnPopupResult);
            pausedEntities.Add(exitPopup);

            base.Init();
        }
        private void OnSearch()
        {
            PopupWindow<DishonourReversalReceiptSearchBase> popupWindow;

            IsBusy = true;
            DelegateSearchFilter<DishonourReversalReceiptSearchBase> receiptSearch = new DelegateSearchFilter<DishonourReversalReceiptSearchBase>(DishonourReversalFunctions.SearchDishonourReversalReceipts);            
            popupWindow = new PopupWindow<DishonourReversalReceiptSearchBase>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<DishonourReversalReceiptSearchBase>(receiptSearch, "Search Receipt", (int)batchType, BankAccountID), true);

            Popup.Raise(popupWindow, (popupCallBack) =>
            {
                if (popupCallBack.ReturnValue != null)
                {
                    DishonourReversalReceiptSearchBase receipt = (DishonourReversalReceiptSearchBase)popupCallBack.ReturnValue;                    
                    OriginalReceiptID = receipt.ReceiptID;
                }
            });

            IsBusy = false;
        }
Example #21
0
			private void ColorCombo_Click( object sender, EventArgs e ) {
				if( !this.Checked )
					return;

				//create a popup window
				popupWnd = new PopupWindow( colors );

				//calculate its position in screen coordinates
				Rectangle rect = Bounds;
				rect = this.Parent.RectangleToScreen( rect );
				Point pt = new System.Drawing.Point( rect.Left, rect.Bottom );

				//tell it that we want the ColorChanged event
				popupWnd.ColorChanged += new ColorChangedHandler( OnColorChanged );

				//show the popup
				popupWnd.Show( pt );
				//disable the button so that the user can't click it
				//while the popup is being displayed
				this.Enabled = false;
			}
        private void MoveStatusForward()
        {
            PopupWindow popupWindow;
            int newStatus = (int)batchStatus;

            try
            {
                if (selectedReceiptBatch.BatchTypeID != (int)ReceiptBatchType.DirectDebit && selectedReceiptBatch.BatchTypeID != (int)ReceiptBatchType.CreditCard)
                {
                    LockUniqueIdentifier = selectedReceiptBatch.BatchID.ToString();
                    Lock();
                }

                if (IsLocked || selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.DirectDebit || selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.CreditCard)
                {
                    if (batchStatus == ReceiptBatchStatus.Created)
                    {
                        if (selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.DirectDebit)
                        {
                            IsBusy = true;
                            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DDCC.DDCCStatusChange", true);
                            popupWindow.Parameters.Add(ReceiptBatchType.DirectDebit);
                            Popup.Raise(popupWindow);
                            ReceiptBatchSummaries = BatchTypeFunctions.GetReceiptBatchSummary(batchStatus);
                            IsBusy = false;
                            return;
                        }
                        else if (selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.CreditCard)
                        {
                            IsBusy = true;
                            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DDCC.DDCCStatusChange", true);
                            popupWindow.Parameters.Add(ReceiptBatchType.CreditCard);
                            Popup.Raise(popupWindow);
                            ReceiptBatchSummaries = BatchTypeFunctions.GetReceiptBatchSummary(batchStatus);
                            IsBusy = false;
                            return;
                        }
                        else
                        {
                            if (selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.Dishonour || selectedReceiptBatch.BatchTypeID == (int)ReceiptBatchType.Reversals)
                            {
                                if (BatchTypeFunctions.GetReceiptBatchSystemDefaults(selectedReceiptBatch.BatchTypeID).EnforceReasonCode.GetValueOrDefault()
                                    && DishonourReversalFunctions.IsReceiptExistsWithoutReasonCode(selectedReceiptBatch.BatchTypeID, selectedReceiptBatch.BatchID))
                                {
                                    ShowMessage(selectedReceiptBatch.BatchType + " Reason must be Entered for all Receipts before moving the Batch to Pending", selectedReceiptBatch.BatchType + " Reason - Validation");
                                    return;
                                }
                            }

                            newStatus = (int)ReceiptBatchStatus.Pending;
                            ReceiptBatchFunctions.UpdateStatus(selectedReceiptBatch.BatchID, newStatus, ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId);

                            if (Shared.MoveNavigationItem(new NavigationItem { BatchStatus = (int)batchStatus, BatchMonth = selectedReceiptBatch.BatchMonth, ReceiptID = selectedReceiptBatch.BatchID }, newStatus, true))
                            {
                                GoBack();
                                UnLock();
                                return;
                            }

                            ReceiptBatchSummaries = BatchTypeFunctions.GetReceiptBatchSummary(batchStatus);
                        }
                    }
                    else if (batchStatus == ReceiptBatchStatus.Pending)
                    {
                        newStatus = (int)ReceiptBatchStatus.Posted;

                        ReceiptBatchFunctions.UpdateStatus(selectedReceiptBatch.BatchID, newStatus, ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId);

                        if (Shared.MoveNavigationItem(new NavigationItem { BatchStatus = (int)batchStatus, BatchMonth = selectedReceiptBatch.BatchMonth, ReceiptID = selectedReceiptBatch.BatchID }, newStatus, true))
                        {
                            GoBack();
                            UnLock();
                            return;
                        }

                        ReceiptBatchSummaries = BatchTypeFunctions.GetReceiptBatchSummary(batchStatus);
                    }

                    UnLock();
                }
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error encountered while moving Receipt Batch", "Receipt Batch - Error");
            }
            finally
            {
                IsBusy = false;
            }
        }
        private void OnImportExcel()
        {
            PopupWindow popupWindow;

            IsBusy = true;
            if (receiptBatchType == ReceiptBatchType.CashCheque)
            {
                popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "CashCheque.CashReceiptExcelImport", true);
                popupWindow.Parameters.Add(receiptBatch.ID);
                Popup.Raise(popupWindow);
                OnRefresh();
            }
            else if (receiptBatchType == ReceiptBatchType.Dishonour || receiptBatchType == ReceiptBatchType.Reversals)
            {
                popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.DishonourReversalReceiptExcelImport", true);
                popupWindow.Parameters.Add(receiptBatchType);
                popupWindow.Parameters.Add(receiptBatch.ID);
                Popup.Raise(popupWindow);
                OnRefresh();
            }
            IsBusy = false;
        }
        private void SaveReceiptBatch()
        {
            PopupWindow popupWindow;
            AccountingParam accountingParam;
            ReceiptBatch newReceiptBatch;
            Receipt receipt = null;
            List<OpenItemReceiptAllocation> receiptAllocations = null;
            List<businessModel.DirectDebitException> DDExceptions = null;
            List<businessModel.CreditCardException> CCExceptions = null;
            IEnumerable<int> openItemIDs = null;
            OpenItemReceiptAllocation newAllocation;

            try
            {
                int contractID = 0;
                isChanged = true;
                bool isNew;

                accountingParam = SystemFunctions.GetAccountingParam();
                isNew = receiptBatch.ID == 0;

                receiptBatch.BatchStatusID = (int)ReceiptBatchStatus.Created;

                if (accountingParam.CurrentAccountingDate.HasValue)
                {
                    receiptBatch.AccountingDate = accountingParam.CurrentAccountingDate;
                    receiptBatch.BatchMonth = accountingParam.CurrentAccountingDate.Value.ToString("MMM yyyy");
                }
                else
                {
                    receiptBatch.AccountingDate = receiptBatch.ReceiptDate;
                    receiptBatch.BatchMonth = receiptBatch.ReceiptDate.ToString("MMM yyyy");
                }

                receiptBatch.CreatedByUserID = ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId;

                if (receiptBatchType == ReceiptBatchType.CashCheque)
                {
                    ReceiptBatchFunctions.Save(receiptBatch);

                    if (isNew && createFromList.Where(from => from.ID == createFrom).FirstOrDefault().Description.ToLower().Trim() == ReceiptBatchCreateFrom.Import.ToString().ToLower().Trim())
                    {
                        ReturnValue = new NavigationItem() { ReceiptID = receiptBatch.ID, ReceiptText = receiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = receiptBatch.BatchTypeID };

                        IsBusy = true;
                        popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "CashCheque.CashReceiptExcelImport", true);
                        popupWindow.Parameters.Add(receiptBatch.ID);
                        Popup.Raise(popupWindow);
                        receiptBatch = ReceiptBatchFunctions.Get(receiptBatch.ID);
                        IsBusy = false;
                    }
                    else
                    {
                        ReturnValue = new NavigationItem() { ReceiptID = receiptBatch.ID, ReceiptText = receiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = receiptBatch.BatchTypeID };
                        Close();
                    }
                }
                else if (receiptBatchType == ReceiptBatchType.DirectDebit || receiptBatchType == ReceiptBatchType.CreditCard || receiptBatchType == ReceiptBatchType.AutoReceipts)
                {
                    if (IsDateRangeApplicable)
                    {
                        receiptAllocations = DDCCBatchFunctions.GetDDCCOpenItemsReceiptAllocation(receiptBatchType, fromDate, toDate, IsIntercompanySelected, selectedinternalCompanyBanks);

                        openItemIDs = receiptAllocations.Select(item => item.OpenItemID).Distinct();

                        if (receiptBatchType == ReceiptBatchType.DirectDebit)
                        {
                            DDExceptions = DDCCBatchFunctions.GetDDExceptions(fromDate, toDate, IsIntercompanySelected,
                                ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId, selectedinternalCompanyBanks);
                        }
                        else if (receiptBatchType == ReceiptBatchType.CreditCard)
                        {
                            CCExceptions = DDCCBatchFunctions.GetCCExceptions(fromDate, toDate, IsIntercompanySelected, ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId, selectedinternalCompanyBanks);
                        }
                    }

                    if (receiptBatchType == ReceiptBatchType.AutoReceipts)
                    {
                        newReceiptBatch = receiptBatch.Copy();

                        if (IsDateRangeApplicable)
                        {
                            newReceiptBatch.DateRangeFilterDescription = "From " + fromDate.ToString("dd/MM/yyyy") + " to " + toDate.ToString("dd/MM/yyyy");
                            newReceiptBatch.Receipts = new List<Receipt>();

                            foreach (OpenItemReceiptAllocation allocation in receiptAllocations.OrderBy(item => item.OpenItem.ContractID))
                            {
                                if (contractID != allocation.OpenItem.Contract.ContractId)
                                {
                                    receipt = new Receipt();
                                    receipt.ApplyToTypeID = (int)ReceiptApplyTo.Contract;
                                    receipt.ContractID = allocation.OpenItem.Contract.ContractId;
                                    receipt.InternalReference = receipt.ContractID.ToString();
                                    receipt.LastUserID = ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId;
                                    receipt.LastDateModified = DateTime.Now;
                                    receipt.ReceiptDate = receiptBatch.ReceiptDate;

                                    receipt.GSTAmountReceived = 0;
                                    receipt.SDAmountReceived = 0;
                                    receipt.FIDAmountReceived = 0;
                                    receipt.NetAmountReceived = 0;
                                    receipt.GrossAmountReceived = 0;

                                    receipt.OpenItemReceiptAllocations = new List<OpenItemReceiptAllocation>();
                                    newReceiptBatch.Receipts.Add(receipt);
                                    newReceiptBatch.NumberOfEntries += 1;
                                    contractID = allocation.OpenItem.Contract.ContractId;
                                }

                                receipt.GSTAmountReceived += allocation.GSTAmountApplied.GetValueOrDefault();
                                receipt.SDAmountReceived += allocation.SDAmountApplied.GetValueOrDefault();
                                receipt.FIDAmountReceived += allocation.FIDAmountApplied.GetValueOrDefault();
                                receipt.NetAmountReceived += allocation.NetAmountApplied;
                                receipt.GrossAmountReceived += allocation.GrossAmountApplied.GetValueOrDefault();
                                newReceiptBatch.GrossBatchTotal += allocation.GrossAmountApplied.GetValueOrDefault();
                                allocation.OpenItem.Contract = null;
                                allocation.OpenItem = null;

                                receipt.OpenItemReceiptAllocations.Add(allocation);
                            }
                        }

                        ReceiptBatchFunctions.Save(newReceiptBatch, openItemIDs, fromDate, toDate);
                        ReturnValue = new NavigationItem() { ReceiptID = newReceiptBatch.ID, ReceiptText = newReceiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = newReceiptBatch.BatchTypeID };
                    }
                    else
                    {
                        foreach (InternalCompanyBank internalCompBank in selectedinternalCompanyBanks)
                        {
                            newReceiptBatch = receiptBatch.Copy();
                            newReceiptBatch.BankAccountID = internalCompBank.BankID;
                            newReceiptBatch.InternalCompanyNodeID = internalCompBank.NodeID;

                            if (isBankSelected)
                            {
                                newReceiptBatch.FilterDescription = "Bank: " + internalCompBank.BankName;
                            }
                            else if (IsIntercompanySelected)
                            {
                                newReceiptBatch.FilterDescription = "Internal Company: " + internalCompBank.InternalCompany;
                            }

                            if (IsDateRangeApplicable)
                            {
                                newReceiptBatch.DateRangeFilterDescription = "From " + fromDate.ToString("dd/MM/yyyy") + " to " + toDate.ToString("dd/MM/yyyy");
                                newReceiptBatch.Receipts = new List<Receipt>();

                                foreach (OpenItemReceiptAllocation allocation in receiptAllocations.Where(item => IsIntercompanySelected ? item.OpenItem.Contract.InternalCoyNodeId == internalCompBank.NodeID :
                                        item.OpenItem.Contract.LessorBankAccountId == internalCompBank.BankID))
                                {
                                    if (contractID != allocation.OpenItem.Contract.ContractId)
                                    {
                                        receipt = new Receipt();
                                        receipt.ApplyToTypeID = (int)ReceiptApplyTo.Contract;
                                        receipt.ContractID = allocation.OpenItem.Contract.ContractId;
                                        receipt.InternalReference = receipt.ContractID.ToString();
                                        receipt.LastUserID = ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId;
                                        receipt.LastDateModified = DateTime.Now;
                                        receipt.ReceiptDate = receiptBatch.ReceiptDate;

                                        receipt.GSTAmountReceived = 0;
                                        receipt.SDAmountReceived = 0;
                                        receipt.FIDAmountReceived = 0;
                                        receipt.NetAmountReceived = 0;
                                        receipt.GrossAmountReceived = 0;

                                        if (receiptBatchType == ReceiptBatchType.DirectDebit)
                                        {
                                            receipt.DirectDebitReceiptDetails = new List<DirectDebitReceiptDetail>();
                                            receipt.DirectDebitReceiptDetails.Add(new DirectDebitReceiptDetail { LesseeBankAccountID = allocation.OpenItem.Contract.LesseeBankAccountId.GetValueOrDefault() });
                                        }
                                        else if (receiptBatchType == ReceiptBatchType.CreditCard)
                                        {
                                            receipt.CreditCardReceiptDetails = new List<CreditCardReceiptDetail>();
                                            receipt.CreditCardReceiptDetails.Add(new CreditCardReceiptDetail { LesseeBankAccountID = allocation.OpenItem.Contract.LesseeBankAccountId.GetValueOrDefault() });
                                        }

                                        receipt.OpenItemReceiptAllocations = new List<OpenItemReceiptAllocation>();
                                        newReceiptBatch.Receipts.Add(receipt);
                                        newReceiptBatch.NumberOfEntries += 1;
                                        contractID = allocation.OpenItem.Contract.ContractId;
                                    }

                                    receipt.GSTAmountReceived += allocation.GSTAmountApplied.GetValueOrDefault();
                                    receipt.SDAmountReceived += allocation.SDAmountApplied.GetValueOrDefault();
                                    receipt.FIDAmountReceived += allocation.FIDAmountApplied.GetValueOrDefault();
                                    receipt.NetAmountReceived += allocation.NetAmountApplied;
                                    receipt.GrossAmountReceived += allocation.GrossAmountApplied.GetValueOrDefault();
                                    newReceiptBatch.GrossBatchTotal += allocation.GrossAmountApplied.GetValueOrDefault();
                                    allocation.OpenItem.Contract = null;
                                    allocation.OpenItem = null;

                                    receipt.OpenItemReceiptAllocations.Add(allocation);
                                }

                                if (receiptBatchType == ReceiptBatchType.DirectDebit)
                                {
                                    newReceiptBatch.DirectDebitExceptions = DDExceptions.Where(item => (IsIntercompanySelected ? item.InternalCoyNodeId == internalCompBank.NodeID :
                                        (item.LessorBankAccountID == internalCompBank.BankID || item.LessorBankAccountID == null || item.LessorBankAccountID == -1))).
                                        Select(item => new model.DirectDebitException { AccountNumber = item.AccountNumber, AccountTitle = item.AccountTitle, BSBNumber = item.BSBNumber,
                                            CompanyName = item.CompanyName, ContractID = item.ContractID, CustomerName = item.CustomerName, DateCreated = item.DateCreated, Exception = item.Exception,
                                            GrossAmount = item.GrossAmount, ID = item.ID, LesseeBankAccountID = item.LesseeBankAccountID, LessorAccountNumber = item.LessorAccountNumber, LessorAccountTitle = item.LessorAccountTitle,
                                            LessorBankAccountID = item.LessorBankAccountID, LessorBSBNumber = item.LessorBSBNumber, PaymentDate = item.PaymentDate,  ReceiptBatchID = item.ReceiptBatchID, 
                                            UpdateRequired = item.UpdateRequired, UserID = item.UserID }).ToList();
                                }
                                else if (receiptBatchType == ReceiptBatchType.CreditCard)
                                {
                                    newReceiptBatch.CreditCardExceptions = CCExceptions.Where(item => (IsIntercompanySelected ? item.InternalCoyNodeId == internalCompBank.NodeID :
                                            (item.LessorBankAccountID == internalCompBank.BankID || item.LessorBankAccountID == null || item.LessorBankAccountID == -1))).Select(item => 
                                                new model.CreditCardException { AccountTitle = item.AccountTitle, CardNumber = item.CardNumber, CompanyName = item.CompanyName, CDTFMerchantNumber = item.CDTFMerchantNumber, 
                                                    ContractID = item.ContractID, CustomerName = item.CustomerName, DateCreated = item.DateCreated, Exception = item.Exception, ExpiryDate = item.ExpiryDate,
                                                    GrossAmount = item.GrossAmount, ID = item.ID, LesseeBankAccountID = item.LesseeBankAccountID, LessorAccountTitle = item.LessorAccountTitle, LessorBankAccountID = item.LessorBankAccountID,
                                                    MerchantNumber = item.MerchantNumber, PaymentDate = item.PaymentDate, ReceiptBatchID = item.ReceiptBatchID, UserID = item.UserID }).ToList();
                                }
                            }

                            ReceiptBatchFunctions.Save(newReceiptBatch, openItemIDs, fromDate, toDate);

                            ReturnValue = new NavigationItem() { ReceiptID = newReceiptBatch.ID, ReceiptText = newReceiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = newReceiptBatch.BatchTypeID };
                        }
                    }

                    Close();
                }
                else if (receiptBatchType == ReceiptBatchType.Dishonour || receiptBatchType == ReceiptBatchType.Reversals)
                {
                    if (selectedReceipts != null)
                    {
                        var banksList = selectedReceipts.Select(item => ((DishonourReversalReceiptSearch)item).BankAccountID).Distinct().ToList();

                        foreach (int bankID in banksList)
                        {
                            newReceiptBatch = receiptBatch.Copy();
                            newReceiptBatch.BankAccountID = bankID;
                            newReceiptBatch.FilterDescription = "Bank: " + ((DishonourReversalReceiptSearch)selectedReceipts.Where(item => ((DishonourReversalReceiptSearch)item).BankAccountID == bankID).FirstOrDefault()).BankName;
                            newReceiptBatch.Receipts.Clear();

                            foreach (DishonourReversalReceiptSearch selectedReceipt in selectedReceipts.Where(item => ((DishonourReversalReceiptSearch)item).BankAccountID == bankID))
                            {
                                receipt = new Receipt();

                                if (selectedReceipt.ContractNo != null)
                                {
                                    receipt.ApplyToTypeID = (int)ReceiptApplyTo.Contract;
                                    receipt.InternalReference = selectedReceipt.ContractNo.ToString();
                                }
                                else
                                {
                                    receipt.ApplyToTypeID = (int)ReceiptApplyTo.Quote;
                                    receipt.InternalReference = selectedReceipt.QuoteID.ToString();
                                }
                                receipt.ContractID = selectedReceipt.ContractNo;
                                receipt.QuoteID = selectedReceipt.QuoteID;

                                if (receiptBatchType == ReceiptBatchType.Dishonour)
                                {
                                    receipt.Reference = "Dishonour";
                                }
                                else
                                {
                                    receipt.Reference = "Reversal";
                                }

                                receipt.LastUserID = ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId;
                                receipt.LastDateModified = DateTime.Now;
                                receipt.ReceiptDate = receiptBatch.ReceiptDate;

                                receipt.NetAmountReceived = selectedReceipt.NetAmountReceived.GetValueOrDefault() * -1;
                                receipt.GSTAmountReceived = selectedReceipt.GSTAmountReceived.GetValueOrDefault() * -1;
                                receipt.FIDAmountReceived = selectedReceipt.FIDAmountReceived.GetValueOrDefault() * -1;
                                receipt.SDAmountReceived = selectedReceipt.SDAmountReceived.GetValueOrDefault() * -1;
                                receipt.GrossAmountReceived = selectedReceipt.AmountReceived * -1;

                                if (receiptBatchType == ReceiptBatchType.Dishonour)
                                {
                                    receipt.DishonourReceiptDetail = new DishonourReceiptDetail { DishonouredReceiptID = selectedReceipt.ReceiptID };
                                }
                                else
                                {
                                    receipt.ReversalReceiptDetail = new ReversalReceiptDetail { LinkedReceiptID = selectedReceipt.ReceiptID, ReversalTypeID = (int)ReversalTypes.Reversal };
                                }

                                foreach (OpenItemReceiptAllocation allocation in DishonourReversalFunctions.GetOpenItemReceiptAllocations(selectedReceipt.ReceiptID))
                                {
                                    newAllocation = new OpenItemReceiptAllocation();

                                    newAllocation.OpenItemID = allocation.OpenItemID;
                                    newAllocation.NetAmountApplied = allocation.NetAmountApplied * -1;
                                    newAllocation.GSTAmountApplied = allocation.GSTAmountApplied * -1;
                                    newAllocation.FIDAmountApplied = allocation.FIDAmountApplied * -1;
                                    newAllocation.SDAmountApplied = allocation.SDAmountApplied * -1;
                                    newAllocation.GrossAmountApplied = allocation.GrossAmountApplied * -1;
                                    receipt.OpenItemReceiptAllocations.Add(newAllocation);
                                }

                                newReceiptBatch.Receipts.Add(receipt);
                                newReceiptBatch.GrossBatchTotal += receipt.GrossAmountReceived;
                                newReceiptBatch.NumberOfEntries++;
                            }

                            ReceiptBatchFunctions.Save(newReceiptBatch);
                            ReturnValue = new NavigationItem() { ReceiptID = newReceiptBatch.ID, ReceiptText = newReceiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = newReceiptBatch.BatchTypeID };
                        }

                        Close();
                    }
                    else
                    {
                        ReceiptBatchFunctions.Save(receiptBatch);

                        if (isNew && createFromList.Where(from => from.ID == createFrom).FirstOrDefault().Description.ToLower().Trim() == ReceiptBatchCreateFrom.Import.ToString().ToLower().Trim())
                        {
                            ReturnValue = new NavigationItem() { ReceiptID = receiptBatch.ID, ReceiptText = receiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = receiptBatch.BatchTypeID };

                            IsBusy = true;
                            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.DishonourReversalReceiptExcelImport", true);
                            popupWindow.Parameters.Add(receiptBatchType);
                            popupWindow.Parameters.Add(receiptBatch.ID);
                            Popup.Raise(popupWindow);
                            receiptBatch = ReceiptBatchFunctions.Get(receiptBatch.ID);
                            IsBusy = false;
                        }
                        else
                        {
                            ReturnValue = new NavigationItem() { ReceiptID = receiptBatch.ID, ReceiptText = receiptBatch.ID.ToString() + "-" + SelectedBatch, BatchStatus = (int)ReceiptBatchStatus.Created, BatchTypeID = receiptBatch.BatchTypeID };
                            Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error encountered while Creating New Batch.", "Create Batch - Error");
            }
            finally
            {
                IsBusy = false;                     
            }
        }
        private void Search()
        {
            IsBusy = true;
            switch (SelectFrom)
            {
                case (int)ReceiptBatchSelectList.Contract:
                    PopupWindow<ContractReceiptSearch> contractPopup;
                    DelegateSearchFilter<ContractReceiptSearch> contractSearch;

                    contractSearch = new DelegateSearchFilter<ContractReceiptSearch>(receipts.ContractFunctions.SearchContractReceipt);
                    contractPopup = new PopupWindow<ContractReceiptSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ContractReceiptSearch>(contractSearch, "Search Contract", batchType), true);

                    Popup.Raise(contractPopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            ContractReceiptSearch contract = (ContractReceiptSearch)popupCallBack.ReturnValue;                            
                            SelectFromObjectID = contract.ContractID;                           
                        }

                        popupCallBack = null;
                    });
                    break;
                case (int)ReceiptBatchSelectList.Quote:
                    PopupWindow<QuoteReceiptSearch> quotePopup;
                    DelegateSearchFilter<QuoteReceiptSearch> quoteSearch;

                    quoteSearch = new DelegateSearchFilter<QuoteReceiptSearch>(receipts.QuoteFunctions.SearchQuoteReceipt);
                    quotePopup = new PopupWindow<QuoteReceiptSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<QuoteReceiptSearch>(quoteSearch, "Search Quote", batchType), true);

                    Popup.Raise(quotePopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            QuoteReceiptSearch quote = (QuoteReceiptSearch)popupCallBack.ReturnValue;                            
                            SelectFromObjectID = quote.QuoteNo;
                        }

                        popupCallBack = null;
                    });
                    break;
                case (int)ReceiptBatchSelectList.Client:
                    PopupWindow<ClientReceiptSearch> clientPopup;
                    DelegateSearchFilter<ClientReceiptSearch> clientSearch;

                    clientSearch = new DelegateSearchFilter<ClientReceiptSearch>(receipts.ClientFunctions.SearchClientReceipt);
                    clientPopup = new PopupWindow<ClientReceiptSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ClientReceiptSearch>(clientSearch, "Search Client", batchType), true);

                    Popup.Raise(clientPopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            ClientReceiptSearch client = (ClientReceiptSearch)popupCallBack.ReturnValue;                            
                            SelectFromObjectID = client.ClientNo;
                        }

                        popupCallBack = null;
                    });
                    break;
                case (int)ReceiptBatchSelectList.Batch:
                    PopupWindow<BatchReceiptSearch> batchPopup;
                    DelegateSearchFilter<BatchReceiptSearch> batchSearch;

                    batchSearch = new DelegateSearchFilter<BatchReceiptSearch>(ReceiptBatchFunctions.SearchBatchReceipt);
                    batchPopup = new PopupWindow<BatchReceiptSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<BatchReceiptSearch>(batchSearch, "Search Receipt Batch", batchType), true);

                    Popup.Raise(batchPopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            BatchReceiptSearch batch = (BatchReceiptSearch)popupCallBack.ReturnValue;                            
                            SelectFromObjectID = batch.BatchNo;
                        }

                        popupCallBack = null;
                    });
                    break;
            }

            IsBusy = false;
        }
Example #26
0
        private void ShowPopup(Control eip)
        {
            PopupWindow pe=new PopupWindow(eip);

            Point pt=caret.Location;
            pt.Offset(OffsetX, OffsetY);
            pt.Y+=caret.Height;
            pt.X=Math.Min(pt.X, VisibleRectangle.Width-pe.Width);
            pt.Y=Math.Min(pt.Y, VisibleRectangle.Height-pe.Height);
            pe.StartPosition=FormStartPosition.Manual;
            pt=PointToScreen(pt);
            pe.Location=pt;

            pe.Show();
        }
Example #27
0
        public void Notification(Pixbuf image, string stripUrl, string name, string author)
        {
            Application.Invoke (delegate {
                PopupWindow window = new PopupWindow ();
                window.PopupDelay = popupDelay;

                window.Notification (image, stripUrl, name, author);
            });
        }
        private void OnReAllocationSearch()
        {
            IsBusy = true;
            if (reallocateTo == (int)ReAllocateReceiptTo.Contract)
            {
                PopupWindow<ContractSearch> contractPopup;
                DelegateSearch<ContractSearch> contractSearch = new DelegateSearch<ContractSearch>(ContractFunctions.Search);
                contractPopup = new PopupWindow<ContractSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ContractSearch>(contractSearch, "Search Contract"), true);

                Popup.Raise(contractPopup, (popupCallBack) =>
                {
                    if (popupCallBack.ReturnValue != null)
                    {
                        ContractSearch contract = (ContractSearch)popupCallBack.ReturnValue;
                        ReAllocateToObjectID = contract.ContractID;
                    }

                    popupCallBack = null;
                });
            }
            else if (reallocateTo == (int)ReAllocateReceiptTo.Quote)
            {
                PopupWindow<QuoteSearch> quotePopup;
                DelegateSearch<QuoteSearch> quoteSearch = new DelegateSearch<QuoteSearch>(business.QuoteFunctions.Search);
                quotePopup = new PopupWindow<QuoteSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<QuoteSearch>(quoteSearch, "Search Invoice"), true);

                Popup.Raise(quotePopup, (popupCallBack) =>
                {
                    if (popupCallBack.ReturnValue != null)
                    {
                        QuoteSearch quote = (QuoteSearch)popupCallBack.ReturnValue;
                        ReAllocateToObjectID = quote.QuoteNo;
                    }
                });
            }
            IsBusy = false;
        }       
		public PopupWindowEventArgs(PopupWindow window)
		{
			this.window = window;
		}
        private void OnSearch()
        {
            IsBusy = true;
            switch (receiptApplyTo)
            {
                case ReceiptApplyTo.Client:
                    PopupWindow<ClientSearch> clientPopup;
                    DelegateSearch<ClientSearch> clientSearch = new DelegateSearch<ClientSearch>(business.ClientFunctions.Search);
                    clientPopup = new PopupWindow<ClientSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ClientSearch>(clientSearch, "Search Client"), true);

                    Popup.Raise(clientPopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            ClientSearch client = (ClientSearch)popupCallBack.ReturnValue;                        
                            ApplyToObjectID = client.ClientNo;
                            ClientName = client.LegalName;
                            RaisePropertyChanged("ApplyToObjectID");
                        }
                    });
                    break;
                case ReceiptApplyTo.Contract:
                    PopupWindow<ContractSearch> contractPopup;
                    DelegateSearch<ContractSearch> contractSearch;
                    DelegateSearchFilter<ContractSearch> ddccContractSearch;
                    object[] filter;

                    if (batchType == ReceiptBatchType.DirectDebit || batchType == ReceiptBatchType.CreditCard || batchType == ReceiptBatchType.AutoReceipts)
                    {
                        if (batchType == ReceiptBatchType.DirectDebit)
                        {
                            filter = new object[] { (int)SCPaymentTypes.DirectDebit, (int)SCPaymentTypes.DirectDebit50 };
                        }
                        else if (batchType == ReceiptBatchType.CreditCard)
                        {
                            filter = new object[] { (int)SCPaymentTypes.CreditCard };
                        }
                        else
                        {
                            filter = new object[] { (int)SCPaymentTypes.AutoReceipt };
                        }

                        ddccContractSearch = new DelegateSearchFilter<ContractSearch>(DDCCBatchFunctions.ContractSearch);
                        contractPopup = new PopupWindow<ContractSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ContractSearch>(ddccContractSearch, "Search Contract", filter), true);
                    }
                    else
                    {
                        contractSearch = new DelegateSearch<ContractSearch>(ContractFunctions.Search);
                        contractPopup = new PopupWindow<ContractSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<ContractSearch>(contractSearch, "Search Contract"), true);
                    }

                    Popup.Raise(contractPopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            ContractSearch contract = (ContractSearch)popupCallBack.ReturnValue;                            
                            ApplyToObjectID = contract.ContractID;
                            ClientName = contract.ClientName;
                            RaisePropertyChanged("ApplyToObjectID");
                        }

                        popupCallBack = null;
                    });
                    break;

                case ReceiptApplyTo.Invoice:
                    PopupWindow<InvoiceSearch> invoicePopup;
                    DelegateSearch<InvoiceSearch> invoiceSearch = new DelegateSearch<InvoiceSearch>(business.InvoiceFunctions.Search);
                    invoicePopup = new PopupWindow<InvoiceSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<InvoiceSearch>(invoiceSearch, "Search Invoice"), true);

                    Popup.Raise(invoicePopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            InvoiceSearch invoice = (InvoiceSearch)popupCallBack.ReturnValue;                            
                            ApplyToObjectID = invoice.InvoiceNo;
                            ClientName = invoice.CustomerName;
                            RaisePropertyChanged("ApplyToObjectID");
                        }
                    });
                    break;
                case ReceiptApplyTo.Quote:
                    PopupWindow<QuoteSearch> quotePopup;
                    DelegateSearch<QuoteSearch> quoteSearch = new DelegateSearch<QuoteSearch>(business.QuoteFunctions.Search);
                    quotePopup = new PopupWindow<QuoteSearch>(ViewAssemblies.ViewCommonAssembly, "Controls.Search", new SearchViewModel<QuoteSearch>(quoteSearch, "Search Quote"), true);

                    Popup.Raise(quotePopup, (popupCallBack) =>
                    {
                        if (popupCallBack.ReturnValue != null)
                        {
                            QuoteSearch quote = (QuoteSearch)popupCallBack.ReturnValue;
                            
                            ApplyToObjectID = quote.QuoteNo;
                            ClientName = quote.ClientName;
                            RaisePropertyChanged("ApplyToObjectID");
                        }

                    });
                    break;
            }
            IsBusy = false;
        }
Example #31
0
 public PopupTaskBar()
 {
     System.Drawing.Rectangle rect = new System.Drawing.Rectangle();
     rect = System.Windows.Forms.Screen.GetWorkingArea(rect);
     if (Position == TaskbarNotifierPosition.LeftCorner)
     {
         horizontalOffset = 0;
         verticalOffset = rect.Height - this.Height;
     }
     else if (Position == TaskbarNotifierPosition.LeftTop)
     {
         horizontalOffset = 0;
         verticalOffset = 0;
     }
     else if (Position == TaskbarNotifierPosition.RightCorner)
     {
         horizontalOffset = rect.Width - this.Width;
         verticalOffset = rect.Height - this.Height;
     }
     else if (Position == TaskbarNotifierPosition.RightTop)
     {
         horizontalOffset = rect.Width - this.Width;
         verticalOffset = 0;
     }
     popup = new PopupWindow(this);
     popup.HorizontalOffset = horizontalOffset;
     popup.VerticalOffset = verticalOffset;
 }
Example #32
0
        public override void Init()
        {
            Player player = Player.Singleton;
            CarGarage garage = CarGarage.Singleton;
            NpcManager npcManager = NpcManager.Singleton;
            Game1 game = Game1.Singleton;
            ContentManager content = game.Content;

            Song themeSong = content.Load<Song>("Sounds\\Shop_Theme");
            MediaPlayer.Volume = 0.25f;
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(themeSong);

            Entity background = new Entity();
            background.TexturePath = "Backgrounds\\Shop";
            entities.Add(background);

            Entity statusBackground = new Entity();
            statusBackground.Position = new Vector2(665, 50);
            statusBackground.TexturePath = "UI\\Status";
            entities.Add(statusBackground);

            playerCar.CopyCat(garage.Get(player.CarName));
            playerCar.Position = new Vector2(700, 70);
            entities.Add(playerCar);

            Text newText;
            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 170);
            newText.String = "Money:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 190);
            newText.String = "$" + player.Money;
            newText.Type = "PlayerMoneyText";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 210);
            newText.String = "Debt:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 230);
            newText.String = "$" + player.Debt;
            newText.Type = "PlayerDebt";
            entities.Add(newText);

            Entity whiteArea;
            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(75, 50);
            entities.Add(whiteArea);

            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(275, 50);
            entities.Add(whiteArea);

            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(475, 50);
            entities.Add(whiteArea);

            Button newButton;
            newButton = new Button();
            newButton.TexturePath = "UI\\Shop_Red";
            newButton.Link = "Red";
            newButton.OnClick += new Button.ButtonEventDelegate(buyButton_OnClick);
            newButton.Position = new Vector2(65, 50);
            entities.Add(newButton);

            Entity newIntroduce;
            newIntroduce = new Entity();
            newIntroduce.TexturePath = "UI\\Introduce1";
            newIntroduce.Position = new Vector2(65, 180);
            entities.Add(newIntroduce);

            newButton = new Button();
            newButton.TexturePath = "UI\\Shop_Yellow";
            newButton.Link = "Yellow";
            newButton.OnClick += new Button.ButtonEventDelegate(buyButton_OnClick);
            newButton.Position = new Vector2(265, 50);
            entities.Add(newButton);

            newIntroduce = new Entity();
            newIntroduce.TexturePath = "UI\\Introduce2";
            newIntroduce.Position = new Vector2(265, 180);
            entities.Add(newIntroduce);

            newButton = new Button();
            newButton.TexturePath = "UI\\Shop_Green";
            newButton.Link = "Green";
            newButton.OnClick += new Button.ButtonEventDelegate(buyButton_OnClick);
            newButton.Position = new Vector2(465, 50);
            entities.Add(newButton);

            newIntroduce = new Entity();
            newIntroduce.TexturePath = "UI\\Introduce3";
            newIntroduce.Position = new Vector2(465, 180);
            entities.Add(newIntroduce);

            Car displayCar;

            displayCar = new Car();
            displayCar.CopyCat(garage.Get("Red"));
            displayCar.Position = new Vector2(115, 100);
            entities.Add(displayCar);

            displayCar = new Car();
            displayCar.CopyCat(garage.Get("Yellow"));
            displayCar.Position = new Vector2(315, 100);
            entities.Add(displayCar);

            displayCar = new Car();
            displayCar.CopyCat(garage.Get("Green"));
            displayCar.Position = new Vector2(515, 100);
            entities.Add(displayCar);

            Entity locker;

            locker = new Entity();
            locker.TexturePath = "UI\\Locker";
            locker.Type = "YellowLocker";
            locker.Position = new Vector2(365, 50);
            entities.Add(locker);

            locker = new Entity();
            locker.TexturePath = "UI\\Locker";
            locker.Type = "GreenLocker";
            locker.Position = new Vector2(565, 50);
            entities.Add(locker);

            newButton = new Button();
            newButton.TexturePath = "UI\\Exit";
            newButton.Link = "Menu";
            newButton.Position = new Vector2(675, 550);
            newButton.OnClick += new Button.ButtonEventDelegate(ExitButton_OnClick);
            entities.Add(newButton);

            PopupWindow exitPopup = new PopupWindow();
            exitPopup.Style = PopupStyle.Ok;
            exitPopup.Text = " Not enough money!";
            exitPopup.OnResult = new PopupWindow.PopupOnResultEventDelegate(PopupWindow_OnPopupResult);
            pausedEntities.Add(exitPopup);
            base.Init();
        }
Example #33
0
            private void ColorCombo_Click(object sender, EventArgs e)
            {
                //if it is already down, don't do anything.
                //this shouldn't happen anymore since we
                //started to disable the button when the
                //drop down is being displayed
                if (!this.Checked)
                {
                    return;
                }

                //create a popup window
                popupWnd = new PopupWindow(colors);

                //calculate its position in screen coordinates
                Rectangle rect = Bounds;
                rect = this.Parent.RectangleToScreen(rect);
                Point pt = new System.Drawing.Point(rect.Left, rect.Bottom);

                //tell it that we want the ColorChanged event
                popupWnd.ColorChanged += new ColorChangedHandler(OnColorChanged);

                //show the popup
                popupWnd.Show(pt);
                //disable the button so that the user can't click it
                //while the popup is being displayed
                this.Enabled = false;
            }
Example #34
0
 public static void ShowInformation(string message)
 {
     popup = new PopupWindow();
     popup.ShowMessage("Информация", message);
 }
        private void OnResetAllocation()
        {
            PopupWindow popupWindow;

            IsBusy = true;
            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.ReversalReceiptReallocation", true);
            popupWindow.Parameters.Add(this);
            popupWindow.Parameters.Add(reAllocationReceiptID.GetValueOrDefault());

            Popup.Raise(popupWindow, popupCallBack =>
            {
                if (popupCallBack.ReturnValue != null)
                {
                    ReturnValue = (Tuple<int, int?, string>)popupCallBack.ReturnValue;
                    RaisePropertyChanged("IsSaveEnabled");
                }
            });

            IsBusy = false;
        }             
Example #36
0
 public static void ShowWarning(string warning)
 {
     popup = new PopupWindow();
     popup.ShowMessage("Предупреждение", warning);
 }
        public void OnAddMultiple()
        {
            PopupWindow popupWindow;

            IsBusy = true;
            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.AddReceipts", true);
            popupWindow.Parameters.Add((int)receiptBatchType);
            popupWindow.Parameters.Add(batchID);
            Popup.Raise(popupWindow, (popupCallBack) => { OnRefresh(); });
            IsBusy = false;
        }
Example #38
0
 public static void ShowError(string error)
 {
     popup = new PopupWindow();
     popup.ShowMessage("Ошибка", error);
 }
        private void OnStatusForward()
        {
            PopupWindow popupWindow;
            ReceiptBatchStatus batchStatus, newStatus;

            try
            {
                batchStatus = ((ReceiptBatchStatus)receiptBatch.BatchStatusID);

                if (batchStatus == ReceiptBatchStatus.Created)
                {
                    if (receiptBatchType == ReceiptBatchType.DirectDebit || receiptBatchType == ReceiptBatchType.CreditCard)
                    {
                        popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DDCC.DDCCStatusChange", true);
                        popupWindow.Parameters.Add(receiptBatchType);
                        IsBusy = true;
                        Popup.Raise(popupWindow);
                        OnBack();
                        IsBusy = false;
                    }
                    else
                    {
                        if (receiptBatchType == ReceiptBatchType.Dishonour || receiptBatchType == ReceiptBatchType.Reversals)
                        {
                            if (BatchTypeFunctions.GetReceiptBatchSystemDefaults((int)receiptBatchType).EnforceReasonCode.GetValueOrDefault() && DishonourReversalFunctions.IsReceiptExistsWithoutReasonCode((int)receiptBatchType, receiptBatch.ID))
                            {
                                ShowMessage(receiptBatchType.ToString() + " Reason must be Entered for all Receipts before moving the Batch to Pending", receiptBatchType.ToString() + " Reason - Validation");
                                return;
                            }
                        }

                        newStatus = ReceiptBatchStatus.Pending;
                        receiptBatch.BatchStatusID = (int)newStatus;

                        ReceiptBatchFunctions.UpdateStatus(receiptBatch.ID, (int)newStatus, ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId);

                        Shared.MoveNavigationItem(new NavigationItem { BatchStatus = (int)batchStatus, BatchMonth = receiptBatch.BatchMonth, ReceiptID = receiptBatch.ID }, receiptBatch.BatchStatusID);
                        receiptBatch.BatchStatusID = (int)batchStatus;
                        OnBack();
                    }
                }
                else
                {
                    newStatus = ReceiptBatchStatus.Posted;
                    receiptBatch.PostedDate = DateTime.Today;
                    receiptBatch.BatchMonth = SystemFunctions.GetAccountingParam().StartDate.ToString("MMM yyyy");

                    receiptBatch.BatchStatusID = (int)newStatus;

                    ReceiptBatchFunctions.UpdateStatus(receiptBatch.ID, (int)newStatus, ((OperationsPrincipal)Thread.CurrentPrincipal).Identity.User.UserEntityId);

                    Shared.MoveNavigationItem(new NavigationItem { BatchStatus = (int)batchStatus, BatchMonth = receiptBatch.BatchMonth, ReceiptID = receiptBatch.ID }, receiptBatch.BatchStatusID);
                    receiptBatch.BatchStatusID = (int)batchStatus;
                    OnBack();
                }

                UnLock();
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error encountered while moving Receipt Batch", "Receipt Batch - Error");
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #40
0
 public CommandPopupDalay(PopupWindow.PopupControll popup)
     : base(".dalay","set/get popup window delay")
 {
     this.popup = popup;
 }
        private void OnAssign()
        {
            List<DishonourReversalReceiptSummary> reversalReceipts;
            List<int> receiptIDs;
            PopupWindow popupWindow;

            IsBusy = true;

            try
            {
                if (selectedDishonourReversalOption != (int)DishonourReceiptOptions.AssignReason)
                {
                    if (selectedDishonourReversalOption == (int)DishonourReceiptOptions.CreateCharge)
                    {
                        receiptIDs = selectedDishonourReversalReceipts.Where(item => ((DishonourReversalReceiptSummary)item).Reason != "None"
                            && ((DishonourReversalReceiptSummary)item).ApplyToType == ReceiptApplyTo.Contract.ToString()).Select(item => ((DishonourReversalReceiptSummary)item).ID).ToList();
                    }
                    else
                    {
                        receiptIDs = selectedDishonourReversalReceipts.Where(item => ((DishonourReversalReceiptSummary)item).Reason != "None").Select(item => ((DishonourReversalReceiptSummary)item).ID).ToList();
                    }
                }
                else
                {
                    receiptIDs = selectedDishonourReversalReceipts.Select(item => ((DishonourReversalReceiptSummary)item).ID).ToList();
                }

                if (receiptBatchType == ReceiptBatchType.Dishonour)
                {
                    DishonourReversalFunctions.UpdateDishonourReceiptOption(receiptIDs, SelectedDishonourReversalOption, reasonSelected, reasonCodes.Where(reason => reason.ID == reasonSelected).FirstOrDefault().Description == "None");
                }
                else if (receiptBatchType == ReceiptBatchType.Reversals)
                {
                    reversalReceipts = new List<DishonourReversalReceiptSummary>();

                    if (DishonourReversalFunctions.GetRequiresReallocation(reasonSelected))
                    {
                        foreach (DishonourReversalReceiptSummary receipt in selectedDishonourReversalReceipts)
                        {
                            if (receipt.ReversalTypeID == (int)ReversalTypes.Reversal && dishonourReversalReceipts.Where(item => item.ReversalTypeID == (int)ReversalTypes.Reallocation && item.LinkedReceiptID == receipt.ID).Count() == 0)
                            {
                                reversalReceipts.Add(receipt);
                            }
                        }
                    }

                    if (reversalReceipts.Count > 0)
                    {
                        IsBusy = true;
                        popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "DishonourReversal.MultipleReversalReAllocation", true);
                        popupWindow.Parameters.Add(batchID);
                        popupWindow.Parameters.Add(reasonSelected);
                        popupWindow.Parameters.Add(reversalReceipts);
                        Popup.Raise(popupWindow);

                        if ((bool)popupWindow.ReturnValue)
                        {
                            DishonourReversalFunctions.UpdateReversalReceiptOption(receiptIDs, SelectedDishonourReversalOption, reasonSelected);
                            OnRefresh();
                        }

                        IsBusy = false;
                        return;
                    }
                    else
                    {
                        DishonourReversalFunctions.UpdateReversalReceiptOption(receiptIDs, SelectedDishonourReversalOption, reasonSelected);
                    }
                }

                OnRefresh();
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error encountered during Receipt(s) assignment", "Receipt - Error");
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #42
0
 private PopupWindow SettingsApply(PopupWindow popup)
 {
     popup.Delay = this.Delay;
     return popup;
 }
        private void OnOtherCharge()
        {
            PopupWindow popupWindow;

            IsBusy = true;
            popupWindow = new PopupWindow(ViewAssemblies.ReceiptsViewAssembly, "CommonControls.AddOtherCharge", true);
            popupWindow.Parameters.Add(applyToObjectID.Value);
            Popup.Raise(popupWindow, (popupCallBack) => { if (popupCallBack.ReturnValue != null && Convert.ToBoolean(popupCallBack.ReturnValue) == true) SearchOpenItems(true); });
            IsBusy = false;
        }
Example #44
0
 private void openPopup( )
 {
     if (opened) throw new InvalidOperationException("Assertion failed.");
     Window popup = new PopupWindow(Items, SelectedItemIndex ?? 0, shadow,
         ShownItemsCount != null ? ShownItemsCount.Value - 1 : ( int? ) null);
     Point popupCoord = TranslatePoint(this, new Point(0, 0),
         VisualTreeHelper.FindClosestParent<WindowsHost>( this ));
     popup.X = popupCoord.X;
     popup.Y = popupCoord.Y;
     popup.Width = shadow ? ActualWidth+1 : ActualWidth;
     if (Items.Count != 0)
         popup.Height = (ShownItemsCount != null ? ShownItemsCount.Value : Items.Count)
             + (shadow ? 2 : 1); // 1 row for transparent "header"
     else popup.Height = shadow ? 3 : 2;
     WindowsHost windowsHost = VisualTreeHelper.FindClosestParent< WindowsHost >( this );
     windowsHost.ShowModal(popup, true);
     opened = true;
     EventManager.AddHandler(popup, Window.ClosedEvent, new EventHandler(OnPopupClosed));
 }