Пример #1
0
        public ActionResult GetAllProveedores(int page, int start, int limit, string sort, string dir, long _dc, string callback, string condicion = null, string codigo = null)
        {
            var filter = new PagingInfo
            {
                page     = page,
                start    = start,
                limit    = limit,
                sort     = sort,
                dir      = dir,
                _dc      = _dc,
                callback = callback,
                search   = condicion
            };
            var service  = new ProveedoresService();
            var jsondata = service.GetAllProveedores(filter, codigo);
            JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
            string callback1 = callback + "(" + javaScriptSerializer.Serialize(jsondata) + ");";

            return(JavaScript(callback1));
        }
Пример #2
0
        internal void LoadFiltro(int nIdFactCab, string reporte, bool facturaHoras = false)
        {
            idFactura            = nIdFactCab;
            configuracionUsuario = repoUsuario.GetConfiguracionUsuario(VariablesGlobales.nIdUsuarioActual) ?? new ConfiguracionUsuario();
            configuracionEmpresa = repoEmpresa.GetConfiguracionEmpresa(VariablesGlobales.nIdEmpresaActual) ?? new ConfiguracionEmpresa();

            tbAsuntoMensaje.Text = configuracionEmpresa.asuntoEnvioFacturas;
            tbCuerpoMensaje.Text = configuracionEmpresa.CuerpoEnvioFacturas;

            this.WindowState = FormWindowState.Maximized;
            this.reportViewer1.LocalReport.ReportEmbeddedResource = reporte;

            //this.GestoresTableAdapter.FillByConEmail(this.Promowork_dataDataSet.Gestores, VariablesGlobales.nIdEmpresaActual);

            // TODO: This line of code loads data into the 'Promowork_dataDataSet.PresupuestoActual' table. You can move, or remove it, as needed.
            this.FacturasDetImpTableAdapter.FillByFactura(this.Promowork_dataDataSet.FacturasDetImp, nIdFactCab);
            this.FacturasCabImpTableAdapter.FillByFactura(this.Promowork_dataDataSet.FacturasCabImp, nIdFactCab);
            this.vComprasDirectasTableAdapter.FillByFactura(this.DatosPresupuestos.vComprasDirectas, nIdFactCab);
            this.FacturasDetHorasImpTableAdapter.FillbyFactura(this.Promowork_dataDataSet.FacturasDetHorasImp, nIdFactCab);
            // TODO: This line of code loads data into the 'Promowork_dataDataSet.EmpresasActual' table. You can move, or remove it, as needed.
            this.empresasPoblacion.FillByEmpresa(this.Promowork_dataDataSet.EmpresasPoblacion, VariablesGlobales.nIdEmpresaActual);
            //this.empresasTableAdapter.FillByEmpresa(this.Promowork_dataDataSet.Empresas, VariablesGlobales.nIdEmpresaActual);

            factura = (DataRowView)FacturasCabImpBindingSource.Current;

            tbCliente.Text = factura["DesCliente"].ToString();

            var trabajadores = repoTrabajador.GetTrabajadoresConEmail(VariablesGlobales.nIdEmpresaActual);

            cbTrabajadores.Properties.DataSource = trabajadores;
            cbTrabajadores.EditValue             = configuracionUsuario.responderASeleccionado;

            ProveedoresService servicioProveedores = new ProveedoresService();
            var gestores = servicioProveedores.ObtenerGestoresConEmail(VariablesGlobales.nIdEmpresaActual, true);

            cbGestor.Properties.DataSource = gestores;
            cbGestor.EditValue             = configuracionUsuario.gestorSeleccionado;

            RellenaEmailCliente();

            //
            // reportViewer1
            //
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource11 = new Microsoft.Reporting.WinForms.ReportDataSource();
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource12 = new Microsoft.Reporting.WinForms.ReportDataSource();
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource13 = new Microsoft.Reporting.WinForms.ReportDataSource();
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource14 = new Microsoft.Reporting.WinForms.ReportDataSource();
            Microsoft.Reporting.WinForms.ReportDataSource reportDataSource15 = new Microsoft.Reporting.WinForms.ReportDataSource();

            reportDataSource11.Name = "DataSet1";
            if (facturaHoras)
            {
                reportDataSource11.Value = this.FacturasDetHorasImpBindingSource;
            }
            else
            {
                reportDataSource11.Value = this.FacturasDetImpBindingSource;
            }
            reportDataSource12.Name  = "DataSet2";
            reportDataSource12.Value = this.empresasPoblacionBindingSource;
            reportDataSource13.Name  = "DataSet3";
            reportDataSource13.Value = this.FacturasCabImpBindingSource;
            reportDataSource14.Name  = "ComprasDirectas";
            reportDataSource14.Value = this.vComprasDirectasBindingSource;
            reportDataSource15.Name  = "DetallesHoras";
            reportDataSource15.Value = this.FacturasDetHorasImpBindingSource;
            this.reportViewer1.LocalReport.DataSources.Add(reportDataSource11);
            this.reportViewer1.LocalReport.DataSources.Add(reportDataSource12);
            this.reportViewer1.LocalReport.DataSources.Add(reportDataSource13);
            this.reportViewer1.LocalReport.DataSources.Add(reportDataSource14);
            this.reportViewer1.LocalReport.DataSources.Add(reportDataSource15);



            DateTime Fecha = (DateTime)factura["FechaFactura"];

            nombreFactura = factura["NumFactura"].ToString() + "-" + Fecha.Year.ToString() + " " + factura["DesCliente"].ToString();
            this.Text     = nombreFactura;
            this.reportViewer1.LocalReport.DisplayName          = nombreFactura;
            this.reportViewer1.LocalReport.EnableExternalImages = true;
            this.reportViewer1.RefreshReport();
        }