Beispiel #1
0
        public static MQHelper getInstance()
        {
            SystemConfigService         service = new SystemConfigService();
            Dictionary <String, Object> configs = service.getConfigs();

            try
            {
                String shopcode = configs["shopcode"].ToString();
                String poscode  = configs["poscode"].ToString();
                String queues   = configs["queues"].ToString();
                String mqaddr   = configs["mqaddr"].ToString();
                return(getInstance(shopcode, poscode, mqaddr, queues));
            }catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
Beispiel #2
0
        public static MQCustomer getInstance()
        {
            SystemConfigService         service = new SystemConfigService();
            Dictionary <String, Object> configs = service.getConfigs();

            try
            {
                String shopcode = configs["shopcode"].ToString();
                String poscode  = configs["poscode"].ToString();
                String mqaddr   = configs["mqaddr"].ToString();
                return(getInstance(shopcode, poscode, mqaddr));
            }
            catch (Exception e)
            {
                logger.Debug("Get MQCustomer error:" + e);
                return(null);
            }
        }
Beispiel #3
0
        public static Boolean Init()
        {
            SystemConfigService         service = new SystemConfigService();
            Dictionary <String, Object> con     = service.getConfigs();

            try
            {
                con[SHOP_CODE].ToString();
                con[SHOP_NAME].ToString();
                con[POS_CODE].ToString();
                con[POS_NAME].ToString();
                con[SERVER_ADDRESS].ToString();
                con[MQ_ADDRESS].ToString();
                con[ORDER_QUEUE].ToString();
                con[POS_ID].ToString();
                configs = con;
            }
            catch (Exception e)
            {
                return(false);
            }

            return(true);
        }