private void LoadSubscribers(string query = null) { var subscribers = string.IsNullOrEmpty(query) ? SubscriberHelper.GetSubscribers() : SubscriberHelper.SearchSubscribers(query); lbSubscribers.Items.Clear(); lbSubscribers.Items.AddRange(subscribers.Select(x => x.ToString()).ToArray()); }
private void btnSubscriberShowInfo_Click(object sender, EventArgs e) { var sub = SubscriberHelper.GetSubscribers().Where(x => x.ToString().Equals(lbSubscribers.SelectedItem)).FirstOrDefault(); var form = new SubscriberInfo(sub); form.ShowDialog(); }
private void btnSubscriberUpdate_Click(object sender, EventArgs e) { var sub = SubscriberHelper.GetSubscribers().Where(x => x.ToString().Equals(lbSubscribers.SelectedItem)).FirstOrDefault(); var form = new SubscriberUpdate(sub); form.FormClosed += delegate { LoadSubscribers(); }; form.ShowDialog(); }
private void btnSubscriberDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete this subscriber?", "Deleting", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) { var sub = SubscriberHelper.GetSubscribers().Where(x => x.ToString().Equals(lbSubscribers.SelectedItem)).FirstOrDefault(); SubscriberHelper.DeleteSubscriber(sub.Id); LoadSubscribers(); } }
// GET: Subscribers/Report public ActionResult Report() { var subscribers = SubscriberHelper.GetSubscribers(null); return(View(subscribers)); }
// GET: Subscribers public ActionResult Index(string searchString) { var subscribers = SubscriberHelper.GetSubscribers(searchString); return(View(subscribers)); }