Example #1
0
        /// <summary>
        /// Установка CMY цветов
        /// </summary>
        /// <param name="snmpPrinterColorStateModel"></param>
        void saveToDBforColor(SNMPPrinterColorStateModel snmpPrinterColorStateModel)
        {
            if (snmpPrinterColorStateModel != null)
            {
#if DEBUG
                Console.WriteLine("MaxLevelCyan=" + snmpPrinterColorStateModel.MaxLevelCyan);
                Console.WriteLine("TonerRemainingCyan=" + snmpPrinterColorStateModel.TonerRemainingCyan);
                Console.WriteLine("TonerRemainingCyan=" + snmpPrinterColorStateModel.TonerRemainingCyan);
#endif
                POServiceClient proxy = new POServiceClient("NetTCPBinding_IPOService");
                POServiceRef.SNMPPrinterColorStateModel snmpPrinterColorState = new POServiceRef.SNMPPrinterColorStateModel();
                Mapper.CreateMap <SNMPPrinterColorStateModel, POServiceRef.SNMPPrinterColorStateModel>();
                Mapper.Map(snmpPrinterColorStateModel, snmpPrinterColorState);
                proxy.Open();
#if DEBUG
                if (proxy.SetColor(snmpPrinterColorState))
                {
                    Console.WriteLine("Success Color");
                }
                else
                {
                    Console.WriteLine("Failed Color");
                }
#else
                proxy.SetColor(snmpPrinterColorState);
#endif
                proxy.Close();
            }
        }
Example #2
0
        /// <summary>
        /// Save these below parameters to DB
        /// </summary>
        /// <param name="snmpPrinterStateModel"></param>
        void saveToDB(SNMPPrinterStateModel snmpPrinterStateModel)
        {
            if (snmpPrinterStateModel != null)
            {
#if DEBUG
                Console.WriteLine("serialNumber=" + snmpPrinterStateModel.SerialNumber);
                Console.WriteLine("alertMessage=" + snmpPrinterStateModel.AlertMessage);
                Console.WriteLine("contactInfo=" + snmpPrinterStateModel.ContactInfo);
                Console.WriteLine("locationInfo=" + snmpPrinterStateModel.LocationInfo);
                Console.WriteLine("ipAddress=" + snmpPrinterStateModel.IPAddress);
                Console.WriteLine("PageCount=" + snmpPrinterStateModel.PageCount.ToString());
                Console.WriteLine("Uptime=" + snmpPrinterStateModel.Uptime);
                Console.WriteLine("DisplayMessage=" + snmpPrinterStateModel.DisplayMessage);
                Console.WriteLine("Model=" + snmpPrinterStateModel.Model);
#endif
                POServiceClient proxy = new POServiceClient("NetTCPBinding_IPOService");
#if DEBUG
                Console.WriteLine("After");
#endif
                POServiceRef.SNMPPrinterStateModel snmpPrinterState = new POServiceRef.SNMPPrinterStateModel();
                Mapper.CreateMap <SNMPPrinterStateModel, POServiceRef.SNMPPrinterStateModel>();
                Mapper.Map(snmpPrinterStateModel, snmpPrinterState);

                proxy.Open();


#if DEBUG
                if (proxy.SetState(snmpPrinterState))
                {
                    Console.WriteLine("***** Set state is Successed! *************");
                    Console.WriteLine("Success!");
                }
                else
                {
                    Console.WriteLine(" ******  Set state is Failed! ***************");
                    Console.WriteLine("Failed");
                }
#else
                proxy.SetState(snmpPrinterState);
#endif
                proxy.Close();
            }
        }