Exemplo n.º 1
0
        public static bool SendSMSForSO(int soSysNo, SMSType smsType)
        {
            SOInfo            soInfo               = SOService.GetSOInfo(soSysNo);
            CustomerBasicInfo customerInfo         = CustomerService.GetCustomerInfo(soInfo.CustomerSysNo);
            string            customerLanguageCode = customerInfo.LanguageCode;

            var sms        = CommonDA.GetShipTypeSMSInfo(soInfo.ShipType.ShipTypeSysNo, smsType, null);
            var smsContent = sms.SMSContent;

            if (string.IsNullOrEmpty(smsContent))
            {
                return(false);
            }
            string mobilePhone = string.Empty;

            if (!string.IsNullOrEmpty(soInfo.ReceiveCellPhone))
            {
                mobilePhone = soInfo.ReceiveCellPhone;
            }
            else
            {
                mobilePhone = soInfo.ReceivePhone;
            }

            if (smsContent.IndexOf("SO#") != -1)
            {
                smsContent = smsContent.Replace("SO#", soInfo.SOSysNo.ToString());
            }
            else
            {
                return(false);
            }

            return(SendSMS(mobilePhone, smsContent, SMSPriority.Normal));
        }