示例#1
0
        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());
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }
示例#4
0
 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();
     }
 }
示例#5
0
        // GET: Subscribers/Report
        public ActionResult Report()
        {
            var subscribers = SubscriberHelper.GetSubscribers(null);

            return(View(subscribers));
        }
示例#6
0
        // GET: Subscribers
        public ActionResult Index(string searchString)
        {
            var subscribers = SubscriberHelper.GetSubscribers(searchString);

            return(View(subscribers));
        }