Esempio n. 1
0
        private void AddFundRequest_Click(object sender, RoutedEventArgs e)
        {
            FundRequest newFund = new FundRequest();

            newFund.FundPrice         = Int32.Parse(fundPriceText.Text);
            newFund.FundReason        = FundReasonText.Text;
            newFund.FundRequestedDate = fundRequestedDate.SelectedDate.Value;
            newFund.DepartmentID      = ActiveUserController.GetActiveEmployee().DepartmentID;
            FundController.CreateFundRequest(newFund);
            MessageBox.Show("Succesfully Sent Request !");
        }
        private void Search(object sender, RoutedEventArgs e)
        {
            int         id   = Int32.Parse(idText.Text);
            FundRequest rslt = FundController.SearchByID(id);

            if (rslt != null)
            {
                NameLabel.Content      = "Request " + rslt.FundId + "was Found !";
                AcceptButton.IsEnabled = true;
                RejectButton.IsEnabled = true;
            }
            else
            {
                NameLabel.Content      = "Not found !";
                AcceptButton.IsEnabled = false;
                RejectButton.IsEnabled = false;
            }
        }