Ejemplo n.º 1
0
        private void SendBulkSMS(Item item)
        {
            List <User> userList = _adminEngine.GetUserForSMS(item.ProvinceId, item.DistrictId, item.CategoryId.ToString(), null).ToList();

            userList.RemoveAll(i => i.Id == item.UserId);

            if (userList != null && userList.Capacity > 0)
            {
                List <string> phoneList = new List <string>();
                foreach (var listItem in userList)
                {
                    if (listItem.PhoneNumber != null && !string.IsNullOrEmpty(listItem.PhoneNumber))
                    {
                        phoneList.Add(listItem.PhoneNumber);
                    }
                }

                if (phoneList.Capacity > 0)
                {
                    Category category = _adminEngine.GetCategory((Guid)item.CategoryId);
                    var      url      = string.Format("{0}{1}/{2}", _configuration["Frontend:Domain"], category.SlugUrl, item.SlugUrl);
                    SmsHelper.SendBulkSMS(phoneList, string.Format("Yeni bir hizmet geldi. Teklif vermek için {0}", url));
                }
            }
        }