예제 #1
0
        public FileResult ExportExcelcorte(int cotizacion, int?ticket)
        {
            string ti = "";

            if (ticket != null)
            {
                ti = " Ticket no-" + ticket;
            }
            clsCallProcedure procedimiento = new clsCallProcedure();

            String ProcedureName = "[dbo].[sp_ObtenerHojaCorte]";
            Dictionary <String, String> parametros = new Dictionary <String, String>();

            parametros.Add("@IdCotizacion", cotizacion.ToString());
            parametros.Add("@NoTicket", ticket == null ? null : ticket.ToString());



            using (XLWorkbook wb = new XLWorkbook())
            {
                wb.Worksheets.Add(procedimiento.CallDT(ProcedureName, parametros));
                using (MemoryStream stream = new MemoryStream())
                {
                    wb.SaveAs(stream);
                    return(File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Lista de Corte Cotizacion no-" + cotizacion + ti + ".xlsx"));
                }
            }
        }
        public JsonResult ObtenerCatalogo(int IdPieza)
        {
            clsCallProcedure procedimiento = new clsCallProcedure();

            String ProcedureName = "[dbo].[sp_ObtenerCatalogoStandard]";
            Dictionary <String, String> parametros = new Dictionary <String, String>();

            parametros.Add("@IdPieza", IdPieza.ToString());

            return(procedimiento.Call(ProcedureName, parametros));
        }
        public JsonResult ObtenerAuditoria(string CodRA)
        {
            clsCallProcedure procedimiento = new clsCallProcedure();

            String ProcedureName = "[dbo].[sp_ObtenerAuditoria]";
            Dictionary <String, String> parametros = new Dictionary <String, String>();

            parametros.Add("@CodRA", CodRA);

            return(procedimiento.Call(ProcedureName, parametros));
        }
        // GET: Cotizaciones/Details/5


        public FileResult ExportExcelentrega(int cotizacion)
        {
            clsCallProcedure procedimiento = new clsCallProcedure();

            String ProcedureName = "[dbo].[sp_ObtenerHojaEntrega]";
            Dictionary <String, String> parametros = new Dictionary <String, String>();

            parametros.Add("@IdCotizacion", cotizacion.ToString());



            using (XLWorkbook wb = new XLWorkbook())
            {
                wb.Worksheets.Add(procedimiento.CallDT(ProcedureName, parametros));
                using (MemoryStream stream = new MemoryStream())
                {
                    wb.SaveAs(stream);
                    return(File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Lista de Entrega Cotizacion no-" + cotizacion + ".xlsx"));
                }
            }
        }