Ejemplo n.º 1
0
 private void gv_detalle_RowCellStyle(object sender, RowCellStyleEventArgs e)
 {
     try
     {
         com_OrdenPedidoPlantillaDet_Info row = (com_OrdenPedidoPlantillaDet_Info)gv_detalle.GetRow(e.RowHandle);
         if (row == null)
         {
             return;
         }
         if (row.IdProducto == null)
         {
             e.Appearance.ForeColor = Color.DarkOrange;
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 2
0
        private void SetEstadoCelda(int RowHandle)
        {
            com_OrdenPedidoPlantillaDet_Info row = (com_OrdenPedidoPlantillaDet_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;
            }
        }
Ejemplo n.º 3
0
        private void gv_detalle_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            try
            {
                com_OrdenPedidoPlantillaDet_Info row = (com_OrdenPedidoPlantillaDet_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;
                        }
                    }
                    else
                    {
                        row.IdUnidadMedida = "UND";
                        row.pr_descripcion = string.Empty;
                    }
                }

                if (cmb_PuntoCargoCab.EditValue != null)
                {
                    row.IdPunto_cargo = Convert.ToInt32(cmb_PuntoCargoCab.EditValue);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 4
0
        private void txtStock_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                com_OrdenPedidoPlantillaDet_Info row = (com_OrdenPedidoPlantillaDet_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;
            }
        }