Exemplo n.º 1
0
        private void BtnDeleteExcuse_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var img = sender as Image;

            if (img != null)
            {
                var row = img.DataContext as TblExcuseViewModel;
                _viewModel.DeleteExcuse(row);
            }
        }
Exemplo n.º 2
0
 private void MainGrid_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Down)
     {
     }
     else if (e.Key == Key.Delete)
     {
         if (_viewModel.selectedExcuse.Iserial != 0)
         {
             _viewModel.DeleteExcuse(_viewModel.selectedExcuse);
         }
         else
         {
             if (_viewModel.SelectedMainRow.SelectedExcuses.Count(x => x.TransDate == _viewModel.selectedExcuse.TransDate) > 1)
             {
                 _viewModel.SelectedMainRow.SelectedExcuses.Remove(_viewModel.selectedExcuse);
             }
         }
     }
 }
Exemplo n.º 3
0
        private void MainGrid_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Down)
            {
                //var currentRowIndex = (_viewModel.SelectedMainRow.SelectedExcuses.IndexOf(_viewModel.selectedExcuse));
                //if (currentRowIndex == (_viewModel.SelectedMainRow.SelectedExcuses.Count - 1))
                //{
                //    var newexe = new TblExcuseViewModel();

                //    if (_viewModel.SelectedMainRow.EmpId == LoggedUserInfo.Code)
                //    {
                //        newexe.Status = _viewModel.ExcuseStatusSelfVisibility == Visibility.Visible ? 1 : 0;
                //        newexe.ExcuseStatusVisibility = _viewModel.ExcuseStatusSelfVisibility;
                //    }
                //    else
                //    {
                //        newexe.Status = _viewModel.ExcuseStatusVisibility == Visibility.Visible ? 1 : 0;
                //        newexe.ExcuseStatusVisibility = _viewModel.ExcuseStatusVisibility;
                //    }
                //    newexe.Emplid = _viewModel.SelectedMainRow.EmpId;

                //    _viewModel.SelectedMainRow.SelectedExcuses.Add(newexe);

                //}
            }
            else if (e.Key == Key.Delete)
            {
                if (_viewModel.selectedExcuse.Iserial != 0)
                {
                    _viewModel.DeleteExcuse(_viewModel.selectedExcuse);
                }
                else
                {
                    if (_viewModel.SelectedMainRow.SelectedExcuses.Count(x => x.TransDate == _viewModel.selectedExcuse.TransDate) > 1)
                    {
                        _viewModel.SelectedMainRow.SelectedExcuses.Remove(_viewModel.selectedExcuse);
                    }
                }
            }
        }