Exemple #1
0
        private void btnTaskEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (gridViewTasks.IsEmpty)
            {
                return;
            }

            var task = gridViewTasks.GetRow(gridViewTasks.FocusedRowHandle) as Task;

            if (task != null)
            {
                System.Threading.Tasks.Task.Run(() =>
                {
                    UpdateEventLog(task.Session, task);
                }).ConfigureAwait(false);

                var form = new TaskEdit(task);
                form.ShowDialog();

                if (form.isSave)
                {
                    gridViewTasks.FocusedRowHandle = gridViewTasks.LocateByValue(nameof(Task.Oid), form.Task.Oid);
                }
            }
        }
Exemple #2
0
        private void btnTaskAdd_ItemClick(object sender, ItemClickEventArgs e)
        {
            var form = new TaskEdit(Session);

            form.ShowDialog();

            if (form.isSave)
            {
                Tasks.Reload();
                gridViewTasks.FocusedRowHandle = gridViewTasks.LocateByValue(nameof(Task.Oid), form.Task.Oid);
            }
        }
Exemple #3
0
        private void gridViewTasks_DoubleClick(object sender, EventArgs e)
        {
            DXMouseEventArgs dxMouseEventArgs = e as DXMouseEventArgs;
            GridView         gridview         = sender as GridView;
            GridHitInfo      gridHitInfo      = gridview.CalcHitInfo(dxMouseEventArgs.Location);

            if ((gridHitInfo.InRow || gridHitInfo.InRowCell) && dxMouseEventArgs.Button == MouseButtons.Left)
            {
                var task = gridViewTasks.GetRow(gridViewTasks.FocusedRowHandle) as Task;
                if (task != null)
                {
                    task.Reload();
                    var form = new TaskEdit(task);
                    form.ShowDialog();

                    if (form.isSave)
                    {
                        gridViewTasks.FocusedRowHandle = gridViewTasks.LocateByValue(nameof(Task.Oid), form.Task.Oid);
                    }
                }
            }
        }