private void Schedules_Load(object sender, EventArgs e) { BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); PaymentListF = PaymentsController.GetPayments(user.RsaID); foreach (Payment item in PaymentListF) { //DateTime payDate = DateTime.ParseExact(item.PayDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); //if (payDate > DateTime.Now || item.Recurring == true) //{ PaymentList.Add(item); //} } if (CryptoController.GetUserCrypto(user.RsaID) != null) { userCrypto = CryptoController.GetUserCrypto(user.RsaID); } else { userCrypto = new Crypto("", "", 0, "", user.RsaID); } UserPaymentAccountList = PaymentsAccountController.SearchUserPaymentAcount(user.RsaID); UserCardList = CardController.RetrveCards(user.RsaID); FillPaymentsDatagrid(PaymentList); BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); FillBeneficiaryDatagrid(BeneficairyList); popUcb(); }
private void Payments_Load(object sender, EventArgs e) { if (CryptoController.GetUserCrypto(user.RsaID) == null) { userCrypto = new Crypto("", "", 0, "", user.RsaID); } else { userCrypto = CryptoController.GetUserCrypto(user.RsaID); } history = HistoryController.getHistory(user.RsaID); scheduals = PaymentsController.GetPayments(user.RsaID); foreach (Payment item in history) { ALLPAY.Add(item); } foreach (Payment item in scheduals) { ALLPAY.Add(item); } BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); UserPaymentAccountList = PaymentsAccountController.SearchUserPaymentAcount(user.RsaID); UserCardList = CardController.RetrveCards(user.RsaID); FillBeneficiaryDatagrid(BeneficairyList); popUcb(); }
private void History_Load(object sender, EventArgs e) { PaymentListF = HistoryController.getHistory(user.RsaID); BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); foreach (Payment item in PaymentListF) { PaymentList.Add(item); } FillPaymentsDatagrid(PaymentList); string BenName = txtBName.Text.Trim(); DateTime EndDate = dtpEnd.Value; DateTime StartDate = dtpStart.Value; }
private void btnSeachB_Click(object sender, EventArgs e) { BeneficiaryList = BeneficiaryController.GetBeneficiarys(user.RsaID); List <Beneficiary> SearchList = new List <Beneficiary>(); foreach (Beneficiary item in BeneficiaryList) { if (item.BeneficairyName.IndexOf(txtSearchBName.Text.Trim(), StringComparison.CurrentCultureIgnoreCase) != -1) { SearchList.Add(item); } } BeneficiaryList = SearchList; FillBeneficiaryDatagrid(SearchList); }
private void btnFilter_Click(object sender, EventArgs e) { PaymentList = HistoryController.getHistory(user.RsaID); BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); List <string> BeneficiarySearchIDs = new List <string>(); bool UsePaymentList = false; List <Payment> SearchList = new List <Payment>(); //Filter for Beneficiary Name if (!txtBName.Text.Equals("")) { //Get All ID's of Beneficiaries that fall under search Criteria foreach (Beneficiary item in BeneficairyList) { if (item.BeneficairyName.IndexOf(txtBName.Text.Trim(), StringComparison.CurrentCultureIgnoreCase) != -1) { BeneficiarySearchIDs.Add(item.BeneficairyID); } } //Filter All Payments, based on BeneficiaryID foreach (Payment item in PaymentList) { if (BeneficiarySearchIDs.Contains(item.BeneficairyID)) { SearchList.Add(item); } } //Changes the Criteria list, depending on this Filter Criteria, only showing payments that meet this criteria, for the next criteria methods. PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter Payments by Status if (!cmbStaus.Text.Equals("")) { foreach (Payment item in PaymentList) { if (item.Status.Equals(cmbStaus.Text.ToString())) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter by Date if (cxbDate.Checked) { string StartDateString = dtpStart.Value.ToString("dd/MM/yyyy"); DateTime StartDate = DateTime.ParseExact(StartDateString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); string EndDateString = dtpEnd.Value.ToString("dd/MM/yyyy"); DateTime EndDate = DateTime.ParseExact(EndDateString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); foreach (Payment item in PaymentList) { DateTime PaymentDate = DateTime.ParseExact(item.PayDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); if (PaymentDate > StartDate && PaymentDate < EndDate) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter by Payment Method if (!cbPaymenttype.Text.Equals("")) { foreach (Payment item in PaymentList) { if (item.TypePayment.ToString() == cbPaymenttype.Text.ToString()) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Now Populate depending on which list, true means using PaymentList global variable, false means using the searchlist if (UsePaymentList) { FillPaymentsDatagrid(PaymentList); } else { FillPaymentsDatagrid(SearchList); } }
private void btnSeAllBeneficairys_Click(object sender, EventArgs e) { BeneficiaryList = BeneficiaryController.GetBeneficiarys(user.RsaID); FillBeneficiaryDatagrid(BeneficiaryList); }
private void Benenficiarys_Load(object sender, EventArgs e) { BeneficiaryList = BeneficiaryController.GetBeneficiarys(user.RsaID); FillBeneficiaryDatagrid(BeneficiaryList); }