コード例 #1
0
        public new void InitValues()
        {
            base.InitValues();

            Device dev = GetDevice();

            if (deviceAddress == null)
            {
                if (dev != null)
                {
                    deviceAddress = dev.address.ToString();
                }
            }

            if (modelName == null)
            {
                if (dev != null)
                {
                    modelName = dev.model;
                }
            }

            if (dev != null)
            {
                Client cli = dev.GetClient();
                if (cli != null)
                {
                    clientName = cli.name;
                }
            }
        }
コード例 #2
0
        public string GetTextToPrint()
        {
            Device  device = GetDevice();
            Client  client;
            Address address;

            if (device != null)
            {
                client = device.GetClient();
                if (client != null)
                {
                    address = client.GetAddress();
                }
                else
                {
                    address = new Address();
                }
            }
            else
            {
                device  = new Device();
                client  = new Client();
                address = new Address();
            }


            string newLine     = "\r\n";
            string textToPrint =
                "Klient: " + client.name + " NIP: " + client.NIP + newLine +
                "Data: " + datetime.ToString(Forms.Style.DateTimeFormat) + newLine +
                "Numer Seryjny: " + serial_number + newLine +
                "Producent: " + device.provider + newLine +
                "Model: " + device.model + newLine +
                "Adres: " + address.street + " " + address.house_number + "/" + address.apartment + " " + address.city + newLine +
                "Licznik Skanowań: " + scan_counter + newLine +
                "Licznik Czarno-Białe: " + print_counter_black_and_white + newLine +
                "Licznik Kolorowe: " + print_counter_color + newLine +
                "Toner Cyjan: " + tonerlevel_c + newLine +
                "Toner Magenta: " + tonerlevel_c + newLine +
                "Toner Yellow: " + tonerlevel_m + newLine +
                "Toner Black: " + tonerlevel_k + newLine;

            if (parsed_by_email)
            {
                textToPrint += GetEmail().GetEmail();
            }

            return(textToPrint);
        }
コード例 #3
0
        public void InitValues()
        {
            Device dev = GetDevice();

            if (deviceAddress == null)
            {
                if (dev != null)
                {
                    deviceAddress = dev.address.ToString();
                }
            }

            if (modelName == null)
            {
                if (dev != null)
                {
                    modelName = dev.model;
                }
            }

            if (dev != null)
            {
                Client cli = dev.GetClient();
                if (cli != null)
                {
                    clientName = cli.name;
                }
            }

            if (tonerlevel_c != null)
            {
                tonerLowLever_C = tonerlevel_c.Contains("0-25%");
            }
            if (tonerlevel_m != null)
            {
                tonerLowLever_M = tonerlevel_m.Contains("0-25%");
            }
            if (tonerlevel_y != null)
            {
                tonerLowLever_Y = tonerlevel_y.Contains("0-25%");
            }
            if (tonerlevel_k != null)
            {
                tonerLowLever_K = tonerlevel_k.Contains("0-25%");
            }
        }