private void loadNumber(string list_code) { MultiView2.ActiveViewIndex = 2; int list_id = int.Parse(list_code); data_table = data_file.GetActiveListNumbers(list_id); DataGrid2.DataSource = data_table; DataGrid2.DataBind(); }
public string LogSMS(string list_code, string prefix, string message, string otherPhones, string areaID) { string output = ""; phone_validator = new PhoneValidator(); int list_id = int.Parse(list_code); string[] ArrayPhones = otherPhones.Split(','); data_table = data_file.GetActiveListNumbers(list_id); if ((data_table.Rows.Count > 0) || (ArrayPhones.Length > 0)) { string user = HttpContext.Current.Session["Username"].ToString(); string mask = HttpContext.Current.Session["Mask"].ToString(); int i = 0; int count = 0; foreach (DataRow dr in data_table.Rows) { string phone = phone_validator.Format(dr["PhoneNumber"].ToString().Trim()); string name = dr["PhoneName"].ToString(); string msg = GetformatMessage(phone, name, prefix, message); data_file.InsertSmsToSend(phone, msg, mask, user, areaID); count++; Reduct_credit(list_id, message, mask, user, phone); } if (count > 0) { i = 1; } for (; i < ArrayPhones.Length; i++, count++) { string phone = phone_validator.Format(ArrayPhones[i].ToString().Trim()); string msg = GetformatMessage(phone, "", prefix, message); data_file.InsertSmsToSend(phone, msg, mask, user, areaID); Reduct_creditforOtherPhones(ArrayPhones, message, mask, user, "YES"); } output = "A list of " + count + " has been logged Successfully"; } else { output = "No Active Phone number(s) on list"; } return(output); }