Beispiel #1
0
        public async Task <QRCodeDataObject> Add(QRCodeDataObject qrcode)
        {
            QRCode code = DyMapper.Map <QRCodeDataObject, QRCode>(qrcode);

            await this.repository.Add(code);

            await this.repository.Commit();

            return(DyMapper.Map <QRCode, QRCodeDataObject>(code));
        }
Beispiel #2
0
        private static void HttpCommunicator_Error(object sender, DyEventArgs e)
        {
            string receive = Encoding.ASCII.GetString(e.Data);
            string content = receive.Split("&")[0];
            string line    = receive.Split("&")[1];

            Console.WriteLine($"{e.Message}\n{content},{line}");
            QRCodeDataObject code = new QRCodeDataObject();

            code.Code         = content;
            code.AssemblyLine = line;
            code.CreateTime   = DateTime.Now;
            qrCodeService.Add(code);
        }
Beispiel #3
0
        private static void Scaner_Received(byte[] buf)
        {
            string str = Encoding.ASCII.GetString(buf);

            Console.WriteLine(str);
            if (str.Contains("ER") || str.Contains("OK"))
            {
                Console.WriteLine(str);
                return;
            }
            QRCodeDataObject code = new QRCodeDataObject();

            code.Code         = str;
            code.AssemblyLine = AppConfig.ASSEMBLY_LINE;
            code.CreateTime   = DateTime.Now;
            qrCodeService.Add(code);
            //Console.WriteLine(code.ToURLParameter());
            //byte[] data = Encoding.UTF8.GetBytes(code.ToURLParameter());
            //httpCommunicator.Send(data);
        }
 public async Task <QRCodeDataObject> Add(QRCodeDataObject data)
 {
     return(await this.qrcodeService.Add(data));
 }