public FrmModuloCotizacion(Cotizacion cotizacion, FrmAdquisiciones padre)
     : this(padre)
 {
     CotizacionActual = cotizacion;
     AnexoActual = cotizacion.Anexo;
     ProveedorActual = cotizacion.Proveedor;
     Consultar();
 }
        private static string MapeoInstituto(Anexo anexo)
        {
            switch (anexo.Instituto)
            {
                case "O":
                    return "ORTOPEDIA";
                case "R":
                    return "REHABILITACION";
                case "C":
                    return "COMUNICACION";
            }

            return "";
        }
        public List<PedidoDetalle> CargarPedidoDetalle(Anexo anexo)
        {
            var anexosDetalle = AnexoService.AnexoDao.CargarAnexoDetalle(anexo);

            var pedidosDetalle = new List<PedidoDetalle>();

            foreach(var anexoDetalle in anexosDetalle)
            {
                var pedidoDetalle = new PedidoDetalle();

                pedidoDetalle.Articulo = anexoDetalle.Articulo;
                pedidoDetalle.RenglonPedido = anexoDetalle.RenglonAnexo;
                pedidoDetalle.CveArt = anexoDetalle.Articulo.Id.CveArt;
                pedidoDetalle.DescripcionArt = anexoDetalle.Articulo.DesArticulo;
                pedidoDetalle.UnidadArt = anexoDetalle.Articulo.Unidad;
                pedidoDetalle.Cantidad = 0;//anexoDetalle.CantidadMinimo;
                pedidosDetalle.Add(pedidoDetalle);
            }

            return pedidosDetalle;
        }
        public void ActualizarFallo(Anexo anexo)
        {
            var fallos = FalloDao.FallosByAnexo(anexo);
             bool updateFalloDetalle = false;
            foreach (var fallo in fallos)
            {
                foreach (var fallodetalle in fallo.FalloDetalle)
                {
                    fallodetalle.CantidadMin = fallodetalle.CantidadMax;
                    FalloDetalleDao.Update(fallodetalle);
                    updateFalloDetalle = true;
                }

                if(updateFalloDetalle)
                {
                    fallo.FechaModificacion = FalloDao.FechaServidor();
                    FalloDao.Update(fallo);
                }

                updateFalloDetalle = false;

            }
        }
Exemple #5
0
        private void BtnConsultaClick(object sender, EventArgs e)
        {
            this.dgvAnexo.Rows.Clear();
            AnexoActual = AnexoService.ConsultarAnexo(txtnumlicitacion.Text,
                FrmModulo.AlmacenSelec.IdAlmacen);

            if (AnexoActual != null)
            {

                //Rebindeamos padre y detalle
                this.bsAnexo.DataSource = AnexoActual;
                this.bsAnexoDetalle.DataSource = AnexoActual.AnexoDetalle;

                btnModificar.Enabled = true;
                btnAgregar.Enabled = false;
                txtnumlicitacion.Enabled = false;
                dtpFechaanexo.Enabled = false;
            }
            else
            {
                MessageBox.Show("Folio no existe", "Adquisiciones",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public FrmModuloAnexo(Anexo anexo, FrmAdquisiciones padre)
     : this(padre)
 {
     AnexoActual = anexo;
     Consultar();
 }
        public override void Nuevo()
        {
            AnexoActual = new Anexo();
            bsAnexo.DataSource = AnexoActual;
            bsAnexoDetalle.DataSource = new List<AnexoDetalle>();

            AnexoActual.FechaAnexo = AnexoService.AnexoDao.FechaServidor();
            lblFecha.Text = String.Format("{0:dd/MM/yyyy}", AnexoActual.FechaAnexo);

            txtnumlicitacion.Enabled = true;
            cmdGuardar.Enabled = true;

            txtnumlicitacion.Focus();
            LimpiarErrores();
            cbxAlmacen.Enabled = true;
            searchLookUpPartida.Enabled = true;
            searchLookUpPartida.EditValue = null;
            PartidaActual = null;
        }
        public override void Guardar()
        {
            txtCentinela.Focus(); //Para rebindeeen los campos
            AnexoActual = bsAnexo.DataSource as Anexo;
            AnexoActual.AnexoDetalle = bsAnexoDetalle.DataSource as List<AnexoDetalle>;

            try
            {
                AnexoActual.Almacen = AlmacenActual;
                AnexoActual.Usuario = FrmModuloAcceso.UsuarioLog;

                //Combos
                AnexoActual.TipoLicitacion = cbxTipolicitacion.SelectedValue as TipoLicitacion;
                AnexoActual.Iva = cbxIva.SelectedValue as Iva;

                if (!Util.DatosValidos(AnexoActual, lblNumErrors, listaError))
                    return;

                AnexoActual.TipoContrato = Contrato;
                AnexoService.GuardarAnexo(ref AnexoActual);

                Consultar();

                XtraMessageBox.Show(@"Licitación Registrada o Actualizada Exitosamente",
                    @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Information);

            }
            catch (Exception ee)
            {
                XtraMessageBox.Show(@"Ocurrio un error en el guardado",
                    @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Log.Error("Generado por:" + FrmModuloAcceso.UsuarioLog, ee);
            }
        }
        public override void Consultar()
        {
            try
            {
                Nuevo();

                if (Util.DatosValidos(CotizacionActual, lblNumErrors, listaError))
                {
                    CotizacionService.ConsultarCotizacion(ref CotizacionActual);
                    bsCotizacionDetalle.DataSource = CotizacionActual.CotizacionDetalle;

                    if (searchLookUpAnexo.Handle != IntPtr.Zero)
                        searchLookUpAnexo.EditValue = CotizacionActual.Anexo.IdAnexo;

                    AnexoActual = CotizacionActual.Anexo;

                    if (searchLookUpProv.Handle != IntPtr.Zero)
                        searchLookUpProv.EditValue = CotizacionActual.Proveedor.CveProveedor;

                    ProveedorActual = CotizacionActual.Proveedor;

                    lblFecha.Text = String.Format("{0:dd/MM/yyyy}", CotizacionActual.FechaCotizacion);

                    base.EntityActual = CotizacionActual;
                    base.Consultar();

                    if (CotizacionService.CotizacionDao.ExisteAnexoFallo(CotizacionActual.Anexo))
                    {
                        XtraMessageBox.Show(@"El anexo tiene fallo",
                        @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        cmdGuardar.Enabled = false;
                    }

                    gcDatosGenerales.Enabled = false;
                }
            }
            catch (Exception ee)
            {
                XtraMessageBox.Show(@"Rellene los campos para la consulta");
                Log.Error("Generado por:" + FrmModuloAcceso.UsuarioLog, ee);
            }
        }
        private void ReporteTabla(Anexo anexo)
        {
            anexo = AnexoService.AnexoDao.
                     ConsultaAnexo(anexo.NumeroAnexo, anexo.Almacen);

            var anexoDs = new AnexoDS();

            decimal? totalAsignadoMin = 0, totalAsignadoMax = 0;
            int renglonesDesiertos = 0;

            foreach (var detalle in anexo.AnexoDetalle)
            {
                var filaDetalle = anexoDs.Tables["AnexoDetalleTabla"].NewRow();

                filaDetalle["Anexo"] = detalle.Anexo;
                filaDetalle["Presupuesto"] = detalle.Anexo.TechoPresupuestal;
                filaDetalle["AsignadoConIvaEtiquetaMin"] = "ASIGNADO MIN CON "
                    + detalle.Anexo.Iva.Id.Porcentaje + " % DE IVA:";

                if (anexo.TipoContrato == Contrato.ABIERTO){
                    filaDetalle["AsignadoConIvaEtiquetaMax"] = "ASIGNADO MAX CON "
                    + detalle.Anexo.Iva.Id.Porcentaje + " % DE IVA:";
                }
                else if (anexo.TipoContrato == Contrato.CERRADO) {
                    filaDetalle["AsignadoConIvaEtiquetaMax"] = "ASIGNADO CON "
                    + detalle.Anexo.Iva.Id.Porcentaje + " % DE IVA:";
                }

                var renglonesLicitados = anexo.AnexoDetalle.Max(d => d.RenglonAnexo);
                filaDetalle["RenglonesLicitados"] = renglonesLicitados;

                filaDetalle["ClaveArticulo"] = detalle.Articulo.Id.CveArt;

                var articulo = detalle.Articulo;
                filaDetalle["Renglon"] = detalle.RenglonAnexo;
                filaDetalle["Descripcion"] = articulo.Id.CveArt + " / " + articulo.DesArticulo;
                filaDetalle["Unidad"] = articulo.Unidad;
                filaDetalle["Presentacion"] = articulo.Presentacion;

                filaDetalle["CantidadMaximo"] = detalle.CantidadMaximo;
                filaDetalle["CantidadMinimo"] = detalle.CantidadMinimo??0;

                var cotizacionDetalles = CotizacionService.CotizacionDao.
                    CargarCotizacionDetalle(anexo, detalle.Articulo, anexo.Almacen);

                if (cotizacionDetalles.Count > 0)
                {
                    AsignarProveedores(cotizacionDetalles);

                    var count = 0;

                    foreach (var subdetalle in cotizacionDetalles)
                    {
                        if (count == 0)
                        {
                            totalAsignadoMin += subdetalle.Precio*detalle.CantidadMinimo??0;
                            totalAsignadoMax += subdetalle.Precio * detalle.CantidadMaximo;
                        }

                        var asterisco = subdetalle.Ganador ? "* " : "";
                        var filaSubDetalle = anexoDs.Tables["Proveedor"].NewRow();
                        filaSubDetalle["ClaveArticulo"] = subdetalle.Articulo.Id.CveArt;
                        filaSubDetalle["Descripcion"] = asterisco + subdetalle.Cotizacion.Proveedor.NombreFiscal;
                        filaSubDetalle["Precio"] = subdetalle.Precio;
                        filaSubDetalle["TotalMax"] = subdetalle.Precio*detalle.CantidadMaximo;
                        filaSubDetalle["TotalMin"] = subdetalle.Precio*detalle.CantidadMinimo??0;
                        filaSubDetalle["Marca"] = subdetalle.Marca;
                        filaSubDetalle["Porcentaje"] = subdetalle.Porcentaje;
                        filaSubDetalle["Observaciones"] = subdetalle.Observaciones;
                        anexoDs.Tables["Proveedor"].Rows.Add(filaSubDetalle);

                        ++count;
                    }
                }
                else
                {
                    var filaSubDetalle = anexoDs.Tables["Proveedor"].NewRow();
                    filaSubDetalle["ClaveArticulo"] = detalle.Articulo.Id.CveArt;
                    filaSubDetalle["Descripcion"] = "<<<<< D E S I E R T O >>>>>";
                    anexoDs.Tables["Proveedor"].Rows.Add(filaSubDetalle);
                    ++renglonesDesiertos;
                }

                filaDetalle["RenglonesDesiertos"] = renglonesDesiertos;
                var renglonesAdjudicados = renglonesLicitados - renglonesDesiertos;
                filaDetalle["RenglonesAdjudicados"] = renglonesAdjudicados;

                var asignadoConIvaMin = (totalAsignadoMin * detalle.Anexo.Iva.Id.Porcentaje/100)
                            + totalAsignadoMin;
                var asignadoConIvaMax = (totalAsignadoMax * detalle.Anexo.Iva.Id.Porcentaje / 100)
                            + totalAsignadoMax;

                filaDetalle["AsignadoConIvaMin"] = asignadoConIvaMin;
                filaDetalle["AsignadoConIvaMax"] = asignadoConIvaMax;

                var diferenciaMin = detalle.Anexo.TechoPresupuestal - asignadoConIvaMin;
                var diferenciaMax = detalle.Anexo.TechoPresupuestal - asignadoConIvaMax;

                filaDetalle["DiferenciaMin"] = diferenciaMin;
                filaDetalle["DiferenciaMax"] = diferenciaMax;

                anexoDs.Tables["AnexoDetalleTabla"].Rows.Add(filaDetalle);
            }

            anexoDs.Tables["Proveedor"].AcceptChanges();
            anexoDs.Tables["AnexoDetalle"].AcceptChanges();

            if (anexo.TipoContrato == Contrato.ABIERTO){
                ReporteTablaAbierto1.SetDataSource(anexoDs);
                crystalReportViewer.ReportSource = ReporteTablaAbierto1;
            }
            else if (anexo.TipoContrato == Contrato.CERRADO){
                ReporteTablaCerrado1.SetDataSource(anexoDs);
                crystalReportViewer.ReportSource = ReporteTablaCerrado1;
            }

            crystalReportViewer.Refresh();
            Text = @"ReporteTablaComparativa";
        }
        private void SearchLookUpAnexoEditValueChanged(object sender, EventArgs e)
        {
            if (searchLookUpAnexo.EditValue != null)
            {
                var anexoSeleccionado = searchLookUpEditAnexo.GetFocusedRow() as Anexo;

                if (anexoSeleccionado != null)
                {
                    AnexoActual = anexoSeleccionado;
                    CotizacionActual.Anexo = AnexoActual;

                    if (AnexoActual.TipoContrato == Contrato.ABIERTO)
                    {
                        gridColumnCantidadMax.Caption = @"Cantidad Max";
                        gridColumnCantidadMin.Visible = true;
                    }
                    else if (AnexoActual.TipoContrato == Contrato.CERRADO)
                    {
                        gridColumnCantidadMax.Caption = @"Cantidad";
                        gridColumnCantidadMin.Visible = false;
                    }

                }
            }
            else
            {
                AnexoActual = null;
                CotizacionActual.Anexo = AnexoActual;
            }
        }
        public List<Fallo> GuardarFallo(Anexo anexo, DateTime fechaFallo)
        {
            var result = new List<Fallo>();

            var anexosDetalle = AnexoDao.CargarAnexoDetalle(anexo);

            double index = 1.0;

            foreach (var anexoDetalle in anexosDetalle)
            {
                //Evento
                var porcentaje = (int)((index++ / anexosDetalle.Count) * 100.0);
                OnFalloProceso(new FalloProcesoEvento(porcentaje));

                var cotizacionesDetalle =
                    CotizacionDao.CargarCotizacionDetalle(anexo,
                    anexoDetalle.Articulo,
                    anexo.Almacen);

                if (cotizacionesDetalle.Count == 0)
                    continue;

                var cotizacionDetalle = cotizacionesDetalle[0];

                var falloFound =
                    FalloDao.ExisteProvCotiz(cotizacionDetalle.Cotizacion,
                    cotizacionDetalle.Cotizacion.Proveedor);

                var fechaActual = FalloDao.FechaServidor();

                Fallo falloActual = null;

                if (falloFound == null)
                {
                    falloActual = new Fallo
                                      {
                        IdFallo = FalloDao.MaximoId().Value,
                        Anexo = anexo,
                        Cotizacion = cotizacionDetalle.Cotizacion,
                        Proveedor = cotizacionDetalle.Cotizacion.Proveedor,
                        Estado = "A",
                        Usuario = anexo.Usuario,
                        Almacen = anexo.Almacen,
                        FechaFallo = fechaFallo,
                        FechaModificacion = fechaActual,
                        FechaCaptura = fechaActual,
                        IpTerminal = Util.IpTerminal(),
                        Modificacion = 0
                    };

                    FalloDao.Insert(falloActual);

                }
                else
                    falloActual = falloFound;

                falloActual.FalloDetalle = new List<FalloDetalle>();
                result.Add(falloActual);

                var falloDetalle = new FalloDetalle()
                {
                    IdFalloDetalle = FalloDetalleDao.MaximoId().Value,
                    Fallo = falloActual,
                    RenglonAnexo = cotizacionDetalle.RenglonAnexo,
                    CantidadMax = 0,
                    CantidadMin = 0,
                    CantidadPed = 0,
                    PrecioFallo = cotizacionDetalle.Precio,
                    Articulo = cotizacionDetalle.Articulo
                };

                if (anexo.TipoContrato == Contrato.ABIERTO)
                {
                    falloDetalle.CantidadMin = anexoDetalle.CantidadMinimo;
                    falloDetalle.CantidadMax = anexoDetalle.CantidadMaximo;
                }
                else if (anexo.TipoContrato == Contrato.CERRADO)
                {
                    falloDetalle.CantidadMin = anexoDetalle.CantidadMaximo;
                    falloDetalle.CantidadMax = anexoDetalle.CantidadMaximo;
                }

                FalloDetalleDao.Insert(falloDetalle);

                falloActual.FalloDetalle.Add(falloDetalle);

            }

            return result;
        }
        private void ReporteAnexo(Anexo anexo)
        {
            var anexoDs = new AnexoDS();

            anexo = AnexoService.ConsultarAnexo(anexo.NumeroAnexo, anexo.Almacen);

            DataRow filaMain = anexoDs.Tables["Anexo"].NewRow();
            filaMain["Id"] = anexo.IdAnexo;
            filaMain["Numero"] = anexo.NumeroAnexo;
            filaMain["Descripcion"] = anexo.DesAnexo;
            filaMain["Fecha"] = String.Format("{0:dd/MM/yyyy}", anexo.FechaAnexo);
            filaMain["Presupuesto"] = anexo.TechoPresupuestal.Value.ToString("C");
            anexoDs.Tables["Anexo"].Rows.Add(filaMain);
            anexoDs.Tables["Anexo"].AcceptChanges();

            foreach (AnexoDetalle detalle in anexo.AnexoDetalle)
            {
                DataRow filaDetalle = anexoDs.Tables["AnexoDetalle"].NewRow();
                filaDetalle["Id"] = anexo.IdAnexo;
                filaDetalle["Renglon"] = detalle.RenglonAnexo;
                filaDetalle["Articulo"] = detalle.Articulo.Id.CveArt;
                filaDetalle["Descripcion"] = detalle.Articulo.DesArticulo;
                filaDetalle["Unidad"] = detalle.Articulo.Unidad;
                filaDetalle["CantidadMinimo"] = detalle.CantidadMinimo??0;
                filaDetalle["CantidadMaximo"] = detalle.CantidadMaximo;
                anexoDs.Tables["AnexoDetalle"].Rows.Add(filaDetalle);
            }

            anexoDs.Tables["AnexoDetalle"].AcceptChanges();

            if (anexo.TipoContrato == Contrato.ABIERTO)
            {
                ReporteAnexoAbierto1.SetDataSource(anexoDs);
                crystalReportViewer.ReportSource = ReporteAnexoAbierto1;
            }
            else if (anexo.TipoContrato == Contrato.CERRADO)
            {
                ReporteAnexoCerrado1.SetDataSource(anexoDs);
                crystalReportViewer.ReportSource = ReporteAnexoCerrado1;
            }

            crystalReportViewer.Refresh();

            Text = @"ReporteAnexo";
        }
Exemple #14
0
        private void Nuevo()
        {
            nudFecha.Value = CotizacionService.CotizacionDao.FechaServidor().Year;
            CotizacionActual = new Cotizacion();
            AnexoActual = new Anexo();
            ProveedorActual = new Proveedor();

            cbxLicitacion.DataSource = null;
            bsCotizacionDetalle.DataSource = new List<CotizacionDetalle>();
            listaError.Items.Clear();
            lblNumErrors.Text = string.Empty;

            txtInstituto.Text = string.Empty;
            txtDeslicitacion.Text = string.Empty;
            txtProveedor.Text = string.Empty;
            txtDesproveedor.Text = string.Empty;
            txtDeslicitacion.Text = string.Empty;
            dtpFechacotizacion.Value = DateTime.Now;

            gpbDatosCotizacion.Enabled = true;
            btnGuardar.Enabled = false;
        }
Exemple #15
0
        private void Nuevo()
        {
            //Nueva consulta
            AnexoActual = new Anexo();
            bsAnexo.DataSource = AnexoActual;
            bsAnexoDetalle.DataSource = new List<AnexoDetalle>();

            this.dgvAnexo.Rows.Clear();

            btnModificar.Enabled = false;
            btnAgregar.Enabled = true;
            txtnumlicitacion.Enabled = true;
            dtpFechaanexo.Enabled = true;
            txtnumlicitacion.Focus();
            listaError.Items.Clear();
            lblNumErrors.Text = string.Empty;
        }
Exemple #16
0
        /// <summary>
        /// Guarda un anexo valido 
        /// siempre no exista una cotizacion asociada
        /// </summary>
        private void GuardarAnexo()
        {
            AnexoActual = bsAnexo.DataSource as Anexo;
            //Seteamos el binding del detalle al padre
            AnexoActual.AnexoDetalle = bsAnexoDetalle.DataSource as List<AnexoDetalle>;

            try
            {
                if (Util.DatosValidos<Anexo>(AnexoActual, lblNumErrors, listaError))
                {

                    //if(AnexoService.AnexoDao.ExisteAnexoCotizacion(AnexoActual))
                    //{
                    //    MessageBox.Show(@"El anexo tiene asociadas cotizaciones",
                    //    @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //    return;
                    //}

                    //los parametros basicos
                    AnexoActual.FechaModificacion = AnexoService.AnexoDao.FechaServidor();
                    AnexoActual.IpTerminal = Util.IpTerminal();
                    AnexoActual.Almacen = FrmModulo.AlmacenSelec;
                    AnexoActual.Usuario = FrmAcceso.UsuarioLog;
                    AnexoActual.FechaAnexo = dtpFechaanexo.Value;

                    AnexoService.GuardarAnexo(AnexoActual);

                    MessageBox.Show(@"Licitación Registrada o Actualizada Exitosamente",
                   @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    btnModificar.Enabled = true;
                    btnAgregar.Enabled = false;

                    //Desactivamos las llaves principales
                    txtnumlicitacion.Enabled = false;
                    dtpFechaanexo.Enabled = false;
                    listaError.Items.Clear();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(@"Ocurrio un error en la insercion o actualizacion Reportalo a Dep. Sistemas",
                    @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void GuardarAnexo(ref Anexo anexo)
        {
            if(anexo.IdAnexo == 0)
            {
                anexo.FechaCaptura = AnexoDao.FechaServidor();
            }

            anexo.FechaModificacion = AnexoDao.FechaServidor();
            anexo.IpTerminal = Util.IpTerminal();
            ++anexo.Modificacion;

            foreach (var anexoDetalle in anexo.AnexoDetalle)
            {
                anexoDetalle.Anexo = anexo;
            }

            anexo = AnexoDao.Merge(anexo);
        }
        public override void Consultar()
        {
            try
            {
                if (AnexoActual.NumeroAnexo == null)
                    AnexoActual.NumeroAnexo = txtnumlicitacion.Text;

                AnexoActual = AnexoService.ConsultarAnexo(AnexoActual.NumeroAnexo,
                    AlmacenActual);
                if (AnexoActual != null)
                {
                    bsAnexo.DataSource = AnexoActual;
                    bsAnexoDetalle.DataSource = AnexoActual.AnexoDetalle;

                    //Combos que no vincula
                    if (AnexoActual.TipoLicitacion != null)
                        cbxTipolicitacion.SelectedIndex = cbxTipolicitacion.
                            FindStringExact(AnexoActual.TipoLicitacion.DesTipolicitacion);

                    if (AnexoActual.Iva != null)
                        cbxIva.SelectedIndex = cbxIva.FindStringExact(AnexoActual.Iva.Id.Porcentaje.ToString());

                    if (AnexoActual.TipoContrato == Contrato.ABIERTO)
                        rbContratoAbierto.Checked = true;
                    else if (AnexoActual.TipoContrato == Contrato.CERRADO)
                        rbContratoCerrado.Checked = true;

                    lblFecha.Text = String.Format("{0:dd/MM/yyyy}", AnexoActual.FechaAnexo);

                    var oneDetalle = AnexoActual.AnexoDetalle[0];
                    PartidaActual = AnexoService.ArticuloDao.GetPartida(oneDetalle.Articulo);
                    cbxAlmacen.SelectedIndex = cbxAlmacen.FindStringExact(oneDetalle.Articulo.Id.Almacen.ToString());

                    //Centinela
                    if (searchLookUpPartida.Handle != IntPtr.Zero)
                        searchLookUpPartida.EditValue = PartidaActual.Partida;

                    LimpiarErrores();

                    base.EntityActual = AnexoActual;
                    base.Consultar();
                    if (AnexoService.AnexoDao.ExisteAnexoCotizacion(AnexoActual) ||
                        AnexoService.AnexoDao.ExisteAnexoPedido(AnexoActual))
                    {
                        XtraMessageBox.Show(@"El anexo tiene asociadas cotizaciones o pedidos",
                            @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        cmdGuardar.Enabled = false;

                    }

                    searchLookUpPartida.Enabled = false;
                    cbxAlmacen.Enabled = false;

                }
                else
                {
                    XtraMessageBox.Show(@"Folio no existe", @"Adquisiciones",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtnumlicitacion.Select();
                }
            }
            catch (Exception ee)
            {
                XtraMessageBox.Show(@"Ocurrio un error en la consulta",
                    @"Adquisiciones", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Log.Error("Generado por:" + FrmModuloAcceso.UsuarioLog, ee);
            }

            cbxAlmacen.Enabled = false;
        }
        private void SearchLookUpAnexoEditValueChanged(object sender, EventArgs e)
        {
            if (searchLookUpAnexo.EditValue != null)
            {
                var anexoSeleccionado = searchLookUpEditAnexo.GetFocusedRow() as Anexo;

                if (anexoSeleccionado != null)
                {
                    AnexoSelect = anexoSeleccionado;
                }
            }
            else
            {
                AnexoSelect = null;
            }
        }
Exemple #20
0
 private void CbxLicitacionSelectedIndexChanged(object sender, EventArgs e)
 {
     //Pinta el instituto y la descripcion del anexo
     AnexoActual = cbxLicitacion.SelectedValue as Anexo;
     if (AnexoActual == null) return;
     txtInstituto.Text = MapeoInstituto(AnexoActual);
     txtDeslicitacion.Text = AnexoActual.DesAnexo;
     txtProveedor.Focus();
 }
 public IList<Fallo> ConsultarFallo(Anexo anexo)
 {
     return FalloDao.ConsultarFalloByAnexo(anexo);
 }
 public override void Nuevo()
 {
     AnexoSelect = null;
     lblFecha.Text = String.Format("{0:dd/MM/yyyy}", FalloService.AnexoDao.FechaServidor());
     pgbFallo.EditValue = 0;
     pgbFallo.Text = string.Empty;
     searchLookUpAnexo.EditValue = null;
 }
Exemple #23
0
 private void DgvAnexoRowEnter(object sender, DataGridViewCellEventArgs e)
 {
     var anexos = bsListaAnexo.DataSource as List<Anexo>;
     if (anexos != null) AnexoSelect = anexos[e.RowIndex];
 }