コード例 #1
0
        public List <DonationByDonar> GetALLDonarGivenDonation()
        {
            string query = "SELECT * from DonarGivenItemTable";
            List <DonationByDonar>  asdList = 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();

                asdList.Add(bez);



                // asdList.Add(a);
            }
            return(asdList);
        }
コード例 #2
0
        //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);
        }