public IActionResult BarcodeUploading(IFormFile file) { var barcodeService = new BarcodeService(); var barcode = barcodeService.GetBarcode(file); return(RedirectToAction("SearchWithBarcode", new { barcode = barcode })); }
private void Button_Click(object sender, RoutedEventArgs e) { BarcodeService barcodeService = new BarcodeService(); // Create OpenFileDialog Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog(); // Launch OpenFileDialog by calling ShowDialog method Nullable <bool> result = openFileDlg.ShowDialog(); // Get the selected file name and display in a TextBox. // Load content of file in a TextBlock if (result == true) { var barcode = barcodeService.ReadBarcode(openFileDlg.FileName); BarcodeValueLabel.Content = barcode.BarcodeValue; MemoryStream ms = new MemoryStream(); barcodeService.CreateBarcodeImage(barcode).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); BitmapImage image = new BitmapImage(); image.BeginInit(); ms.Seek(0, SeekOrigin.Begin); image.StreamSource = ms; image.EndInit(); BarcodeImage.Source = image; } }
public CameraForm() { InitializeComponent(); this.ShowIcon = false; barcodeService = new BarcodeService(); pictureBox1.Image = FontIcon.CreateGlyphIcon(FontIcon.Glyphs.Camera, iconWidth: 50, iconHeight: 50, emSize: 28, fontColor: Color.Red).ToBitmap(); }
protected override void RunCallback() { CompanyDTO company = null; var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var log = GetLogger(); var now = time.GetAppNowTime(); if (!time.IsBusinessDay(now)) { return; } using (var db = dbFactory.GetRDb()) { company = db.Companies.GetByIdWithSettingsAsDto(CompanyId); } var companyAddress = new CompanyAddressService(company); var quantityManager = new QuantityManager(log, time); var actionService = new SystemActionService(log, time); var addressService = new AddressService(null, companyAddress.GetReturnAddress(MarketIdentifier.Empty()), companyAddress.GetPickupAddress(MarketIdentifier.Empty())); var emailSmtpSettings = SettingsBuilder.GetSmtpSettingsFromCompany(company, AppSettings.IsDebug, AppSettings.IsSampleLabels); var emailService = new EmailService(GetLogger(), emailSmtpSettings, addressService); var cacheService = new CacheService(log, time, actionService, quantityManager); var barcodeService = new BarcodeService(log, time, dbFactory); var itemHistoryService = new ItemHistoryService(log, time, dbFactory); var autoCreateWMListingService = new AutoCreateWalmartListingService(log, time, dbFactory, cacheService, barcodeService, emailService, null, itemHistoryService, AppSettings.IsDebug); var autoCreateEBayListingService = new AutoCreateEBayListingService(log, time, dbFactory, cacheService, barcodeService, emailService, itemHistoryService, AppSettings.IsDebug); var autoCreateAmazonUSPrimeService = new AutoCreateAmazonUSPrimeListingService(log, time, dbFactory, itemHistoryService); //autoCreateWMListingService.CreateListings(); //log.Info("Walmart listings were created"); //autoCreateEBayListingService.CreateListings(); //log.Info("eBay listings were created"); autoCreateAmazonUSPrimeService.CreateListings(); log.Info("Amazon US Prime listings were created"); }
public virtual ActionResult RemoveAttachedSKU(long id) { LogI("RemoveAttachedSKU, id=" + id); BarcodeService.RemoveAttachedSKU(id); return(Json(MessageResult.Success(), JsonRequestBehavior.AllowGet)); }
public void CreateListings() { var cacheService = new CacheService(_log, _time, _actionService, _quantityManager); var barcodeService = new BarcodeService(_log, _time, _dbFactory); var itemHistoryService = new ItemHistoryService(_log, _time, _dbFactory); var listingCreateService = new AutoCreateFtpMarketListingService(_log, _time, _dbFactory, cacheService, barcodeService, _emailService, itemHistoryService, AppSettings.IsDebug); listingCreateService.CreateListings(); }
public IActionResult GetBarcode() { if (HttpContext.Request.Form.Files.Count > 0) { var image = HttpContext.Request.Form.Files.GetFile("file"); var barcodeService = new BarcodeService(); var barcode = barcodeService.GetBarcode(image); return(Content(barcode)); } return(StatusCode(400)); }
private void button1_Click(object sender, EventArgs e) { dataGridView1.EndEdit(); List <string> list = new List <string>(); bool _isTooBig = false; foreach (DataGridViewRow dvgr in dataGridView1.Rows) { if (dvgr.Cells["cSel"].Value != null && (bool)dvgr.Cells["cSel"].Value) { list.Add(dvgr.Cells["cBarcode"].Value.ToString()); int _cnt = int.Parse(dvgr.Cells["cPrintCnt"].Value.ToString()); if (_cnt > 0) { _isTooBig = true; } } } if (list.Count <= 0) { MessageBox.Show("请勾选要打印的条码!"); return; } //如果超过1次,不是管理员就报错 if (_isTooBig && !Global.IsAdmin) { MessageBox.Show("勾选的条码已超过打印次数,请联系管理员!"); return; } InWDetail iw = new InWDetail(); try { foreach (string s in list) { BarcodeService.TSC(s); iw.UpdatePrintCnt(s); } } catch (Exception ex) { MessageBox.Show("打印失败!原因:" + ex.Message); MyLog.WriteLog(ex.Message); } MessageBox.Show("打印结束!"); LoadService(); cbx_All_CheckedChanged(null, null); }
public FileResult Barcode(string type, string code, int width = 250, int height = 100, bool isTrans = false) { Image image = BarcodeService.GenerateStream(code, type, width, height, isTrans); if (image != null) { MemoryStream ms = new MemoryStream(); image.Save(ms, ImageFormat.Png); return(File(ms.ToArray(), "image/png")); } else { return(File("/images/barcode_error.jpg", "image/jpeg")); } }
public CallGrouponProcessing(IDbFactory dbFactory, ICacheService cacheService, IEmailService emailService, ILogService log, ITime time) { _dbFactory = dbFactory; _log = log; _time = time; _weightService = new WeightService(); var barcodeService = new BarcodeService(log, time, dbFactory); var itemHistoryService = new ItemHistoryService(log, time, dbFactory); _autoCreateListingService = new AutoCreateNonameListingService(_log, _time, dbFactory, cacheService, barcodeService, emailService, itemHistoryService, AppSettings.IsDebug); }
public void GenerateOrderBarcodes(Order order) { try { var orderLines = order.OrderLines; if (orderLines == null || orderLines.Count <= 0) { return; } foreach (var orderline in orderLines) { var orderLineGenerateBarCodes = CheckoutService.GetOrderLineGeneratedBarcodes(orderline); for (var y = 0; y < orderline.TicketQuantity; y++) { if (orderLineGenerateBarCodes != null && orderLineGenerateBarCodes.Count != 0) { continue; } var ticket = (orderline.Ticket == null && orderline.TicketId != null)? TicketService.GetTicketById(orderline.TicketId.Value.ToString()) : orderline.Ticket; var barcode = BarcodeService.GetNextBarcode(ticket, orderline.TicketType).Substring(0, 12); var orderlineGeneratedBarcode = new OrderLineGeneratedBarcode { OrderLineId = orderline.Id, GeneratedBarcode = barcode + CalculateBarcodeChecksum(barcode.Substring(0, 12)), DateCreated = DateTime.Now }; CheckoutService.SaveOrderLineBarCode(orderlineGeneratedBarcode); } } } catch { Log("***Exception : GenerateOrderBarcodes for the current orderid:" + order.Id); } }
private Prescription CreatePrescription(NewPrescription data) { return(new Prescription { IdNumber = data.PresciptionId, CreationDate = DateTime.Now, Drugs = data.Drugs, ForPatient = data.For, IdNumberBarcode = BarcodeService.GetBarcode(data.PresciptionId), NfzWardId = data.NfzWardId, Permission = data.Permission, PrescribedByCompany = data.Company, PrescribedByCompanyBarcode = BarcodeService.GetBarcode(data.Company), PrescribedByDoctor = data.By, ValidFrom = data.ValidFrom, PlacedBy = data.PlacedBy }); }
private List <VoucherTicket> MakeVoucherTicketWithBarcode(OrderLine orderLine) { if (orderLine.TicketId == null) { return(null); } var allTickets = new List <VoucherTicket>(); var ticket = TicketService.GetTicketById(orderLine.TicketId.Value.ToString()); var microsite = SiteService.GetMicroSiteById(orderLine.MicrositeId); var validTicketName = ticket.Name.ToLower().Contains(microsite.Name.ToLower()) ? ticket.Name : string.Concat(microsite.Name, " ", ticket.Name); var orderlineGeneratedBarcodes = BarcodeService.GetOrderLineGeneratedBarcodes(orderLine.Id.ToString()); if (orderlineGeneratedBarcodes == null || !orderlineGeneratedBarcodes.Any()) { return(null); } foreach (var barcode in orderlineGeneratedBarcodes) { var barcodePath = BarCodeDir + barcode.GeneratedBarcode + ".jpg"; ImageService.DoesBarCodeImageExist(barcode.GeneratedBarcode, Server.MapPath(barcodePath)); allTickets.Add( new VoucherTicket { UseQrCode = false, OrderLines = new List <OrderLine> { orderLine }, Ticket = ticket, BarCodeFixQuantity = 1, BarCodeImageUrl = barcodePath, ValidTicketName = validTicketName, BarCode = barcode.GeneratedBarcode } ); } return(allTickets); }
public static void Process() { List <Result> results = new List <Result>(); List <Catalog> catalogA, catalogB; List <SupplierProductBarcode> barcodesA, barcodesB; //Returns the tupls of catalog, first item is CatalogA and second item is CatalogB var catalog = CatalogService.GetCatalogData(); //Returns the tupls of barcodes, first item is BarcodeA and second item is BarcodeB var barcode = BarcodeService.GetBarcodeData(); catalogA = catalog.catalogA; catalogB = catalog.catalogB; barcodesA = barcode.barcodeA; barcodesB = barcode.barcodeB; CatalogService.LoadCatalogData(catalogA, barcodesA, "A", ref results); //Load catalog data into result from catalog A, avoid duplicate CatalogService.LoadCatalogData(catalogB, barcodesB, "B", ref results); //Load catalog data into result from catalog B, avoid duplicate var output = results.Select(p => new { p.SKU, p.Description, p.Source }); //select required fields only from merged list FileService.WriteCSV(output); //Write the data into output file }
public ApplicationManager() { InitializeComponent(); barcodeService = new BarcodeService(); notifyIcon1.Text = AssemblyService.AssemblyProduct; notifyIcon1.Icon = Icon; SetupToolStripMenuItem(); toolStripMenuItem1.Click += ToolStripMenuItem1_Click; toolStripMenuItem2.Click += ToolStripMenuItem2_Click; toolStripMenuItem3.Click += ToolStripMenuItem3_Click; toolStripMenuItem4.Click += ToolStripMenuItem4_Click; settings.PropertyChanged += Settings_PropertyChanged; Disposed += ApplicationManager_Disposed; }
public CallDsApiProcessing(ILogService log, ITime time, ICacheService cacheService, IQuantityManager quantityManager, ISystemActionService actionService, IEmailService emailService, IDbFactory dbFactory) { _dbFactory = dbFactory; _cacheService = cacheService; _quantityManager = quantityManager; _actionService = actionService; _barcodeService = new BarcodeService(log, time, dbFactory); _log = log; _time = time; _emailService = emailService; var itemHistoryService = new ItemHistoryService(_log, _time, _dbFactory); var barcodeService = new BarcodeService(log, time, dbFactory); _autoCreateListingService = new AutoCreateNonameListingService(_log, _time, dbFactory, cacheService, barcodeService, emailService, itemHistoryService, AppSettings.IsDebug); }
public static async Task <Response> getBarcodeDetail() { Response oResponse = null; try { var scanner = new ZXing.Mobile.MobileBarcodeScanner(); var result = await scanner.Scan(); if (result == null) { return(null); } //ScanResult = result.Text; oResponse = await BarcodeService.getBarcodeData(result.Text); } catch (Exception ex) { } return(oResponse); }
//Import with settings public FileImportEntity ImportProducts(Stream stream, int settingId, string columnCode, string columnName, string categoryName) { var fileImport = new FileImportEntity(); try { var settingEntity = _settingRepository.GetById(settingId); if (settingEntity == null) { return(fileImport); } _closedXmlReader = new ClosedXmlReader(stream); int invalidCount = 0; _closedXmlReader.UpdateDictMap(columnCode, columnName, categoryName); var productList = _closedXmlReader.ToProductList(ref invalidCount); fileImport.ProductCount = productList.Count; fileImport.FileSize = stream.Length; if (productList.Count > invalidCount) { fileImport.Status = true; var barcodeService = new BarcodeService(settingEntity); int iSaveCount = 0; foreach (var product in productList) { //Check exist productCode product.SettingId = settingId; var productExist = _productRepository.Get( c => c.SettingId == product.SettingId && c.ProductCode == product.ProductCode); if (productExist == null || string.IsNullOrWhiteSpace(productExist.Barcode)) { barcodeService.UpdateBarcode(product); if (productExist == null) { _productRepository.Add(product); } else { productExist.Barcode = product.Barcode; productExist.JsonData = product.JsonData; productExist.Name = product.Name; productExist.Status = product.Status; _productRepository.Update(productExist); } iSaveCount++; if (iSaveCount % 200 == 0) { _unitOfWork.Commit(); } } } fileImport.SuccessCount = iSaveCount; _unitOfWork.Commit(); return(fileImport); } } catch (Exception ex) { // } return(fileImport); }
void ExecuteSaveCommand() { BarcodeService.SaveBarcode(ResultText, ResultFormat); Toast.ShortAlert("Saved"); }
async Task ExecuteShareCommandAsync() { await BarcodeService.ShareBarcodeAsync(ResultText, ResultFormat); }
public BarcodeViewModel() { _service = new BarcodeService(); }