Example #1
0
        public static bool SendPostalCodeSms(SmsSenderAgentReference smsSenderAgentRefrence, Guid userGuid, Guid smsSentGuid,
                                             int recipientNumberCount, Guid sentboxGuid, int smsPartCount, Encoding encoding)
        {
            Business.Sms smsController = new Business.Sms();
            Dictionary <Business.Operators, int> operatorCountNumberDictionary = new Dictionary <Operators, int>();

            operatorCountNumberDictionary.Add(Operators.MCI, recipientNumberCount);

            Business.SmsTypes smsType = encoding == Business.Encoding.Utf8 ? Business.SmsTypes.Farsi : Business.SmsTypes.Latin;

            smsController.BeginTransaction();
            try
            {
                //Transaction.DecreaseCostOfSmsSend(userGuid, Business.SmsSendType.SendPostalCodeSms, operatorCountNumberDictionary,
                //																	smsPartCount, smsType, smsSenderAgentRefrence, smsSentGuid, smsController.DataAccessProvider);

                if (!smsController.SendPostalCodeSms(sentboxGuid))
                {
                    throw new Exception(Language.GetString("ErrorRecord"));
                }

                smsController.CommitTransaction();
                return(true);
            }
            catch (InnerTransactionException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                smsController.RollbackTransaction();
                throw ex;
            }
        }