Example #1
0
        public void OnChangePosKeyCommandExecute(object obj)
        {
            PosKeyView view1 = _container.Resolve <PosKeyView>();

            //  System.Data.DataRow dataRow = ((System.Data.DataRowView)_colViewPosKeys.CurrentItem).Row;
            // view1.SetDataContext(dataRow);
            view1.SetDataContext(posKeyData.pos_key);
            int response = view1.ShowInputDialog();

            if (response > 0)
            {
            }
        }
Example #2
0
        public void OnAddPosKeyCommandExecute(object obj)
        {
            if (menuPanelsData.HasErrors)
            {
                Microsoft.Windows.Controls.MessageBox.Show("Correct erros and save changes befor createing pos keys", "Add command", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            if (menuPanelsData.HasChanges())
            {
                Microsoft.Windows.Controls.MessageBox.Show("Save changes befor createing pos keys", "Add command", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                if (_colView.CurrentItem != null)
                {
                    this.OnFilter(View.SelectedConfigNo());

                    EclipsePOS.WPF.SystemManager.Data.posKeyDataSet.pos_keyRow dataRow = posKeyData.pos_key.Newpos_keyRow();

                    System.Data.DataRow menuPanelRow = ((System.Data.DataRowView)_colView.CurrentItem).Row;

                    this.GetNextKeyCode();

                    dataRow.config_no      = int.Parse(menuPanelRow["config_no"].ToString());
                    dataRow.panel_id       = int.Parse(menuPanelRow["panel_id"].ToString());
                    dataRow.key_text       = "";
                    dataRow.key_type       = 0;
                    dataRow.key_val        = 0;
                    dataRow.key_code       = this.GetNextKeyCode();
                    dataRow.device_type    = 0;
                    dataRow.x_loc          = 0;
                    dataRow.y_loc          = 0;
                    dataRow.key_height     = 0;
                    dataRow.key_width      = 0;
                    dataRow.fg_color       = 0;
                    dataRow.bg_color       = 0;
                    dataRow.attr           = 0;
                    dataRow.flags          = "";
                    dataRow.logout_disable = 1;
                    dataRow.key_class      = "";
                    dataRow.param          = "";
                    dataRow.image          = "";

                    posKeyData.pos_key.Addpos_keyRow(dataRow);


                    PosKeyView view1 = _container.Resolve <PosKeyView>();
                    view1.SetDataContext(posKeyData.pos_key);
                    this._colViewPosKeys.MoveCurrentToLast();

                    int response = view1.ShowInputDialog();

                    if (response > 0)
                    {
                    }
                    else
                    {
                        this.OnDeletePosKeyCommandExecute(null);
                    }
                }
            }
        }