internal Reciept Reciept(string RecieptNumber, string Selection)
        {
            Reciept Reciept = null;

            if (POSConnection.State != System.Data.ConnectionState.Open)
            {
                POSConnection.Open();
                SqlCommand command = new SqlCommand(SQL_RECIEPT_DETAILS, POSConnection);
                command.Parameters.AddWithValue("@RECEIPTID", RecieptNumber);
                command.Parameters.AddWithValue("@SELECTION", Selection);
                SqlDataReader reader   = command.ExecuteReader();
                RecieptItem   tempItem = null;
                int           i        = 0;
                while (reader.Read())
                {
                    i++;
                    if (i == 1)
                    {
                        Reciept = new Reciept();
                        Reciept.TransactionID   = reader.GetString(0);
                        Reciept.RecieptID       = reader.GetString(1);
                        Reciept.Store           = reader.GetString(2);
                        Reciept.Staff           = reader.GetString(3);
                        Reciept.StaffName       = reader.GetString(4);
                        Reciept.TransactionDate = reader.GetDateTime(5);
                    }
                    try
                    {
                        tempItem             = new RecieptItem();
                        tempItem.LineNumber  = (int)reader.GetDecimal(6);
                        tempItem.ItemId      = reader.GetString(7);
                        tempItem.Quantity    = (int)reader.GetDecimal(8);
                        tempItem.NetAmount   = reader.GetDecimal(9);
                        tempItem.Description = reader.GetString(10);
                        tempItem.Barcode     = reader.GetString(11);
                        Reciept.Add(tempItem);
                    }
                    catch (Exception ex) { throw ex; }
                }
                reader.Close();
            }
            return(Reciept);
        }
Exemple #2
0
 public byte[] TestQrcode(string qrcode) => Reciept = Reciept
                                                      .Add(SelectJustification(Justification.Center),
                                                           PrintQRCode(qrcode, qrCodeSize: QRCodeSize.Large),
                                                           CarriageReturn,
                                                           CarriageReturn,
                                                           CarriageReturn);
Exemple #3
0
        byte[] RecieptFontA()
        {
            var lineA = new string('-', FontAColumn).ToBytes();

            Reciept = Reciept.Add(
                Fiş.Firma.Bitmap.Getlogo(ImageMultiplier),
                SelectPrintMode(PrintMode.EmphasizedOn),
                SelectJustification(Justification.Center),
                LF,
                string.Join("\n", Wrap(Fiş.Firma.Ünvan, FontAColumn)).ToBytes(),
                SelectPrintMode(PrintMode.Reset),
                LF,
                string.Join("\n", Wrap(Fiş.Firma.Adress, FontAColumn)).ToBytes(),
                LF,
                string.Join("\n", Wrap(Fiş.Firma.Tel, FontAColumn)).ToBytes(),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                PrintBarCode(BarCodeType.CODE128, Fiş.Firma.Barcode, 54),
                Fiş.Firma.Barcode.ToBytes(),
                LF,
                lineA,
                LF,
                SelectJustification(Justification.Left),
                "Müşteri Bilgileri".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Wrap($"Adı Soyadı:{Fiş.Müşter.AdSoyad}", FontAColumn)).ToBytes(),
                LF,
                string.Join("\n", Wrap($"Telefon   :{Fiş.Müşter.Tel}", FontAColumn)).ToBytes(),
                LF,
                string.Join("\n", Wrap($"Adres     :{Fiş.Müşter.Adress}", FontAColumn)).ToBytes(),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                "Ziyaret Bilgileri".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Wrap($"İşlem / Teslim Tarihi:{Fiş.Ziyaret.TeslimTarihi}", FontAColumn)).ToBytes(),
                LF,
                string.Join("\n", Wrap($"İşlem Bitiş Zamanı   :{Fiş.Ziyaret.BitişZamanı}", FontAColumn)).ToBytes(),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                "Müşteri Şikayeti".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Wrap($"{Fiş.Müşter.Şikayet}", FontAColumn)).ToBytes(),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                "Ürün Bilgileri".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Fiş.Ürün.ÜrünBilgileri
                            .Select(x => string.Format("{0}\n", string.Join("\n", Wrap(x, FontAColumn)))).ToArray()).ToBytes(),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                "Ücret Bilgileri".ToBytes(),
                LF, LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Fiş.Ücret.Bilgiler.Select(x => string.Format("{0,-19}{1,10:N2} TL\n", x.Servis, x.Fiyat)).ToArray()).ToBytes(),
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                SelectJustification(Justification.Right), "Toplam".ToBytes(),
                LF,
                string.Format("{0:N2} TL", Fiş.Ücret.Bilgiler.Sum(x => x.Fiyat)).ToBytes(),
                LF,
                lineA,
                LF,
                SelectJustification(Justification.Left),
                "Teknisyen Adı ve İmzası".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Wrap($"{Fiş.Teknisyen.AdSoyad}", FontAColumn)).ToBytes(),
                LF,
                Fiş.Teknisyen.Bitmap.Getlogo(ImageMultiplier),
                LF,
                lineA,
                LF,
                SelectPrintMode(PrintMode.EmphasizedOn),
                "Müşteri Adı ve İmzası".ToBytes(),
                LF,
                SelectPrintMode(PrintMode.Reset),
                string.Join("\n", Wrap($"{Fiş.Müşter.AdSoyad}", FontAColumn)).ToBytes(),
                LF,
                Fiş.Müşter.Bitmap.Getlogo(ImageMultiplier),
                LF,
                lineA,
                LF, LF,
                SelectJustification(Justification.Center),
                string.Join("\n", Wrap(Fiş.Firma.Adress, FontAColumn)).ToBytes(),
                LF,
                string.Join("\n", Wrap(Fiş.Firma.Tel, FontAColumn)).ToBytes(),
                LF,
                PrintQRCode(Fiş.Firma.Barcode, QRCodeModel.Model2, QRCodeCorrection.Percent30, QRCodeSize.Large),
                LF,
                CarriageReturn,
                CarriageReturn,
                CarriageReturn
                );


            return(Reciept);
        }