Beispiel #1
0
        public void FormatoCotizacionPrv(Cotizacionprv cotizacionprv)
        {
            var tipocp = Service.GetTipocp(x => x.Idtipocp == cotizacionprv.Idtipocp);

            const string nameRelation = "compras.vwcotizacionprvimpresion";
            string       whereList    = string.Format("idcotizacionprv = {0}", cotizacionprv.Idcotizacionprv);
            const string ordersList   = "numeroitem";
            const string fieldsList   = "*";

            DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList);

            if (string.IsNullOrEmpty(tipocp.Nombrereporte))
            {
                XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                return;
            }

            var report = new Report();


            string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Compras\\{0}", tipocp.Nombrereporte.Trim()));

            report.Load(nameReporte);
            report.RegisterData(dt, "ctp");
            report.RegisterData(VwSucursalList, "emp");

            ReportHelper1 reportHelper1 = new ReportHelper1(report);

            reportHelper1.ShowDialog();
        }
Beispiel #2
0
        private void InicioTipoMantenimiento()
        {
            switch (TipoMnt)
            {
            case TipoMantenimiento.Nuevo:
                pkIdEntidad.EditValue = IdEntidadMnt;
                CargarReferencias();
                ValoresPorDefecto();
                btnEliminar.Enabled   = false;
                btnActualizar.Enabled = false;
                CotizacionprvMnt      = new Cotizacionprv();
                CargarDetalle();
                break;

            case TipoMantenimiento.Modificar:
                pkIdEntidad.EditValue = IdEntidadMnt;
                CargarReferencias();
                TraerDatos();
                CargarDetalle();
                EstadoReferenciaCuadroComparativo();
                break;
            }
        }
Beispiel #3
0
 public void UpdateCotizacionprv(Cotizacionprv entity)
 {
     CotizacionprvDao.Update(entity);
 }
Beispiel #4
0
 public int SaveCotizacionprv(Cotizacionprv entity)
 {
     return(CotizacionprvDao.Save(entity));
 }
Beispiel #5
0
        private void bmMantenimiento_ItemClick(object sender, ItemClickEventArgs e)
        {
            var subMenu = e.Item as BarSubItem;

            if (subMenu != null)
            {
                return;
            }
            switch (e.Item.Name)
            {
            case "btnNuevo":
                LimpiarCampos();

                TipoMnt = TipoMantenimiento.Nuevo;

                IdEntidadMnt          = 0;
                pkIdEntidad.EditValue = 0;

                CotizacionprvMnt = null;
                CotizacionprvMnt = new Cotizacionprv();

                btnGrabar.Enabled       = true;
                btnGrabarCerrar.Enabled = true;
                btnGrabarNuevo.Enabled  = true;

                btnEliminar.Enabled   = false;
                btnActualizar.Enabled = false;

                ValoresPorDefecto();

                if (Permisos.Nuevo)
                {
                    CamposSoloLectura(false);
                }
                break;

            case "btnGrabar":
                if (Guardar())
                {
                    SeGuardoObjeto = true;
                    //btnGrabar.Enabled = false;
                    //btnGrabarCerrar.Enabled = false;
                    btnGrabarNuevo.Enabled = false;

                    if (IdEntidadMnt > 0)
                    {
                        TipoMnt = TipoMantenimiento.Modificar;
                    }

                    if (Permisos.Eliminar)
                    {
                        btnEliminar.Enabled   = true;
                        btnActualizar.Enabled = true;
                    }
                    DeshabilitarModificacion();
                }
                break;

            case "btnImportarReq":
                ImportarItems();
                break;

            case "btnGrabarCerrar":
                if (Guardar())
                {
                    SeGuardoObjeto = true;
                    DialogResult   = DialogResult.OK;
                }
                break;

            case "btnEliminar":
                EliminaRegistro();
                break;

            case "btnLimpiarCampos":
                LimpiarCampos();
                break;

            case "btnActualizar":
                if (IdEntidadMnt > 0)
                {
                    TraerDatos();
                    CargarDetalle();
                }
                break;

            case "btnCerrar":
                if (SeGuardoObjeto)
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    CotizacionprvMnt = null;
                    DialogResult     = DialogResult.OK;
                }
                break;

            case "btnImprimir":
                if (ImpresionFormato == null)
                {
                    ImpresionFormato = new ImpresionFormato();
                }
                if (IdEntidadMnt > 0)
                {
                    ImpresionFormato.FormatoCotizacionPrv(CotizacionprvMnt);
                }
                break;
            }
        }