protected override void EditLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            LineaPedidoProveedor item = (LineaPedidoProveedor)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            ProductInfo producto = SelectProducto();

            if (producto == null)
            {
                return;
            }

            item.CopyFrom(_entity, _acreedor, producto);
            _entity.CalculaTotal();

            RefreshLineas();
        }
 protected override void SetRowFormat(DataGridViewRow row)
 {
     if (row.DataGridView == Lineas_DGW)
     {
         LineaPedidoProveedor item = row.DataBoundItem as LineaPedidoProveedor;
         row.DefaultCellStyle = (item.Pendiente != 0) ? ControlTools.Instance.LineaPendienteStyle : ControlTools.Instance.LineaCerradaStyle;
     }
 }
        protected override void UpdatePedidoAction()
        {
            LineaPedidoProveedor item     = Datos_Lineas.Current as LineaPedidoProveedor;
            ProductInfo          producto = ProductInfo.Get(item.OidProducto, false, true);

            item.AjustaCantidad(producto);
            _entity.CalculaTotal();

            RefreshLineas();
        }
        protected override void DeleteLineaAction()
        {
            if (Lineas_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }
            LineaPedidoProveedor item = (LineaPedidoProveedor)Lineas_DGW.CurrentRow.DataBoundItem;

            if (item == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                _entity.Lineas.RemoveItem(_entity, item);

                RefreshLineas();
            }
        }
        protected override void SelectImpuestoLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedidoProveedor item = Datos_Lineas.Current as LineaPedidoProveedor;

            ImpuestoSelectForm form = new ImpuestoSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ImpuestoInfo source = (ImpuestoInfo)form.Selected;

                item.OidImpuesto = source.Oid;
                item.PImpuestos  = source.Porcentaje;

                RefreshLineas();
            }
        }
        protected override void SelectExpedienteLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedidoProveedor item = Datos_Lineas.Current as LineaPedidoProveedor;

            ExpedienteSelectForm form = new ExpedienteSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ExpedientInfo source = (ExpedientInfo)form.Selected;

                item.OidExpediente = source.Oid;
                item.Expediente    = source.Codigo;

                RefreshLineas();
            }
        }
        protected override void SelectAlmacenLineaAction()
        {
            if (Datos_Lineas.Current == null)
            {
                return;
            }

            LineaPedidoProveedor item = Datos_Lineas.Current as LineaPedidoProveedor;

            AlmacenSelectForm form = new AlmacenSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                StoreInfo source = (StoreInfo)form.Selected;

                item.OidAlmacen = source.Oid;
                item.Almacen    = source.Nombre;

                RefreshLineas();
            }
        }