Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            //RequestInfo j = D.RequestInfos.SingleOrDefault(x => x.DonorId == Convert.ToInt32(textBox1.Text));

            var y = from a in D.RequestInfos
                    where a.Gid == Convert.ToInt32(textBox1.Text)
                    select a;

            if (y.Any())
            {
                foreach (var a in y)
                {
                    D.RequestInfos.DeleteOnSubmit(a);
                }

                GuestInfo i = D.GuestInfos.SingleOrDefault(t => t.Gid == Convert.ToInt32(textBox1.Text));

                D.GuestInfos.DeleteOnSubmit(i);
                D.SubmitChanges();
                s.showde();
            }
            else
            {
                MessageBox.Show("Guest Id Invalid");
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            AdminInfo pr = new AdminInfo();

            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
            {
                pr.Password = textBox4.Text;
                pr.Name     = textBox2.Text;
                pr.Phone    = textBox1.Text;
                pr.Username = textBox3.Text;


                D.AdminInfos.InsertOnSubmit(pr);

                D.SubmitChanges();

                MessageBox.Show("New Admin Added");

                a.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Fill up all information");
            }
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            GuestInfo pr = new GuestInfo();

            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
            {
                pr.GName    = textBox2.Text;
                pr.GPhone   = textBox3.Text;
                pr.GAddress = textBox4.Text;
                D.GuestInfos.InsertOnSubmit(pr);
                D.SubmitChanges();

                RequestInfo rq = new RequestInfo();
                rq.DonorId = Convert.ToInt32(textBox1.Text);
                rq.Gphone  = textBox3.Text;

                var x = from a in D.GuestInfos
                        where a.GPhone.Equals(textBox3.Text)
                        select a;
                int str = x.First().Gid;

                rq.Gid = str;

                D.RequestInfos.InsertOnSubmit(rq);
                MessageBox.Show("Request Send");
                this.Hide();
                D.SubmitChanges();
            }
            else
            {
                MessageBox.Show("Please fill up all information");
            }
        }
Exemple #4
0
        private void Admin_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = from a in D.DonorInfos
                    where a.UserID.Equals(s)
                    select a;

            Adminid = x.First().DonorId;
            Blood   = x.First().BloodGroup;

            metroLabel10.Text = x.First().DName;
            metroLabel11.Text = x.First().DPhone;
            metroLabel13.Text = x.First().UserID;
            metroLabel15.Text = Convert.ToString(x.First().DonorId);
            metroLabel17.Text = x.First().Password;
            metroLabel20.Text = x.First().Status;

            metroLabel25.Text = x.First().BloodGroup;
            metroLabel26.Text = x.First().DAddress;

            metroButton10.Hide();
            metroButton9.Hide();
            metroButton11.Hide();
            metroButton7.Hide();
            // metroButton1.Hide();

            //var w = (from a in D.allrequests
            //         where a.Status.Equals("Donated")
            //         select new { a.DonorInfo.DName, a.DonorInfo.DPhone, a.DonorInfo.DAddress, a.identity, a.Name, a.Phone, a.Address }).ToList();
            //metroGrid1.DataSource = w;
            show();
        }
Exemple #5
0
        private void AdminList_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = (from a in D.AdminInfos

                     select new { a.AdminId, a.Name, a.Phone, a.Username, }).ToList();

            dataGridView1.DataSource = x;
        }
Exemple #6
0
        private void DonationList_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = (from a in D.RequestInfos join b in D.GuestInfos on a.Gid equals b.Gid join c in D.DonorInfos on a.DonorId equals c.DonorId


                     select new { a.DonorInfo.Name, a.DonorInfo.Phone, a.DonorInfo.Address, a.GuestInfo.GName, a.GuestInfo.GPhone, a.GuestInfo.GAddress, a.Status }).ToList();

            dataGridView1.DataSource = x;
        }
Exemple #7
0
        private void metroButton3_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            int rowIndex       = metroGrid1.CurrentCell.RowIndex;

            int     did = Convert.ToInt32(metroGrid1.Rows[rowIndex].Cells[0].Value);
            Request r   = new Request(did);

            r.Show();
        }
Exemple #8
0
        public void dshow()
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            //var zi = (from a in D.RequestInfos
            //         join b in D.GuestInfos on a.Gid equals b.Gid
            //         where (a.DonorId == Convert.ToInt32(metroLabel5.Text) && a.Status.Equals(null))

            //          select new { a.GuestInfo.GName,a.GuestInfo.GPhone,a.GuestInfo.GAddress,a.DonorInfo.DonorId }).ToList();
            //foreach (var a in zi)
            //{
            //    D.allrequests.InsertAllOnSubmit(a);
            //}

            metroButton5.Hide();
            metroButton4.Hide();
            metroButton6.Hide();
            var z = (from a in D.allrequests
                     where (a.Donorid == m && (a.Status.Equals(null)) && a.Status.Equals(null))
                     select new { a.reqid, a.identity, a.Name, a.Phone, a.Address }).ToList();                             ///show requests

            if (z.Any())
            {
                metroButton3.Show();
                metroGrid1.DataSource = z;
            }
            else
            {
                metroButton3.Hide();
                metroGrid1.DataSource = z;
            }
            var y = (from a in D.RequestInfos
                     join b in D.GuestInfos on a.Gid equals b.Gid

                     where (a.DonorId == m && a.Status.Equals("Donated"))

                     select new { a.GuestInfo.GName, a.GuestInfo.GPhone, a.GuestInfo.GAddress, a.Status }).ToList();    /// show  Guest (Donated)

            if (y.Any())
            {
                metroGrid2.DataSource = y;
                metroButton5.Show();
            }
            else
            {
                metroButton4.Show();

                var t = (from a in D.DonorInfos

                         where a.BloodGroup.Equals(metroLabel7.Text) && (!a.DonorId.Equals(m)) && (a.Status.Equals(null))   ///show Donors
                         select new { a.DonorId, a.DName, a.DAddress, a.Status }).ToList();
                metroGrid2.DataSource = t;
            }
        }
Exemple #9
0
        private void Requests_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = (from a in D.RequestInfos
                     join b in D.GuestInfos on a.Gid equals b.Gid
                     where (a.DonorId == s && a.Status.Equals(null))

                     select new { a.GuestInfo.GName, a.GuestInfo.GPhone, a.GuestInfo.GAddress, a.GuestInfo.Gid }).ToList();

            dataGridView1.DataSource = x;
            D.SubmitChanges();
        }
Exemple #10
0
        private void metroButton8_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where a.DonorId.Equals(Adminid)
                    select a;

            x.First().Status = null;
            metroLabel20.Text = "";
            D.SubmitChanges();
        }
Exemple #11
0
        private void metroButton2_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where a.DonorId.Equals(Adminid)
                    select a;

            if (metroTextBox1.Text != "")
            {
                metroLabel10.Text = metroTextBox1.Text;
                x.First().DName = Convert.ToString(metroTextBox1.Text);
                metroTextBox1.Text = "";
            }
            if (metroTextBox3.Text != "")
            {
                string st = metroTextBox3.Text;
                if (st[0] == '$')
                {
                    x.First().UserID = metroTextBox3.Text;
                    metroLabel13.Text  = metroTextBox3.Text;
                    metroTextBox3.Text = "";
                }
                else
                {
                    MessageBox.Show("Update user name with $");
                }
            }

            if (metroTextBox4.Text != "")
            {
                x.First().Password = metroTextBox4.Text;
                metroLabel17.Text  = metroTextBox4.Text;
                metroTextBox4.Text = "";
            }

            if (metroTextBox2.Text != "")
            {
                x.First().DPhone = metroTextBox2.Text;
                metroLabel11.Text  = metroTextBox2.Text;
                metroTextBox2.Text = "";
            }
            if (metroTextBox9.Text != "")
            {
                x.First().DAddress = metroTextBox9.Text;
                metroLabel26.Text  = metroTextBox9.Text;
                metroTextBox9.Text = "";
            }

            D.SubmitChanges();
            MessageBox.Show("Successfully Update");
            show();
        }
Exemple #12
0
        private void metroButton10_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            metroButton10.Hide();
            metroButton9.Show();
            metroButton11.Show();
            var t = (from a in D.DonorInfos
                     where (a.BloodGroup.Equals(Blood) && a.Status.Equals(null) && (!a.DonorId.Equals(Adminid)))
                     select new { a.DonorId, a.DName, a.DPhone, a.DAddress }).ToList();

            metroGrid6.DataSource = t;
        }
Exemple #13
0
        public void show()
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\MD. REZA UL KARIM\Documents\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.AdminInfos
                    where Adminid == a.AdminId
                    select a;

            label8.Text = x.First().Name;
            label3.Text = x.First().Username;
            label2.Text = Convert.ToString(x.First().AdminId);
            label5.Text = x.First().Phone;
        }
Exemple #14
0
        private void metroButton4_Click(object sender, EventArgs e)                      ///send request donor to donor
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            int rowIndex       = metroGrid2.CurrentCell.RowIndex;

            int did = Convert.ToInt32(metroGrid2.Rows[rowIndex].Cells[0].Value);

            R rq = new R();

            rq.DonorId  = did;
            rq.Did      = m;
            rq.Phone    = metroLabel11.Text;
            rq.Identity = "Donor";

            D.Rs.InsertOnSubmit(rq);
            D.SubmitChanges();

            allrequest req = new allrequest();

            req.Donorid  = did;
            req.Name     = metroLabel4.Text;
            req.Phone    = metroLabel11.Text;
            req.Address  = metroLabel9.Text;
            req.identity = "Donor";

            var p = from a in D.Rs
                    where a.Did.Equals(m)
                    select a;

            int stra = p.First().Rid;

            req.Rid      = stra;
            req.identity = "Donor";

            D.allrequests.InsertOnSubmit(req);
            D.SubmitChanges();

            //var x = from a in D.RequestInfos
            //        where a.Gid == did
            //        select a;
            //x.First().Status = "Donated";

            //var y = from a in D.DonorInfos
            //        where a.DonorId == m
            //        select a;
            //y.First().Status = "Donated";
            //D.RequestInfos.InsertOnSubmit(rq);
            MessageBox.Show("Request Send");
            D.SubmitChanges();
        }
Exemple #15
0
        private void button4_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\MD. REZA UL KARIM\Documents\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where a.Password.Equals(id)
                    select a;

            x.First().Status = null;
            label13.Text = "";
            D.SubmitChanges();

            show();
        }
Exemple #16
0
        private void Admin_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = from a in D.AdminInfos
                    where a.Username.Equals(s)
                    select a;

            label8.Text = x.First().Name;
            label5.Text = x.First().Phone;
            label3.Text = x.First().Username;
            // label2.Text = x.First().AdminId;
            label2.Text = Convert.ToString(x.First().AdminId);
            Adminid     = x.First().AdminId;
            label9.Text = x.First().Password;
        }
Exemple #17
0
        public void Ashow()
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    select a.BloodGroup;

            foreach (var c in x)
            {
                if (!comboBox1.Items.Contains(c))
                {
                    comboBox1.Items.Add(c);
                }
            }
        }
Exemple #18
0
        public void show()
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\MD. REZA UL KARIM\Documents\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where id == a.Password
                    select a;

            label10.Text = x.First().Name;
            label9.Text  = Convert.ToString(x.First().DonorId);
            label8.Text  = x.First().BloodGroup;
            label7.Text  = x.First().Address;
            this.m       = Convert.ToInt32(x.First().DonorId);
            label6.Text  = x.First().Phone;
            label13.Text = x.First().Status;
        }
Exemple #19
0
        public void show()
        {
            metroComboBox2.Items.Clear();
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where a.BloodGroup.Equals(metroComboBox1.SelectedItem.ToString())
                    select a.DAddress;

            foreach (var c in x)
            {
                if (!metroComboBox2.Items.Contains(c))
                {
                    metroComboBox2.Items.Add(c);
                }
            }
        }
Exemple #20
0
        private void Donor_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where id == a.Password
                    select a;

            label10.Text = x.First().Name;
            label9.Text  = Convert.ToString(x.First().DonorId);
            label8.Text  = x.First().BloodGroup;
            label7.Text  = x.First().Address;
            label6.Text  = x.First().Phone;
            this.m       = Convert.ToInt32(x.First().DonorId);
            label11.Text = x.First().UserID;
            label13.Text = x.First().Status;
        }
Exemple #21
0
        private void metroButton6_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            int rowIndex       = metroGrid3.CurrentCell.RowIndex;

            int did = Convert.ToInt32(metroGrid3.Rows[rowIndex].Cells[0].Value);

            MessageBox.Show(Convert.ToString(did));

            var z = from a in D.RequestInfos
                    where a.Gid == did
                    select a;
            int sam = z.First().RequestId;


            foreach (var a in z)
            {
                D.RequestInfos.DeleteOnSubmit(a);
            }
            D.SubmitChanges();

            var y = from b in D.GuestInfos
                    where b.Gid == did
                    select b;

            foreach (var b in y)
            {
                D.GuestInfos.DeleteOnSubmit(b);
            }

            var n = from b in D.allrequests
                    where b.requestid.Equals(sam)
                    select b;

            foreach (var b in n)
            {
                D.allrequests.DeleteOnSubmit(b);
            }


            metroGrid3.Rows.RemoveAt(rowIndex);
            D.SubmitChanges();
            metroGrid3.Update();
            show();
        }
Exemple #22
0
        private void metroButton12_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            int rowIndex       = metroGrid2.CurrentCell.RowIndex;

            int did = Convert.ToInt32(metroGrid2.Rows[rowIndex].Cells[0].Value);

            var y = from a in D.DonorInfos
                    where a.DonorId == did
                    select a;

            foreach (var a in y)
            {
                D.DonorInfos.DeleteOnSubmit(a);
            }
            D.SubmitChanges();
            MessageBox.Show(Convert.ToString(did));
            var z = from a in D.RequestInfos
                    where a.DonorId == did
                    select a;

            foreach (var a in z)
            {
                D.RequestInfos.DeleteOnSubmit(a);
            }
            D.SubmitChanges();
            metroGrid2.Rows.RemoveAt(rowIndex);

            //int x=metroGrid2.

            //BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            //var y = from a in D.RequestInfos
            //        where a.DonorId == Convert.ToInt32(textBox1.Text)
            //        select a;
            //foreach (var a in y)
            //{
            //    D.RequestInfos.DeleteOnSubmit(a);
            //}

            //DonorInfo i = D.DonorInfos.SingleOrDefault(t => t.DonorId == Convert.ToInt32(textBox1.Text));
            //D.DonorInfos.DeleteOnSubmit(i);
            //D.SubmitChanges();
        }
Exemple #23
0
        private void button2_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            //Information info = new Information();
            //Donor_Info pr = new Donor_Info
            //{
            //    Name = Convert.ToString(donornam.Text),
            //    Address = add.Text,
            //    Password = pass.Text,
            //    Phone = Convert.ToInt32(ph.Text),
            //};

            var x = from a in D.DonorInfos
                    where a.DonorId == d
                    select a;

            if (donornam.Text != "")
            {
                // var a = x.First().Name;
                //donornam.Text = a;
                x.First().Name = donornam.Text;
            }
            if (add.Text != "")
            {
                x.First().Address = add.Text;
            }
            if (pass.Text != "")
            {
                x.First().Password = pass.Text;
            }
            if (ph.Text != "")
            {
                x.First().Phone = ph.Text;
            }

            //D.Donor_Infos.InsertOnSubmit(pr);
            D.SubmitChanges();
            MessageBox.Show("Successfully Update");
            //Donor c = new Donor();
            donor.Show();
            donor.show();
            this.Hide();
        }
Exemple #24
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            //Information info = new Information();
            //Donor_Info pr = new Donor_Info
            //{
            //    Name = Convert.ToString(donornam.Text),
            //    Address = add.Text,
            //    Password = pass.Text,
            //    Phone = Convert.ToInt32(ph.Text),
            //};

            var x = from a in D.DonorInfos
                    where a.DonorId == m
                    select a;

            if (metroTextBox1.Text != "")
            {
                x.First().DName = metroTextBox1.Text;
                metroLabel14.Text  = metroTextBox1.Text;
                metroTextBox1.Text = "";
            }
            if (metroTextBox2.Text != "")
            {
                x.First().DAddress = metroTextBox2.Text;
                metroLabel19.Text  = metroTextBox2.Text;
                metroTextBox2.Text = "";
            }
            if (metroTextBox4.Text != "")
            {
                x.First().Password = metroTextBox4.Text;
                metroLabel2.Text   = metroTextBox4.Text;
                metroTextBox4.Text = "";
            }
            if (metroTextBox3.Text != "")
            {
                x.First().DPhone = metroTextBox3.Text;
                metroLabel11.Text  = metroTextBox3.Text;
                metroTextBox3.Text = "";
            }
            D.SubmitChanges();
            MessageBox.Show("Successfully Update");
        }
Exemple #25
0
        private void button1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = (from a in D.DonorInfos
                     where (a.BloodGroup == comboBox1.Text && a.Address == comboBox2.Text && a.Status.Equals(null))
                     select new { a.DonorId, a.Name, a.Phone, a.Address, a.BloodGroup }).ToList();

            if (x.Any())
            {
                dataGridView1.DataSource = x;
                Request r = new Request();
                r.Show();
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
Exemple #26
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");


            var x = (from a in D.DonorInfos
                     where (a.BloodGroup == metroComboBox1.Text && a.DAddress == metroComboBox2.Text && a.Status.Equals(null))
                     select new { a.DonorId, a.DName, a.DPhone, a.DAddress, a.BloodGroup }).ToList();

            if (x.Any())
            {
                metroButton3.Show();
                metroGrid1.DataSource = x;
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
Exemple #27
0
        private void button1_Click(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");
            var x = from a in D.RequestInfos
                    where a.Gid == Convert.ToInt32(textBox1.Text)
                    select a;

            x.First().Status = "Donated";

            var y = from a in D.DonorInfos
                    where a.DonorId == Dono
                    select a;

            y.First().Status = "Donated";
            MessageBox.Show("Confirm Request");
            D.SubmitChanges();
            this.Hide();

            don.show();
        }
Exemple #28
0
        private void Donor_Load(object sender, EventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=G:\Blood\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in D.DonorInfos
                    where id == a.Password
                    select a;

            metroLabel4.Text  = x.First().DName;
            metroLabel5.Text  = Convert.ToString(x.First().DonorId);
            metroLabel7.Text  = x.First().BloodGroup;
            metroLabel9.Text  = x.First().DAddress;
            metroLabel11.Text = x.First().DPhone;
            this.m            = Convert.ToInt32(x.First().DonorId);
            metroLabel2.Text  = x.First().Password;
            metroLabel15.Text = x.First().UserID;
            metroLabel13.Text = x.First().Status;

            dshow();

            D.SubmitChanges();
        }
Exemple #29
0
        private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            dataGridView1.DataSource = D.DonorInfos;
        }
Exemple #30
0
        public void showd()
        {
            BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30");

            dataGridView1.DataSource = D.DonorInfos;
        }