Ejemplo n.º 1
0
        private void reject_Click(object sender, EventArgs e)
        {
            if (listBox.SelectedItem != null)
            {
                RejectPaymentRequestCommand command = new RejectPaymentRequestCommand();
                bool result = command.rejectPaymentRequest((PolicyPayment)listBox.SelectedItem);
                if (result)
                {
                    listBox.Items.Clear();
                    label2.Text = "Запрос на выплату отклонен.";
                    GetAllIndividualWithPaymentRequests command1 = new GetAllIndividualWithPaymentRequests();
                    List <Individual> individualList             = command1.getAllIndividualClientsWithPaymentRequests();

                    listBox.Items.AddRange(individualList.ToArray());

                    GetAllLegalPersonsWithPaymentRequests command2 = new GetAllLegalPersonsWithPaymentRequests();
                    List <LegalPerson> legalList = command2.getAllLegalPersonsClientsWithPaymentRequests();
                    listBox.Items.AddRange(legalList.ToArray());

                    label1.Text     = "Все клиенты, оформившие обращение за выплатой";
                    reject.Visible  = false;
                    submit.Visible  = false;
                    button1.Visible = true;
                }
                else
                {
                    label2.Text = "Не удалось отклонить запрос на выплату.";
                }
            }
        }
Ejemplo n.º 2
0
        public FormPaymentAdmin()
        {
            InitializeComponent();

            reject.Visible = false;
            submit.Visible = false;

            GetAllIndividualWithPaymentRequests command = new GetAllIndividualWithPaymentRequests();
            List <Individual> individualList            = command.getAllIndividualClientsWithPaymentRequests();

            listBox.Items.AddRange(individualList.ToArray());

            GetAllLegalPersonsWithPaymentRequests command2 = new GetAllLegalPersonsWithPaymentRequests();
            List <LegalPerson> legalList = command2.getAllLegalPersonsClientsWithPaymentRequests();

            listBox.Items.AddRange(legalList.ToArray());
        }