public ActionResult SmsLoanDefaulters(sdtoViewLoanDefaulters Defaulters)
        {
            string senderID = "Pallikunnel";
            string baseMessage = "Please pay the loan due amount for the loan {0} at the earliest";
            bfReport objReport = new bfReport(db);
            List<sdtoViewLoanDefaulterDetails> DefaulterList = objReport.GetLoanDefaulters(Defaulters.LoanDefaultInterval);

            string[] selectionLoans = Defaulters.InputSelection.Trim(" []".ToCharArray()).Split(',');
            if (selectionLoans != null && selectionLoans.Length > 0)
            {
                string apiKey = "6209qu7258jl67i8on8";
                WebClient wc = null;
                for (int iLoanId = 0; iLoanId < selectionLoans.Length; iLoanId++)
                {
                    if (selectionLoans[iLoanId].Equals("true", StringComparison.InvariantCultureIgnoreCase))
                    {
                        var defaulter = DefaulterList.Find(x => x.LoanId == iLoanId);

                        wc = new WebClient();
                        wc.DownloadStringCompleted += HttpsCompleted;
                        wc.DownloadString(new Uri("http://sms.iconinfoware.com/api/web2sms.php?workingkey=" + apiKey + "&to=" + defaulter.Mobile1.Trim() + "&sender=" + senderID + "&message=" + string.Format(baseMessage, defaulter.LoanCode).Trim()));
                    }
                }

                SetDisplayMessage("Sms notification is send to the selected recipients");
                RedirectToAction("Index");
            }
            return View(Defaulters);
        }
        public ActionResult SmsLoanDefaulters(int? LoanDefaultDays)
        {
            sdtoViewLoanDefaulters defaulters = new sdtoViewLoanDefaulters();

            if (LoanDefaultDays == null)
                LoanDefaultDays = 3;

            bfReport objReport = new bfReport(db);
            defaulters.Defaulters = objReport.GetLoanDefaulters(LoanDefaultDays.Value);
            defaulters.LoanDefaultInterval = LoanDefaultDays.Value;
            return View(defaulters);
        }