private void Search() { ManagePagination.SearchSource = ManagePagination.DataSource .Where( h => h.Address1.ToLower().Contains(Searchtxt.ToLower()) || h.Name.ToLower().Contains(Searchtxt)) .ToArray(); ManagePagination.PageCount = (int)Math.Ceiling((int)ManagePagination.SearchSource.Length / (decimal)ManagePagination.ItemPerPage); ManagePagination.Paginate(0); }
private void SaveBtn_Click(object sender, EventArgs e) { if (Amounttxt.Text == "") { MessageBox.Show("Please insert payment amount"); } else { if (Studenttxt.Text != "") { Payments p = new Payments { StudentId = int.Parse(Studenttxt.Text), Amount = double.Parse(Amounttxt.Text), PaymentDate = DateTime.Now, UserId = FormOperations.user.UserId }; DataAccess.InsertPayments(p); DialogResult msg = MessageBox.Show("Payment Saved Successfully. Do you want to make other payments?", "Payment Notifcation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DialogResult.No == msg) { //FormOperations.student = null; FormOperations._ID = 0; FormOperations.OpenMenu(); this.Close(); } else { Searchtxt.Clear(); Paytxt.Clear(); Studenttxt.Clear(); Amounttxt.Clear(); dataGridView1.DataSource = null; Amounttxtx.Text = 0.ToString(); //FormOperations.student = null; FormOperations._ID = 0; } } else { MessageBox.Show("Please search for student first then enter payment and save"); } } }
private void Search() { SearchSource = DataSource.Where(h => h.Address1.ToLower().Contains(Searchtxt.ToLower())).ToArray(); PageCount = (int)Math.Ceiling((int)SearchSource.Length / (decimal)ItemPerPage); Paginate(0); }