public static bool SendPeriodFutureGroupSms(SmsSenderAgentReference smsSenderAgentRefrence, Guid userGuid, Guid smsSentGuid, string groupGuid, DateTime sendDateTime, Guid sentboxGuid, DateTime startDateTime, DateTime endDateTime, int period, SmsSentPeriodType periodType, int smsPartCount, Encoding encoding) { Business.Sms smsController = new Business.Sms(); Business.SmsTypes smsType = encoding == Business.Encoding.Utf8 ? Business.SmsTypes.Farsi : Business.SmsTypes.Latin; smsController.BeginTransaction(); try { DateTime nextDateTime = Helper.AddDate(periodType.ToString(), period, sendDateTime); bool sendIsFinish = false; if (nextDateTime > endDateTime) { sendIsFinish = true; } Dictionary <Business.Operators, int> operatorCountNumberDictionary = PhoneNumber.GetCountNumberOfOperators(groupGuid, 0, 0, false); //Transaction.DecreaseCostOfSmsSend(userGuid, Business.SmsSendType.SendPeriodFutureGroupSms, // operatorCountNumberDictionary, smsPartCount, smsType, smsSenderAgentRefrence, smsSentGuid, smsController.DataAccessProvider); if (!smsController.SendPeriodFutureGroupSms(sentboxGuid, groupGuid, nextDateTime, sendIsFinish)) { throw new Exception(Language.GetString("ErrorRecord")); } smsController.CommitTransaction(); return(true); } catch (InnerTransactionException ex) { throw ex; } catch (Exception ex) { smsController.RollbackTransaction(); throw ex; } }