public List <RecieverPeople> searchRecieverPeople(string text) { string query13 = "SELECT RecieverId,RecieverName,RecieverArea,RecieverPhoneNo from RecieverPeopleTable WHERE RecieverId LIKE '%" + text + "%' OR RecieverName LIKE '%" + text + "%' OR RecieverArea LIKE '%" + text + "%' OR RecieverPhoneNo LIKE '%" + text + "%' "; List <RecieverPeople> modifiedNewList = new List <RecieverPeople>(); DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query13); while (sdr.Read()) { RecieverPeople obj = new RecieverPeople(); obj.RecieverId = sdr["RecieverId"].ToString(); obj.RecieverName = sdr["RecieverName"].ToString(); obj.RecieverArea = sdr["RecieverArea"].ToString(); obj.RecieverPhoneNo = sdr["RecieverPhoneNo"].ToString(); modifiedNewList.Add(obj); } return(modifiedNewList); }
//string query12 = "SELECT * from DonarGivenItemTable WHERE DonarId LIKE '%" + text + "%' OR BkashNo LIKE '%" + text + "%' DonationId LIKE '%" + text + "%' OR DonationTitle LIKE '%" + text + "%' OR DonarName LIKE '%" + text + "%' OR GivenTime LIKE '%" + text + "%' OR Donarphone LIKE '%" + text + "%' OR Donateddollars LIKE '%" + text + "%'"; public List <DonationByDonar> SearchALLDonarDonation(String text) { // string query = "SELECT * from RequestedDonationTable WHERE RecieverPhoneNo LIKE '%" + text + "%' OR RecieverId LIKE '%" + text + "%' OR RecieverGood LIKE '%" + text + "%' OR RecieverName LIKE '%" + text + "%' OR RecieverArea LIKE '%" + text + "%' OR RequestId LIKE '%" + text + "%' OR RequestedDate LIKE '%" + text + "%'"; // string query = "SELECT * from DonarGivenItemTable WHERE DonarId LIKE '%" + text + "%' OR DonarName LIKE '%" + text + "%' OR DonationTitle LIKE '%" + text + "%' OR Donateddollars LIKE '%" + text + "%' OR Donarphone LIKE '%" + text + "%' OR GivenTime LIKE '%" + text + "%' OR DonationId LIKE '%" + text + "%' OR BkashNo LIKE '%" + text + "%' "; string query = "SELECT * from DonarGivenItemTable WHERE DonarId LIKE '%" + text + "%' OR DonarName LIKE '%" + text + "%' OR DonationTitle LIKE '%" + text + "%' OR Donateddollars LIKE '%" + text + "%' OR Donarphone LIKE '%" + text + "%' OR GivenTime LIKE '%" + text + "%' OR DonationId LIKE '%" + text + "%' OR BKashRefferNo LIKE '%" + text + "%' "; List <DonationByDonar> asdxList = new List <DonationByDonar>(); DatabaseConnectionClass dcc = new DatabaseConnectionClass(); dcc.ConnectWithDB(); SqlDataReader sdr = dcc.GetData(query); while (sdr.Read()) { DonationByDonar bez = new DonationByDonar(); bez.DonarName = sdr["DonarName"].ToString(); bez.DonationTitle = sdr["DonationTitle"].ToString(); bez.DonarId = sdr["DonarId"].ToString(); bez.Donateddollars = Convert.ToDouble(sdr["Donateddollars"]); bez.Donarphone = sdr["Donarphone"].ToString(); bez.GivenTime = Convert.ToDateTime(sdr["GivenTime"]); bez.DonationId = sdr["DonationId"].ToString(); bez.BKashRefferNo = sdr["BKashRefferNo"].ToString(); asdxList.Add(bez); // asdList.Add(a); } return(asdxList); }