示例#1
0
        private void barButtonItemView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PositionForm viewForm = new PositionForm();

            viewForm.currentPositionGuid = (Guid)positionGridView.GetFocusedRowCellValue("GUID");
            viewForm.edit = true;
            viewForm.view = true;
            viewForm.ShowDialog();
        }
示例#2
0
 private void barButtonItemAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (PositionForm addForm = new PositionForm())
     {
         addForm.ShowDialog();
         addForm.Dispose();
     }
     loadData();
 }
示例#3
0
 private void HistoryGridUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col)
 {
     if (e.Button == MouseButtons.Left)
     {
         var order = (MarketOrder)historyGrid.rows[rowIndex].ValueObject;
         var dlg   = new PositionForm(order);
         dlg.ShowDialog();
     }
 }
示例#4
0
 private void barButtonItemEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (PositionForm editForm = new PositionForm())
     {
         editForm.currentPositionGuid = (Guid)positionGridView.GetFocusedRowCellValue("GUID");
         editForm.edit = true;
         editForm.ShowDialog();
     }
     loadData();
 }
示例#5
0
        private void btn_position_Click(object sender, EventArgs e)
        {
            PositionForm positionForm = new PositionForm();

            positionForm.ShowDialog();
        }
示例#6
0
        private async void btnAddCandidate_Click(object sender, RoutedEventArgs e)
        {
            btnAddCandidate.Cursor = Cursors.Wait;

            var parentWindow = Window.GetWindow(this);
            var window       = parentWindow as MaintenanceWindow;

            G.WaitLang(window);

            window.Opacity = 0.5;

            _hOffset = svrCandidate.HorizontalOffset;
            var candidateForm = new CandidateForm();

            candidateForm.EditingCandidate = null;
            candidateForm.SetParty(_party);

            var helper = new WindowInteropHelper(window);

            SetWindowLong(new HandleRef(candidateForm, candidateForm.Handle), -8, helper.Handle.ToInt32());

            G.EndWait(window);

            btnAddCandidate.Cursor = Cursors.Hand;

            candidateForm.ShowDialog();
            G.WaitLang(window);

            if (candidateForm.IsLoadPosition)
            {
                G.WaitLang(window);

                var form = new PositionForm();
                form.Tag = window;

                G.EndWait(window);
                form.ShowDialog();
            }
            else if (!candidateForm.IsCanceled)
            {
                try
                {
                    stkCandidate.Children.Clear();

                    var candidateParty = await _candidateService.GetCandidateDetailsListByPartyAsync(_party.Id);

                    stkCandidate.Visibility = candidateParty.Any() ? Visibility.Visible : Visibility.Collapsed;

                    foreach (var candidate in candidateParty)
                    {
                        var candidateControl = new CandidateControl();
                        candidateControl.DataContext = candidate;
                        stkCandidate.Children.Add(candidateControl);
                    }

                    lblCount.Content = candidateParty.Count().ToString("n0");

                    if (_hOffset != -1)
                    {
                        svrCandidate.ScrollToHorizontalOffset(_hOffset);
                    }
                }
                catch (Exception ex)
                {
                    Logger.LogError(ex);

                    G.EndWait(window);

                    MessageBox.Show(ex.GetBaseException().Message, "PROGRAM ERROR: " + ex.Source, MessageBoxButton.OK, MessageBoxImage.Stop);
                }
            }

            G.EndWait(window);
            window.Opacity = 1;
        }
        public void showPositionForm(AdminDashBoard adminDashboard)
        {
            PositionForm positionForm = new PositionForm(adminDashboard);

            positionForm.ShowDialog();
        }