示例#1
0
        public BaseResult <SMSSendResult> Send(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.SMS sms    = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base"));
            BaseResult <SMSSendResult>   result = null;

            result = sms.Send(param.TryGet <string>("message"), param.TryGet <string>("number"));
            if (result != null)
            {
                result.ID = param.TryGet <string>("id");

                IInternalLogging logging    = ObjectPool.Instance.Resolve <IInternalLogging>();
                ISMSLogging      smsLogging = ObjectPool.Instance.Resolve <ISMSLogging>();

                if (logging != null)
                {
                    logging.Write(result);
                }
                if (smsLogging != null)
                {
                    smsLogging.Send(result);
                }
            }

            return(result);
        }
示例#2
0
        public bool SetRawXml(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMServer.Configuration.IConfiguration config = ObjectPool.Instance.Resolve <GSMServer.Configuration.IConfiguration>();
            string section = param.TryGet <string>("section");
            string raw     = param.TryGet <string>("raw");

            return(config.SetRawXml(section, raw));
        }
示例#3
0
        public BaseResult <GenericTypeResult <List <string> > > GetPossibleCharacterSet(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <List <string> > > result = basic.GetPossibleCharacterSet();

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
示例#4
0
        public BaseResult <GenericTypeResult <bool> > SetErrorMessageFormat(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <bool> > result = basic.SetErrorMessageFormat(param.TryGet <int>("format"));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
示例#5
0
        public BaseResult <GenericTypeResult <bool> > SetFunctionality(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <bool> > result = basic.SetFunctionality((FunctionalityLevel)Convert.ToInt32(param.TryGet <string>("level")));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
示例#6
0
        public BaseResult <GenericTypeResult <bool> > WritePhoneBook(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.PhoneBook     pb     = new GSMCommunication.Feature.PhoneBook(param.TryGet <BasicInformation>("base"));
            BaseResult <GenericTypeResult <bool> > result = pb.WritePhoneBook(param.TryGet <string>("memory"), param.TryGet <string>("index"), param.TryGet <string>("name"), param.TryGet <string>("phonenumber"));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
示例#7
0
        public BaseResult <USSDResult> SendUSSD(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.Call call   = new GSMCommunication.Feature.Call(param.TryGet <BasicInformation>("base"));
            BaseResult <USSDResult>       result = call.SendUSSD(param.TryGet <string>("code"), param.TryGet <string>("number"));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
示例#8
0
        public BaseResult <GenericTypeResult <bool> > Delete(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.SMS           sms    = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base"));
            BaseResult <GenericTypeResult <bool> > result = sms.Delete(param.TryGet <int>("index"));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }

            return(result);
        }
示例#9
0
        public List <BaseResult <SMSReadResult> > Read(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.SMS       sms  = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base"));
            List <BaseResult <SMSReadResult> > list = sms.Read(SMSStatus.ReceivedUnreadMessage);

            IInternalLogging logging    = ObjectPool.Instance.Resolve <IInternalLogging>();
            ISMSLogging      smsLogging = ObjectPool.Instance.Resolve <ISMSLogging>();

            if (logging != null)
            {
                logging.Write(list);
            }
            if (smsLogging != null)
            {
                smsLogging.Read(list);
            }

            return(list);
        }