76 lines
2.0 KiB
C#
76 lines
2.0 KiB
C#
using Newtonsoft.Json;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
|
|
namespace NKC_WF.Controllers
|
|
{
|
|
|
|
public class ResponseModel
|
|
{
|
|
public List<queueConf> queueList { set; get; } = new List<queueConf>();
|
|
}
|
|
public class PrintQueueConfController : ApiController
|
|
{
|
|
/// <summary>
|
|
/// Restituisce un array JSon x le conf delle code di stampa
|
|
/// GET: api/PrintQueue
|
|
/// </summary>
|
|
/// <returns>lista oggetto Json in formato SteamwareSDK.queueConf</returns>
|
|
public List<queueConf> Get()
|
|
{
|
|
ResponseModel fullAnsw = new ResponseModel();
|
|
List<queueConf> answ = new List<queueConf>();
|
|
// !!!FIXME!!! per ora hard coded, da usare conf file...
|
|
queueConf currConf;
|
|
string outForm = "EMF";
|
|
string pagWidth = "8.5in";
|
|
string pagHeigth = "11in";
|
|
string margin = "0.5in";
|
|
devInfoParam currDevInfoParam = new devInfoParam(outForm, pagHeigth, pagWidth, margin, margin, margin, margin);
|
|
currConf = new queueConf()
|
|
{
|
|
name = "queueBin",
|
|
template = "BinLabel.rdlc",
|
|
printerName = "Microsoft Print to PDF",
|
|
deviceInfoParam = currDevInfoParam,
|
|
rdsName = "stp_prt_BinLabel"
|
|
};
|
|
answ.Add(currConf);
|
|
currConf = new queueConf()
|
|
{
|
|
name = "queueBunk",
|
|
template = "StackLabel.rdlc",
|
|
printerName = "Microsoft Print to PDF",
|
|
deviceInfoParam = currDevInfoParam,
|
|
rdsName = "stp_prt_StackLabel"
|
|
};
|
|
answ.Add(currConf);
|
|
currConf = new queueConf()
|
|
{
|
|
name = "queueCart",
|
|
template = "CartLabel.rdlc",
|
|
printerName = "Microsoft Print to PDF",
|
|
deviceInfoParam = currDevInfoParam,
|
|
rdsName = "stp_prt_CartLabel"
|
|
};
|
|
answ.Add(currConf);
|
|
fullAnsw.queueList = answ;
|
|
//return fullAnsw;
|
|
return answ;
|
|
}
|
|
|
|
// GET: api/PrintQueue/5
|
|
public string Get(int id)
|
|
{
|
|
return "value";
|
|
}
|
|
|
|
}
|
|
}
|