private void button1_Click(object sender, EventArgs e)
        {
            bool loop;

            do
            {
                loop = false;
                NewTenantForm dialog = new NewTenantForm();
                dialog.ShowDialog();

                if (dialog.DialogResult == DialogResult.OK)
                {
                    tenants.Add(dialog.NewTenant);
                }
                if (dialog.DialogResult == DialogResult.Retry)
                {
                    tenants.Add(dialog.NewTenant);
                    loop = true;
                }
                if (dialog.DialogResult == DialogResult.Cancel)
                {
                }
                UpdateDataGridView();
            } while (loop);
        }
Example #2
0
 private void btn_Add_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_AddProperty.Name)
     {
         bool loop;
         do
         {
             loop = false;
             NewPropertyForm dialog = new NewPropertyForm();
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.Retry)
             { loop = true; }
             LoadPropertyPage();
         } while (loop);
     }
     if (((Button)sender).Name == btn_AddTenant.Name)
     {
         bool loop;
         do
         {
             loop = false;
             NewTenantForm dialog = new NewTenantForm();
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.Retry)
             { loop = true; }
             LoadTenantPage();
         } while (loop);
     }
     if (((Button)sender).Name == btn_AddMaintenance.Name)
     {
         PropertySelector ps = new PropertySelector();
         if (ps.ShowDialog() == DialogResult.OK)
         {
             NewMaintenanceForm dialog = new NewMaintenanceForm(ps.selection, false);
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.OK)
             { LoadMaintenancePage(); }
         }
     }
     if (((Button)sender).Name == btn_AddFinance.Name)
     {
         try
         {
             PropertySelector ps = new PropertySelector();
             if (ps.ShowDialog() == DialogResult.OK)
             {
                 SimplePrompt prompt = new SimplePrompt("Income or Expense?", "Finance", "Income", "Expense");
                 prompt.ShowDialog();
                 if (prompt.DialogResult == DialogResult.Yes)
                 {
                     NewPaymentForm dialog = new NewPaymentForm(ps.selection);
                     dialog.ShowDialog();
                     if (dialog.DialogResult == DialogResult.OK)
                     { LoadFinancePage(); }
                 }
                 else if (prompt.DialogResult == DialogResult.No)
                 {
                     AddIncidentForm dialog = new AddIncidentForm(ps.selection);
                     dialog.ShowDialog();
                     if (dialog.DialogResult == DialogResult.OK)
                     { LoadFinancePage(); }
                 }
             }
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
Example #3
0
 private void btn_Add_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_AddProperty.Name)
     {
         bool loop;
         do
         {
             loop = false;
             NewPropertyForm dialog = new NewPropertyForm();
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.Retry)
             {
                 loop = true;
             }
             LoadPropertyPage();
         } while (loop);
     }
     if (((Button)sender).Name == btn_AddTenant.Name)
     {
         bool loop;
         do
         {
             loop = false;
             NewTenantForm dialog = new NewTenantForm();
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.Retry)
             {
                 loop = true;
             }
             LoadTenantPage();
         } while (loop);
     }
     if (((Button)sender).Name == btn_AddMaintenance.Name)
     {
         PropertySelector ps = new PropertySelector();
         if (ps.ShowDialog() == DialogResult.OK)
         {
             NewMaintenanceForm dialog = new NewMaintenanceForm(ps.selection, false);
             dialog.ShowDialog();
             if (dialog.DialogResult == DialogResult.OK)
             {
                 LoadMaintenancePage();
             }
         }
     }
     if (((Button)sender).Name == btn_AddFinance.Name)
     {
         try
         {
             PropertySelector ps = new PropertySelector();
             if (ps.ShowDialog() == DialogResult.OK)
             {
                 SimplePrompt prompt = new SimplePrompt("Income or Expense?", "Finance", "Income", "Expense");
                 prompt.ShowDialog();
                 if (prompt.DialogResult == DialogResult.Yes)
                 {
                     NewPaymentForm dialog = new NewPaymentForm(ps.selection);
                     dialog.ShowDialog();
                     if (dialog.DialogResult == DialogResult.OK)
                     {
                         LoadFinancePage();
                     }
                 }
                 else if (prompt.DialogResult == DialogResult.No)
                 {
                     AddIncidentForm dialog = new AddIncidentForm(ps.selection);
                     dialog.ShowDialog();
                     if (dialog.DialogResult == DialogResult.OK)
                     {
                         LoadFinancePage();
                     }
                 }
             }
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            bool loop;
            do
            {
                loop = false;
                NewTenantForm dialog = new NewTenantForm();
                dialog.ShowDialog();

                if (dialog.DialogResult == DialogResult.OK)
                {
                    tenants.Add(dialog.NewTenant);
                }
                if (dialog.DialogResult == DialogResult.Retry)
                {
                    tenants.Add(dialog.NewTenant);
                    loop = true;
                }
                if (dialog.DialogResult == DialogResult.Cancel)
                {

                }
                UpdateDataGridView();
            } while (loop);
        }