private void LoadDonorName() { DataTable dt = DataAccess.GetData("SELECT AccountId, KeyName FROM Account ORDER BY KeyName"); UIUtilities.FillListControl(cboDonorName, "KeyName", "AccountId", dt, true, "-- All donors --"); }
private void LoadDonorName(int id, string type) { DataTable dt = DataAccess.GetData($"SELECT AccountId, KeyName FROM Account WHERE ConstituencyTypeId = {id} ORDER BY KeyName "); UIUtilities.FillListControl(cboDonorName, "KeyName", "AccountId", dt, true, $"-- All {type} donors --"); }
private void LoadConstituencyType() { DataTable dt = DataAccess.GetData("SELECT ConstituencyTypeId, ConstituencyTypeName FROM ConstituencyType ORDER BY ConstituencyTypeName"); UIUtilities.FillListControl(cboConstituencyType, "ConstituencyTypeName", "ConstituencyTypeId", dt, true, "-- All constituency type --"); }
//Implement Business Rule 7 // Constituents must be added to active programs (3 max). Only load active programs in the combobox during add event. private void LoadActiveVolunteerProgram() { DataTable dt = DataAccess.GetData("SELECT ProgramId, ProgramName FROM VolunteerProgram WHERE IsActive = 'true' ORDER BY ProgramName"); UIUtilities.FillListControl(cboVolunterProgram, "ProgramName", "ProgramId", dt, true, "--Select a program--"); }
private void LoadDonorName(int id, string type) { DataTable dt = DataAccess.GetData($"SELECT DISTINCT Account.AccountId, KeyName FROM Account INNER JOIN VolunteerAssignment On Account.AccountId = VolunteerAssignment.AccountId AND ProgramId = {id} ORDER BY KeyName "); UIUtilities.FillListControl(cboVolName, "KeyName", "AccountId", dt, true, $"-- All {type} volunteers --"); }
private void LoadVolunteerName() { DataTable dt = DataAccess.GetData("SELECT DISTINCT Account.AccountId, KeyName FROM Account INNER JOIN VolunteerAssignment On Account.AccountId = VolunteerAssignment.AccountId ORDER BY KeyName"); UIUtilities.FillListControl(cboVolName, "KeyName", "AccountId", dt, true, "-- All volunteers --"); //good }
private void LoadProgram() { DataTable dt = DataAccess.GetData("SELECT ProgramId, ProgramName FROM VolunteerProgram ORDER BY ProgramName"); UIUtilities.FillListControl(cboProgram, "ProgramName", "ProgramId", dt, true, "-- All programs --"); //good }