Ejemplo n.º 1
0
        private void DonateBloodLoadingEvent(object sender, EventArgs e)
        {
            DateTime result     = BloodDonorController.GetLastDonateDate(mem.Username);
            TimeSpan donatetime = DateTime.Now.Subtract(result);

            if (result == DateTime.Parse("01/01/1753"))
            {
                dateTimePickerLastTimeDonate.Visible = false;
            }
            else
            {
                dateTimePickerLastTimeDonate.Visible = true;
                dateTimePickerLastTimeDonate.Value   = DateTime.Parse(result.ToShortDateString());
            }

            if (donatetime.TotalDays >= 90)
            {
                buttonSubmit.Visible = true;
            }
            else
            {
                double a = 90 - donatetime.TotalDays;
                int    c = (int)a;
                MessageBox.Show("You can not donate blood before " + c.ToString() + " Days", "Alert");
                // buttonBack.PerformClick();
            }
        }
Ejemplo n.º 2
0
        private void buttonDonor_Click(object sender, EventArgs e)
        {
            labelBalance.Text = null;
            dataGridViewHistory.DataSource = null;
            var donor = BloodDonorController.GetAllDonateHistory(mem.Username);

            dataGridViewHistory.DataSource = donor;
        }
Ejemplo n.º 3
0
        private void SubmitButtonClicked(object sender, EventArgs e)
        {
            BloodDonorController.InsertDonateInfo(mem);
            BloodStockController.UpdateStock(mem.Blood_Group);
            MessageBox.Show("Thank you for your donation", "Message");
            //buttonBack.PerformClick();
            this.Hide();
            RegisteredMember f1 = new RegisteredMember(mem);

            f1.Show();
        }