コード例 #1
0
ファイル: OsGrid.xaml.cs プロジェクト: Osama91/CCWFM
        protected override void OnRowEditEnded(DataGridRowEditEndedEventArgs e)
        {
            _validationFilterBehaviorApplied  = false;
            _validationFilterBehaviorRestored = false;

            base.OnRowEditEnded(e);
        }
        private void dg_facture_Copy_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            List <CsDetailLot> datasource = ListFactureInitiale.Where(d => d.STATUT == true) != null?ListFactureInitiale.Where(d => d.STATUT == true).ToList() : new List <CsDetailLot>();

            LoadDataPager <CsDetailLot>(datasource, datapager_Copy, dg_facture_Copy);

            txt_TotalFactureEnvoie.Text = datasource.Sum(c => (c.MONTANT_AJUSTEMENT != null ? c.MONTANT_AJUSTEMENT : 0)).Value.ToString(SessionObject.FormatMontant);
        }
コード例 #3
0
        void dataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            DataGrid dataGrid = sender as DataGrid;

            Assert.IsNotNull(dataGrid);
            this._rowEditEndedEventArgs = e;
            this._eventCount++;
        }
コード例 #4
0
ファイル: ColorLink.xaml.cs プロジェクト: Osama91/CCWFM
 private void MainGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     _viewModel.UpdatedPantonRows = new ObservableCollection <TblColor>();
     foreach (var row in MainGrid.SelectedItems)
     {
         _viewModel.UpdatedPantonRows.Add((TblColor)row);
     }
     _viewModel.UpdateColorLinkPanton();
 }
コード例 #5
0
        private void ExerciseLogGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            // Submit any exercise log changes and refresh the DataGrid

            if (context.HasChanges)
            {
                context.SubmitChanges();
            }
        }
コード例 #6
0
        private void MeasurementLogGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            // Submit any measurement log changes and refresh the DataGrid

            if (context.HasChanges)
            {
                context.SubmitChanges();
            }
        }
コード例 #7
0
ファイル: MainPage.xaml.cs プロジェクト: semata-com/Expenses
 private void ActivityDataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     if (e.EditAction == DataGridEditAction.Cancel &&
         ((ActivityView)e.Row.DataContext).IsNew)
     {
         mainView.EditableActivityItems.Remove((ActivityView)e.Row.DataContext);
     }
     ActivityDataGridInEdit = false;
     EnableDisable();
 }
コード例 #8
0
        private void FoodLogGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            // Submit any food log changes and refresh the DataGrid

            if (context.HasChanges)
            {
                ProgressBar.Visibility = Visibility.Visible;
                context.SubmitChanges((ChangesSubmitted) => { ProgressBar.Visibility = Visibility.Collapsed; }, null);
            }
        }
コード例 #9
0
        private void OnRowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            if (NodeContext == null)
            {
                return;
            }
            if (e.EditAction == DataGridEditAction.Commit)
            {
                var property = e.Row.DataContext as UIMetadata;

                if (property != null)
                {
                    if (string.IsNullOrEmpty(property.Name.Trim()))
                    {
                        return;
                    }
                    else
                    {
                        if (property.OriginalName == property.Name || !property.IsInserted)
                        {
                            NodeContext.Updates.Add(new UpdateMetadataDetail
                            {
                                Type     = UpdateMetadataType.AddOrUpdateValue,
                                NewKey   = property.Name,
                                NewValue = property.Value
                            });

                            property.OriginalName = property.Name;

                            if (!property.IsInserted)
                            {
                                property.IsInserted = true;
                            }
                        }
                        else
                        {
                            NodeContext.Updates.Add(new UpdateMetadataDetail
                            {
                                Type     = UpdateMetadataType.UpdateKey,
                                Key      = property.OriginalName,
                                NewKey   = property.Name,
                                NewValue = property.Value
                            });
                        }
                    }

                    if (_source.AugmentedCollection.All(q => q.IsInserted))
                    {
                        _source.NewLine();
                        NodeMetadataDataGrid.ItemsSource = null;
                        NodeMetadataDataGrid.ItemsSource = _source;
                    }
                }
            }
        }
コード例 #10
0
ファイル: MainPage.xaml.cs プロジェクト: semata-com/Expenses
 private void ExpenseDataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     if (e.EditAction == DataGridEditAction.Cancel &&
         ((ExpenseView)e.Row.DataContext).IsNew)
     {
         var activityView = (ActivityView)ActivityDataGrid.SelectedItem;
         activityView.ExpensesIncurred.Remove((ExpenseView)ExpenseDataGrid.SelectedItem);
     }
     ExpenseDataGridInEdit = false;
     EnableDisable();
 }
        /// <summary>
        /// This event handler handles the RowEdited event of the DataGrid control
        /// It updates the edited Grade via an async REST call to ADO.NET Data Service.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mainDataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            ScoreCardForSchoolLinqToEntities s = e.Row.DataContext as ScoreCardForSchoolLinqToEntities;

            if (s != null)
            {
                CourseGrade recordforupdate = s.CourseGrade;
                _entities.UpdateObject(recordforupdate);
                _entities.BeginSaveChanges(SaveChangesOptions.ReplaceOnUpdate,
                                           OnChangesSaved, _entities);
            }
        }
コード例 #12
0
ファイル: EmployeeShift.xaml.cs プロジェクト: Osama91/CCWFM
 private void AttendanceFileGrid_OnRowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     if (_viewModel.CustomePermissions.SingleOrDefault(x => x.Code == "DisableManualAttendance") != null)
     {
         _viewModel.SelectedAttRule.FromTime = null;
         _viewModel.SelectedAttRule.ToTime   = null;
         MessageBox.Show("You don't have permission to edit ");
     }
     else
     {
         _viewModel.SaveRow(EmployeeShiftViewModel.AttSaveTypes.AttFile);
     }
 }
コード例 #13
0
        private void DetailGrid_OnRowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            var viewModel = (GeneratePurchaseViewModel)DataContext;

            if (_temp == 1)
            {
                viewModel.SaveDetailRow();
            }
            else
            {
                viewModel.SaveDetail2Row();
            }
        }
コード例 #14
0
        void lvwResultat_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            try
            {
                //aTa u = e.Row.DataContext as aTa; //fetch the row data

                //if (majData.Count > 0 && majData != null)
                //{
                //    if (majData.First(p => p.CENTRE == u.CENTRE && p.ROWID == u.ROWID && u.CODE == p.CODE) != null)
                //    {
                //        foreach (aTa t in majData)
                //        {
                //            if (t.CODE == u.CODE && t.ROWID == u.ROWID)
                //            {
                //                t.CENTRE = u.CENTRE;
                //                t.CODE = u.CODE;
                //                t.LIBELLE = u.LIBELLE;
                //                t.NUM = u.NUM;
                //                t.DMAJ = DateTime.Now;
                //            }
                //        }
                //    }
                //    else
                //        majData.Add(u);
                //}
                //else
                //{
                //    majData.Add(u);
                //}
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }


            //try
            //{
            //    e.Row.Background = new SolidColorBrush(Colors.Green);
            //}
            //catch (Exception ex)
            //{
            //    string error = ex.Message;
            //}

            //aCampagne u = e.Row.DataContext as aCampagne; //fetch the row data
            //dataTableDatagrid[e.Row.GetIndex()].IndexE = u.IndexE;
            //dataTableDatagrid[e.Row.GetIndex()].IndexO = u.IndexO;
            //dataTableDatagrid[e.Row.GetIndex()].DateCoupure = u.DateCoupure;
            //btnOk.IsEnabled = true;
        }
コード例 #15
0
        private void DataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            if (e.EditAction != DataGridEditAction.Commit)
            {
                return;
            }
            var persistent = e.Row.DataContext as Base;

            if (persistent == null)
            {
                return;
            }
            persistent.Save(); // Saving Item to Storage
            Storage.Commit();  // Commiting changes
        }
コード例 #16
0
        private void dgrDescontosServicos_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            AdministracaoContext  administracaoContext    = new AdministracaoContext();
            ConvenioPlanoSaudeSet convenioSelecionado     = (ConvenioPlanoSaudeSet)convenioPlanoSaudeSetDataGrid.SelectedItem;
            DescontoServico       descontoServicoAlterado = (DescontoServico)((DataGrid)sender).SelectedItem;

            LoadOperation <ConvenioServicoSet> loadOp = administracaoContext.Load <ConvenioServicoSet>(administracaoContext.GetConvenioServicoSet_IdQuery(descontoServicoAlterado.Id));

            loadOp.Completed += (s3, e3) =>
            {
                ConvenioServicoSet descontoServico = administracaoContext.ConvenioServicoSets.Where <ConvenioServicoSet>(desc => desc.id == descontoServicoAlterado.Id).Single <ConvenioServicoSet>();
                descontoServico.porcentagem_desconto = descontoServicoAlterado.Desconto;
                administracaoContext.SubmitChanges();
            };
        }
コード例 #17
0
        private void dataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            ProdottoContext context = ddsProdotti.DomainContext as ProdottoContext;

            if (context.HasChanges)
            {
                try
                {
                    context.SubmitChanges();
                }
                catch (Exception ex)
                {
                    ErrorWindow.CreateNew(ex);
                }
            }
        }
コード例 #18
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Controls.DataGrid.RowEditEnded"/> event.
        /// </summary>
        /// <param name="e">The event data.</param>
        protected override void OnRowEditEnded(DataGridRowEditEndedEventArgs e)
        {
            base.OnRowEditEnded(e);

            if (e.EditAction == DataGridEditAction.Commit)
            {
                Graphic relatedGraphic = DataSourceCreator.GetGraphicSibling(e.Row.DataContext);
                if (relatedGraphic != null)
                {
                    try
                    {
                        e.Row.RefreshGraphic(relatedGraphic, objectType);
                    }
                    catch { }
                }
            }
        }
コード例 #19
0
        void dgINIT_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            CsInit u = e.Row.DataContext as CsInit; //fetch the row data

            u.DMAJ = DateTime.Now;
            donnesDatagrid[e.Row.GetIndex()].CONTENU = u.CONTENU;
            btnOk.IsEnabled  = true;
            btnOk.Visibility = System.Windows.Visibility.Visible;

            try
            {
                if (majData.Count > 0 && majData != null)
                {
                    if (majData.First(p => p.ROWID == u.ROWID) != null)
                    {
                        foreach (CsInit t in majData)
                        {
                            if (t.ROWID == u.ROWID)
                            {
                                t.CENTRE  = u.CENTRE;
                                t.CONTENU = u.CONTENU;
                                t.LIBELLE = u.LIBELLE;
                                t.PRODUIT = u.PRODUIT;
                                t.OBLIG   = u.OBLIG;
                                t.DMAJ    = DateTime.Now;
                            }
                        }
                    }
                    else
                    {
                        majData.Add(u);
                    }
                }
                else
                {
                    majData.Add(u);
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
コード例 #20
0
        void dgINIT_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            CsRegrou u = e.Row.DataContext as CsRegrou; //fetch the row data

            u.DMAJ = DateTime.Now;
            donnesDatagrid[e.Row.GetIndex()]       = u;
            donnesDatagrid[e.Row.GetIndex()].ROWID = u.ROWID;

            btnOk.IsEnabled  = true;
            btnOk.Visibility = System.Windows.Visibility.Visible;

            try
            {
                if (majData.Count > 0 && majData != null)
                {
                    if (majData.First(p => p.ROWID == u.ROWID) != null)
                    {
                        foreach (CsRegrou t in majData)
                        {
                            if (t.ROWID == u.ROWID)
                            {
                                t.CENTRE = u.CENTRE;
                                t.REGROU = u.REGROU;
                                t.DMAJ   = DateTime.Now;
                                t.NOM    = u.NOM;
                            }
                        }
                    }
                    else
                    {
                        majData.Add(u);
                    }
                }
                else
                {
                    majData.Add(u);
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
コード例 #21
0
ファイル: RFQPage.xaml.cs プロジェクト: Osama91/CCWFM
        private void DataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            if (e.EditAction != DataGridEditAction.Commit)
            {
                return;
            }
            var dataGrid = sender as DataGrid;

            if (dataGrid == null)
            {
                return;
            }
            var rfqFollowUpViewModel = dataGrid.SelectedItem as ViewModel.RFQViewModels.RFQFollowUpViewModel;

            if (rfqFollowUpViewModel == null || (!rfqFollowUpViewModel.IsRejected))
            {
                return;
            }
            e.Row.Background = new SolidColorBrush(Colors.Red);
            e.Row.Foreground = new SolidColorBrush(Colors.Red);
        }
コード例 #22
0
    void OnEditEnded(object sender, DataGridRowEditEndedEventArgs e)
    {
        if (_changingEditingState)
        {
            return;
        }
        EditingState editingState;

        if (e.EditAction == DataGridEditAction.Commit)
        {
            editingState = EditingState.LastCommitted;
        }
        else if (e.EditAction == DataGridEditAction.Cancel)
        {
            editingState = EditingState.LastCancelled;
        }
        else
        {
            return;                     // if DataGridEditAction will ever be extended, this part must be changed
        }
        EditingStateBinding.EditingState = editingState;
    }
コード例 #23
0
 private void DetailGrid_OnRowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     if (_viewModel != null)
     {
         _viewModel.SaveMarkupRow();
     }
     else if (_viewModel2 != null)
     {
         _viewModel2.SaveMarkupRow();
     }
     else if (_viewModel3 != null)
     {
         _viewModel3.SaveMarkupRow();
     }
     else if (_viewModel4 != null)
     {
         _viewModel4.SaveMarkupRow();
     }
     else if (_viewModel5 != null)
     {
         _viewModel5.SaveMarkupRow();
     }
 }
コード例 #24
0
        private void lvwResultat_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
            try
            {
                aTa u = e.Row.DataContext as aTa; //fetch the row data

                if (majData.Count > 0 && majData != null)
                {
                    if (majData.First(p => p.CENTRE == u.CENTRE && p.ROWID == u.ROWID && u.CODE == p.CODE) != null)
                    {
                        foreach (aTa t in majData)
                        {
                            if (t.CODE == u.CODE && t.ROWID == u.ROWID)
                            {
                                t.CENTRE  = u.CENTRE;
                                t.CODE    = u.CODE;
                                t.LIBELLE = u.LIBELLE;
                                t.NUM     = u.NUM;
                                t.DMAJ    = DateTime.Now;
                            }
                        }
                    }
                    else
                    {
                        majData.Add(u);
                    }
                }
                else
                {
                    majData.Add(u);
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
コード例 #25
0
        private void plansDataGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
        {
//             if (DataGridEditAction.Commit == e.EditAction)
//             {
//                 PlanEntity planEntity = e.Row.DataContext as PlanEntity;
//                 DateTime targetDateTime = planEntity.TargetDateAdjustment2.HasValue ? planEntity.TargetDateAdjustment2.Value :
//                                         (planEntity.TargetDateAdjustment1.HasValue ? planEntity.TargetDateAdjustment1.Value : planEntity.TargetDate);
//                 if (null == planEntity.AccomplishDate)
//                 {
//                     DateTime currentDateTime = DateTime.Now;
//                     TimeSpan difference = targetDateTime - currentDateTime;
//                     if (difference.Days > remindDay)
//                     {
//                         e.Row.Background = new SolidColorBrush(Colors.Gray);
//                     }
//                     else if (difference.Days >= 0 && difference.Days <= remindDay)
//                     {
//                         e.Row.Background = new SolidColorBrush(Colors.Magenta);
//                     }
//                     else
//                     {
//                         e.Row.Background = new SolidColorBrush(Colors.Red);
//                     }
//                 }
//                 else
//                 {
//                     if (targetDateTime >= planEntity.AccomplishDate)
//                     {
//                         e.Row.Background = new SolidColorBrush(Colors.Green);
//                     }
//                     else
//                     {
//                         e.Row.Background = new SolidColorBrush(Colors.Purple);
//                     }
//                 }
//             }
        }
コード例 #26
0
 private void MainGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     MainGrid.CommitEdit();
 }
コード例 #27
0
ファイル: ExcuseChild.xaml.cs プロジェクト: Osama91/CCWFM
 private void MainGrid_OnRowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     _viewModel.SaveRow(EmployeeShiftViewModel.AttSaveTypes.Excuse);
 }
コード例 #28
0
 private void MainGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     _viewModel.SaveMainRow();
 }
コード例 #29
0
 protected override void OnRowEditEnded(DataGridRowEditEndedEventArgs e)
 {
     base.OnRowEditEnded(e);
 }
コード例 #30
0
 private void DetailGrid_RowEditEnded(object sender, DataGridRowEditEndedEventArgs e)
 {
     _viewModel.SaveDetailRow();
 }