IEnumerable <SmsSendConditions> addSendConditions(string param, ConditionTypes condition, KeyCharVariables kcv) { var smsConditions = new List <SmsSendConditions>(); if (!string.IsNullOrEmpty(param)) { smsConditions.Add(new SmsSendConditions { TypeCondition = condition, Value = param, Parameter = kcv.ToString() }); } return(smsConditions); }
IEnumerable <SmsTemplatesParams> addTemplateParams <T>(List <T> itemslist, ConditionTypes condition, KeyCharVariables field) { var smsParams = new List <SmsTemplatesParams>(); if (itemslist == null || !itemslist.Any()) { smsParams.Add(new SmsTemplatesParams { Value = "-1", TypeCondition = condition, Field = field.ToString() }); } else { itemslist.ForEach(x => { smsParams.Add(new SmsTemplatesParams { Value = x.ToString(), TypeCondition = condition, Field = field.ToString() }); }); } return(smsParams); }