Ejemplo n.º 1
0
        private void view_CellValueChanging(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            try
            {
                if (e.RowHandle != GridControl.AutoFilterRowHandle)
                {
                    //if (e.Column == this.colThroughput && e.Value != null)
                    //{
                    //    ////Try parsing the value to make sure it is only contains numeric characters and is not negative.
                    //    if (int.Parse((string)e.Value) >= 0 ? false : true)
                    //    {
                    //        throw new Exception();
                    //    }
                    //}
                    //else if (e.Column == this.colThroughputCode)
                    //{
                    //    if (e.Value != null && (int)e.Value != 1)
                    //    {
                    //        ((v_Throughput)e.Row).Throughput = 0;
                    //    }
                    //}
                }

                ((TableView)sender).PostEditor();
            }
            catch
            {
                MessageBox.Show("You can only enter a non-negative numeric value into the throughput field.", "Invalid Value", MessageBoxButton.OK);
                ((TableView)sender).PostEditor();
            }
        }
Ejemplo n.º 2
0
        private void TableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var row = e.Row as AtendimentoDTO;

            if (e.Column.FieldName.ToString() == "Quantidade")
            {
                if (row.Quantidade > row.Solicitado || row.Quantidade > row.Estoque)
                {
                    if (row.Quantidade > row.Solicitado)
                    {
                        if (row.Solicitado > row.Estoque)
                        {
                            row.Quantidade = row.Estoque;
                        }
                        else
                        {
                            row.Quantidade = row.Solicitado;
                        }
                    }
                    if (row.Quantidade > row.Estoque)
                    {
                        row.Quantidade = row.Estoque;
                    }
                }
                else if (row.Quantidade < 0)
                {
                    row.Quantidade = 0;
                }
            }
        }
Ejemplo n.º 3
0
        private void TableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var material = e.Row as ListaOrcamentosDTO;

            if (e.Column.Header.ToString() == "Quantidade")
            {
                if (material.Quantidade < 0)
                {
                    material.Quantidade = 0;
                }
            }

            if (e.Column.Header.ToString() == "Quantidade")
            {
                dto.Id         = material.Id;
                dto.Quantidade = material.Quantidade;
                bll.AtualizarQuantidade(dto);
            }
            else if (e.Column.Header.ToString() == "BDI")
            {
                dto.Id  = material.Id;
                dto.Bdi = Convert.ToDouble(material.Bdi);
                bll.AtualizarBDI(dto);
            }
            else if (e.Column.Header.ToString() == "FD")
            {
                dto.Id = material.Id;
                dto.Fd = material.Fd;
                bll.AtualizarFD(dto);
            }
            LoadSidePanel();
        }
Ejemplo n.º 4
0
        // 单价
        private void TableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            if (e.Column.FieldName == "商品ID")
            {
                long l = (long)Purchases.GetCellValue(e.RowHandle, "商品ID");

                DbDataService dbDataService = new DbDataService();
                double?       unitPrice     = dbDataService.UnitPrice(l, Models.JinXiaoCunType.进货);
                Purchases.SetCellValue(e.RowHandle, "单价", unitPrice);
            }
        }
Ejemplo n.º 5
0
 private void tableview0_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
 {
     var  column       = e.Column;
     var  fieldName    = column.FieldName;
     var  newCellValue = e.Value;
     var  oldCellValue = e.OldValue;
     var  row          = (Product2)e.Row;
     int  rowHandle    = e.RowHandle;
     bool handled      = e.Handled;
     var  cell         = e.Cell;
 }
        private void TableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var row = e.Row as GerarRequisicaoMaterialDTO;

            if (e.Column.FieldName.ToString() == "Quantidade")
            {
                if (row.Quantidade > row.Saldo)
                {
                    row.Quantidade = row.Saldo;
                }
            }
        }
 private void gridTableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
 {
     if (wellMeterReadingGrid.IsValidRowHandle(e.RowHandle + 1))
     {
         wellMeterReadingGrid.CurrentColumn = wellMeterReadingGrid.Columns.GetColumnByFieldName("MeterReading");
         gridTableView.FocusedRowHandle     = e.RowHandle + 1;
     }
     else
     {
         btnSave.Focus();
     }
     e.Handled = true;
 }
Ejemplo n.º 8
0
        private void TableView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var material = e.Row as ListaProjetosDTO;

            if (e.Column.Header.ToString() == "Quantidade")
            {
                if (material.Quantidade < 0)
                {
                    material.Quantidade = 0;
                }
            }

            new Thread(() =>
            {
                syncEvent.Set();
                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
                {
                    if (e.Column.Header.ToString() == "Quantidade")
                    {
                        dto.Id         = material.Id;
                        dto.Quantidade = material.Quantidade;
                        bll.AtualizarQuantidade(dto);
                    }
                    else if (e.Column.Header.ToString() == "FD")
                    {
                        dto.Id = material.Id;
                        dto.Fd = material.Fd;
                        new Thread(() =>
                        {
                            Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
                            {
                                bll.AtualizarFD(dto);
                                LoadSidePanel();
                            }));
                        }).Start();
                    }
                }));
            }).Start();

            new Thread(() =>
            {
                Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
                {
                    LoadSidePanel();
                }));
            }).Start();
        }
 private void OnCellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
 {
     ahg_Save.Visibility = System.Windows.Visibility.Visible;
 }
Ejemplo n.º 10
0
        private void TableView_CellValueChanging(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var material = e.Row as ListaOrcamentosDTO;

            LoadSidePanel();
        }
Ejemplo n.º 11
0
        private void GrdView_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var row = e.Row as ProdutosDTO;

            new Thread(() =>
            {
                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
                {
                    if (e.Column.FieldName.ToString() == "Anotacoes")
                    {
                        dto.Id = row.Id;
                        if (row.Anotacoes != null)
                        {
                            dto.Anotacoes = row.Anotacoes.Replace("'", "''").ToUpper();
                        }
                        else
                        {
                            dto.Anotacoes = "";
                        }
                        bll.P_UpdateAnotacoes(dto);
                    }
                    else if (e.Column.FieldName.ToString() == "Partnumber")
                    {
                        dto.Id = row.Id;
                        if (row.Partnumber != null)
                        {
                            dto.Partnumber = row.Partnumber.Replace("'", "''").ToUpper();
                        }
                        else
                        {
                            dto.Partnumber = "";
                        }
                        bll.P_UpdatePartnumber(dto);
                    }
                    else if (e.Column.FieldName.ToString() == "Ncm")
                    {
                        dto.Id = row.Id;
                        if (row.Ncm != null)
                        {
                            dto.Ncm = row.Ncm.Replace("'", "''").ToUpper();
                        }
                        else
                        {
                            dto.Ncm = "";
                        }
                        bll.P_UpdateNcm(dto);
                    }
                    else if (e.Column.FieldName.ToString() == "Custo")
                    {
                        dto.Id    = row.Id;
                        dto.Custo = row.Custo;
                        bll.P_UpdateCusto(dto);
                    }
                    else if (e.Column.FieldName.ToString() == "Ipi")
                    {
                        dto.Id  = row.Id;
                        dto.Ipi = row.Ipi;
                        bll.P_UpdateIpi(dto);
                    }
                    else if (e.Column.FieldName.ToString() == "Icms")
                    {
                        dto.Id   = row.Id;
                        dto.Icms = row.Icms;
                        bll.P_UpdateIcms(dto);
                    }
                }));
            }).Start();
        }
Ejemplo n.º 12
0
 private void view_CellValueChanging(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
 {
     (sender as TableView).PostEditor();
 }
Ejemplo n.º 13
0
        void AssociatedObject_CellValueChanged(object sender, DevExpress.Xpf.Grid.CellValueChangedEventArgs e)
        {
            var view = (DataViewBase)sender;

            view.CommitEditing();
        }