private void cmb_subir_Click(object sender, EventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetFocusedRow(); if (row == null) { return; } string filePath = null; if (openFileDialog1.ShowDialog() == DialogResult.OK) { filePath = openFileDialog1.FileName; row.NombreArchivo = openFileDialog1.FileName; row.NuevoAdjunto = true; row.Adjunto = true; gc_detalle.RefreshDataSource(); } else { return; } } catch (Exception) { throw; } }
private void gv_detalle_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetRow(e.RowHandle); if (row == null) { return; } if (col_IdProducto == e.Column) { if (row.IdProducto != null) { var producto = Lista_producto.Where(q => q.IdEmpresa == param.IdEmpresa && q.IdProducto == Convert.ToDecimal(row.IdProducto)).FirstOrDefault(); if (producto != null) { row.pr_descripcion = producto.pr_descripcion; row.IdUnidadMedida = producto.IdUnidadMedida; row.IdUnidadMedida_Consumo = producto.IdUnidadMedida_Consumo; //row.Stock = bus_producto.GetStockProductoPorEmpresa(param.IdEmpresa, Convert.ToDecimal(row.IdProducto)); } } else { row.IdUnidadMedida = "UND"; row.IdUnidadMedida_Consumo = "UND"; row.pr_descripcion = string.Empty; row.Stock = 0; } } if (cmb_PuntoCargoCab.EditValue != null) { row.IdPunto_cargo = Convert.ToInt32(cmb_PuntoCargoCab.EditValue); } if (e.Column == colR) { foreach (var item in blst_det.Where(q => q.CodigoOrdenCompra == row.CodigoOrdenCompra)) { item.A = Convert.ToBoolean(e.Value); } } } catch (Exception) { throw; } }
private void gv_detalle_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetRow(e.RowHandle); if (row == null) { return; } if (e.Column == col_A) { if (row.A == true) { row.opd_CantidadApro = row.opd_Cantidad; } else { row.opd_CantidadApro = 0; } row.R = false; } if (e.Column == col_R) { row.opd_CantidadApro = 0; row.A = false; } if (e.Column == col_CantidadAprobada) { if (Convert.ToDouble(e.Value ?? 0) == 0) { row.A = false; row.R = false; } else { row.A = true; row.R = false; } } gv_detalle.RefreshData(); } catch (Exception) { } }
private void gv_detalle_RowCellStyle(object sender, RowCellStyleEventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetRow(e.RowHandle); if (row == null) { return; } if (row.IdProducto == null) { e.Appearance.ForeColor = Color.DarkOrange; } } catch (Exception) { } }
private void SetEstadoCelda(int RowHandle) { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetRow(RowHandle); if (row == null) { col_IdUnidadMedida.OptionsColumn.AllowEdit = true; col_pr_descripcion.OptionsColumn.AllowEdit = true; } else if (row.IdProducto == null) { col_IdUnidadMedida.OptionsColumn.AllowEdit = false; col_pr_descripcion.OptionsColumn.AllowEdit = true; } else if (row.IdProducto != null) { col_IdUnidadMedida.OptionsColumn.AllowEdit = true; col_pr_descripcion.OptionsColumn.AllowEdit = false; } }
private void cmb_search_Click(object sender, EventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetFocusedRow(); if (row == null) { return; } if (row.IdPunto_cargo == null) { return; } FrmCom_ComprasPorPuntoCargo frm = new FrmCom_ComprasPorPuntoCargo(); frm.IdPunto_cargo = Convert.ToInt32(row.IdPunto_cargo); frm.ShowDialog(); } catch (Exception) { } }
private void txtStock_DoubleClick(object sender, EventArgs e) { try { com_OrdenPedidoDet_Info row = (com_OrdenPedidoDet_Info)gv_detalle.GetFocusedRow(); if (row == null) { return; } if (row.IdProducto == null) { return; } FrmIn_ProductoPorBodegaStock frm = new FrmIn_ProductoPorBodegaStock(); frm._IdProducto = row.IdProducto ?? 0; frm.Show(); } catch (Exception) { throw; } }