Example #1
0
        private void barButtonItemAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var form = new EditCheckForm(_repo);

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshGrid();
                form.Dispose();
                gridViewCheck.FocusedRowHandle = _items.Count - 1;
            }
        }
Example #2
0
 private void ShowEditForm()
 {
     if (gridViewCheck.GetFocusedRow() is CheckBl selected)
     {
         var form = new EditCheckForm(_repo, selected);
         if (form.ShowDialog() == DialogResult.OK)
         {
             RefreshGrid();
             form.Dispose();
         }
     }
 }
Example #3
0
        private void gridView_DoubleClick(object sender, EventArgs e)
        {
            DXMouseEventArgs ea   = e as DXMouseEventArgs;
            GridView         view = sender as GridView;
            GridHitInfo      info = view.CalcHitInfo(ea.Location);

            if (info.InRow || info.InRowCell)
            {
                RecordBl record = (RecordBl)view.GetRow(info.RowHandle);
                if (info.Column.FieldName == nameof(record.RecordDate) || info.Column.FieldName == nameof(record.UserName))
                {
                    var form = new EditRecordForm(_repo, record);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        RefreshGrid();
                        form.Dispose();
                    }
                }
                else if (info.Column.FieldName == "Check.Price")
                {
                    var check = _checkRepo.Get(record.Check.Id);
                    if (check == null)
                    {
                        check = new CheckBl()
                        {
                            RecordId = record.Id, Record = record
                        };
                    }
                    var form = new EditCheckForm(_checkRepo, check);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        RefreshGrid();
                        form.Dispose();
                    }
                }
            }
        }