Пример #1
0
        public Task<HttpResponseMessage> PrintBlankTag(int stationId, BlankTag tagInfo)
        {
            var tcs = new TaskCompletionSource<HttpResponseMessage>();

            try
            {
                DispositionDatabase dbDisposition = new DispositionDatabase();
                var printer = dbDisposition.GetPrinter(stationId);

                string printerName = printer.Location.Trim();
                //string printerName = "\\\\s1vprint01\\HP LaserJet 400 M401 - IT Office";
                //string printerName = "\\\\itlaptopwong\\HP LaserJet 400 M401 - IT Office";

                MultiPrintDocument multiDoc;
                List<PrintDocument> printList = new List<PrintDocument>();

                PrintDocument print = new PrintDocument();
                print.DefaultPageSettings.Landscape = true;
                print.DefaultPageSettings.PaperSize = new PaperSize("Label", 400, 600);

                print.PrintPage += (sender, args) => CreateBlankLabel(tagInfo, args.Graphics);
                print.EndPrint += (sender, args) =>
                {
                    tcs.TrySetResult(new HttpResponseMessage(HttpStatusCode.OK));
                };

                printList.Add(print);

                PrintDocument[] printDocList = new PrintDocument[printList.Count];
                for (int i = 0; i < printList.Count; i++)
                    printDocList[i] = printList[i];

                multiDoc = new MultiPrintDocument(printDocList);
                multiDoc.PrinterSettings.PrinterName = printerName;
                multiDoc.DefaultPageSettings.Landscape = true;
                multiDoc.DefaultPageSettings.PaperSize = new PaperSize("Label", 400, 600);
                multiDoc.DocumentName = "Disposition Tag";

                if (multiDoc.PrinterSettings.IsValid)
                    multiDoc.Print();
                else
                {
                    tcs.TrySetResult(new HttpResponseMessage(HttpStatusCode.RequestTimeout));
                }
            }
            catch (Exception ex)
            {
                tcs.TrySetResult(new HttpResponseMessage(HttpStatusCode.RequestTimeout));
            }

            return tcs.Task;

        }
 public void Put([FromBody]SeatPortion seatPortion)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.UpdateSeatPortion(seatPortion);
 }
 public void Put([FromBody]DefectDetail defectDetail)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.UpdateDefectDetail(defectDetail);
 }
Пример #4
0
 public void Delete(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.DeleteSeatTypeById(id);
 }
Пример #5
0
 public SeatType SeatTypes(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetSeatTypeById(id);
 }
Пример #6
0
 public void SeatSides([FromBody]SeatSide seatSide)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.CreateSeatSide(seatSide);
 }
Пример #7
0
 public void Delete(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.DeleteCommodityById(id);
 }
Пример #8
0
 public void Commodities([FromBody]Commodity commodity)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.CreateCommodity(commodity);
 }
Пример #9
0
 public IEnumerable<Defect> Defects()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetDefects();
 }
Пример #10
0
        public HttpResponseMessage ProcessTransactions(int stationId, [FromBody]List<DispositionTag> dispositionTags)
        {

            try
            {
                DispositionDatabase dbDisposition = new DispositionDatabase();
                //dbDisposition.InsertScrapDispositionDefectHistory(dispositionTags);
                dbDisposition.InsertScrapTransactionBuffer(dispositionTags);
                return new HttpResponseMessage(HttpStatusCode.OK);
            }
            catch (Exception ex)
            {
                return new HttpResponseMessage(HttpStatusCode.Conflict);
            }
        }
Пример #11
0
 public IEnumerable<Printer> Printers()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetPrinters();
 }
Пример #12
0
 public IEnumerable<Responsibility> GetResponsibilities()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetResponsibilities();
 }
Пример #13
0
 public IEnumerable<SeatPortion> GetSeatPortions()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetSeatPortions();
 }
 public void DeleteDefectXrefCommodities([FromBody]Xref_Defects_Commodity reference)
 {
     DispositionDatabase db = new DispositionDatabase();
     db.DeleteDefectXrefCommodity(reference);
 }
 public void DeleteDefectDetailReferenceCommodityDefect(int commodityId, int defectId, int defectDetailId)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.DeleteDefectDetailRefCommodityDefect(commodityId, defectId, defectDetailId);
 }
Пример #16
0
 public IEnumerable<Commodity> Commodities()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetCommodities();
 }
Пример #17
0
 public Commodity Commodities(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetCommodityById(id);
 }
Пример #18
0
 public Defect Defects(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetDefectById(id);
 }
Пример #19
0
 public void Put([FromBody]Commodity commodity)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.UpdateCommodity(commodity);
 }
Пример #20
0
 public void Defects([FromBody]Defect defect)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.CreateDefect(defect);
 }
Пример #21
0
 public IEnumerable<Commodity> GetCommoditiesByDefectId(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetCommoditiesByDefectId(id);
 }
Пример #22
0
 public void Put([FromBody]Defect defect)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.UpdateDefect(defect);
 }
Пример #23
0
 public IEnumerable<SeatType> SeatTypes()
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetSeatTypes();
 }
Пример #24
0
 public void Delete(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.DeleteDefectById(id);
 }
Пример #25
0
 public void Put([FromBody]SeatType seatType)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.UpdateSeatType(seatType);
 }
Пример #26
0
 public void DeleteDefectXrefCommodity(int defectId, int commodityId)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.DeleteDefectXrefCommodity(defectId, commodityId);
 }
Пример #27
0
 public SeatPortion SeatPortions(int id)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     return dbDisposition.GetSeatPortionById(id);
 }
 public void DefectDetails([FromBody]DefectDetail defectDetail)
 {
     DispositionDatabase dbDisposition = new DispositionDatabase();
     dbDisposition.CreateDefectDetail(defectDetail);
 }