예제 #1
0
        private void btnUpdateCampDetails_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BloodDonationCampBL bb = new BloodDonationCampBL();
                if (bb.ValidateBloodDonationCampData(txtBloodDonationCampId.Text, txtCampName.Text, txtAddress.Text, txtCity.Text, txtBloodBankId.Text, txtCampStartDate.Text, txtCampEndDate.Text))
                {
                    if (bb.validateCampIdModify(txtBloodDonationCampId.Text))
                    {
                        BloodDonationCamp b = new BloodDonationCamp
                        {
                            BloodDonationCampId = txtBloodDonationCampId.Text,
                            CampName            = txtCampName.Text,
                            Address             = txtAddress.Text,
                            City          = txtCity.Text,
                            CampStartDate = Convert.ToDateTime(txtCampStartDate.Text),
                            CampEndDate   = Convert.ToDateTime(txtCampEndDate.Text)
                        };

                        if (bb.ModifyCampBLL(b))
                        {
                            txtBloodDonationCampId.IsEnabled = true;
                            gbModify.Visibility = Visibility.Hidden;
                            MessageBox.Show("Blood Donation Camp Info Saved.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void btnArrange_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BloodDonationCampBL bl = new BloodDonationCampBL();
                if (bl.ValidateBloodDonationCampData(txtBloodDonationCampId.Text, txtCampName.Text, txtAddress.Text, txtCity.Text, txtBloodBankId.Text, txtCampStartDate.Text, txtCampEndDate.Text))
                {
                    if (bl.validateCampIdArrange(txtBloodDonationCampId.Text))
                    {
                        BloodDonationCamp arrange = new BloodDonationCamp()
                        {
                            BloodDonationCampId = txtBloodDonationCampId.Text,
                            CampName            = txtCampName.Text,
                            Address             = txtAddress.Text,
                            City          = txtCity.Text,
                            BloodBankId   = txtBloodBankId.Text,
                            CampStartDate = Convert.ToDateTime(txtCampStartDate.Text),
                            CampEndDate   = Convert.ToDateTime(txtCampEndDate.Text)
                        };


                        if (bl.ArrangeCampBLL(arrange))
                        {
                            MessageBox.Show(" Blood Donation Camp Arranged Successfully");
                        }
                        else
                        {
                            MessageBox.Show("Details Not Added");
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
        }