コード例 #1
0
        public Stream RetrieveFile(int cotizacionId)
        {
            if (WebOperationContext.Current == null)
            {
                throw new Exception("WebOperationContext not set");
            }

            FormatoCotizacionLogic cotizacion = new FormatoCotizacionLogic();

            // As the current service is being used by a windows client, there is no browser interactivity.
            // In case you are using the code Web, please use the appropriate content type.
            string path = cotizacion.BuildFormatoCotizacion(cotizacionId);//@"C:\Temp\PlantillasWord\Documento2222.docx";
            //string path = @"C:\temp\PlantillasWord\Documento2222.docx";
            var fileName = Path.GetFileName(path);

            WebOperationContext.Current.OutgoingResponse.ContentType = "application/octet-stream";
            WebOperationContext.Current.OutgoingResponse.Headers.Add("content-disposition", "inline; filename=" + fileName);

            return(File.OpenRead(path));
        }
コード例 #2
0
        public IEnumerable <ParametroCotizacion> GetParametrosFormatoCotizacion(int cotizacionId)
        {
            var parametros = new FormatoCotizacionLogic().GetParametrosFormato(cotizacionId);

            return(parametros);
        }
コード例 #3
0
        public void GuardarParametrosFormato(IEnumerable <ParametroCotizacion> parametrosFormato)
        {
            FormatoCotizacionLogic formatoLogic = new FormatoCotizacionLogic();

            formatoLogic.GuardarParametrosFormato(parametrosFormato);
        }