示例#1
0
        public void save(Donor d)
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();

            f.Donors.AddObject(d);
            f.SaveChanges();
        }
示例#2
0
 public List <Donor> sign(string u, string p)
 {
     using (finalDataBaseEntities2 f = new finalDataBaseEntities2())
     {
         List <Donor> list = f.Donors.Where(x => (x.Email == u && x.Password == p)).ToList();
         return(list);
     }
 }
示例#3
0
        public void removeRequest(int id)
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();
            Accepter d = f.Accepters.First(x => x.AccepterId == id);

            f.DeleteObject(d);
            f.SaveChanges();
        }
示例#4
0
        public void removeDonor(int id)
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();
            Donor d = f.Donors.First(x => x.DonorId == id);

            f.DeleteObject(d);
            f.SaveChanges();
        }
示例#5
0
        public Boolean checkPWD(String cn, String p)
        {
            Donor a = null;

            using (finalDataBaseEntities2 c = new finalDataBaseEntities2())
            {
                a = c.Donors.FirstOrDefault(x => (x.Email == cn && x.Password == p));
            }

            if (a != null)
            {
                return(true);
            }
            return(false);
        }
示例#6
0
        public Boolean checkIt(String n)
        {
            Donor a = null;

            using (finalDataBaseEntities2 c = new finalDataBaseEntities2())
            {
                a = c.Donors.FirstOrDefault(x => x.Email == n);
            }

            if (a != null)
            {
                return(true);
            }
            return(false);
        }
示例#7
0
        public List <Donor> search(Donor d)
        {
            List <Donor> list = null;// = c.properties.Where(x => (x.area == p.area && x.areaunit == p.areaunit && x.bedrooms == p.bedrooms && x.city == p.city && x.location == p.location && x.price == p.price && x.purpose == p.purpose && x.type == p.type)).ToList();

            using (finalDataBaseEntities2 c = new finalDataBaseEntities2())
            {
                IQueryable <Donor> query = c.Donors.Where(x => x.BloodGroup == d.BloodGroup);

                if (d.City != "All")
                {
                    query = query.Where(x => x.City == d.City);
                }
                list = query.ToList();
            }
            return(list);
        }
示例#8
0
        public List <Donor> getAllDonors()
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();

            return(f.Donors.ToList());
        }
示例#9
0
        public List <Accepter> getAllRequests()
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();

            return(f.Accepters.ToList());
        }