21 lines
573 B
C#
21 lines
573 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Contracts.BindingModels;
|
|
using IronBarCode;
|
|
|
|
namespace BusinessLogic.BusinessLogic
|
|
{
|
|
public class BarcodeLogic
|
|
{
|
|
public GeneratedBarcode CreateBarcode(ProductBindingModel model, bool save)
|
|
{
|
|
var barCode = IronBarCode.BarcodeWriter.CreateBarcode(model.Id.ToString(), BarcodeEncoding.Code128);
|
|
if (save) return barCode.SaveAsPng($"product{model.Id}.png");
|
|
return barCode;
|
|
}
|
|
}
|
|
}
|