Example #1
0
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_EditProperty.Name)
     {
         try
         {
             ViewPropertyDataForm form = new ViewPropertyDataForm(Property.GetPropertyByID(dgv_Properties.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditTenant.Name)
     {
         try
         {
             ViewTenantDataForm form = new ViewTenantDataForm(Tenant.GetTenantByID(dgv_Tenant.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditMaintenance.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Maintenance.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditFinance.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Finance.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
Example #2
0
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_MaintenanceEdit.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Maintenance.SelectedRows[0].Cells[0].Value.ToString()));
             if (form.ShowDialog() == DialogResult.Cancel)
             {
                 LoadMaintenanceDGV();
             }
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_FinancesEdit.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Finances.SelectedRows[0].Cells[0].Value.ToString()));
             if (form.ShowDialog() == DialogResult.Cancel)
             {
                 LoadFinanceDGV();
             }
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_InformationEdit.Name)
     {
         try
         {
             ViewTenantDataForm form = new ViewTenantDataForm(Tenant.GetTenantByID(SelectedTenant.TenantID));
             if (form.ShowDialog() == DialogResult.Cancel)
             {
             }
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_MaintenanceEdit.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Maintenance.SelectedRows[0].Cells[0].Value.ToString()));
             if (form.ShowDialog() == DialogResult.Cancel)
             { LoadMaintenanceDGV(); }
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_FinancesEdit.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Finances.SelectedRows[0].Cells[0].Value.ToString()));
             if (form.ShowDialog() == DialogResult.Cancel)
             { LoadFinanceDGV(); }
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_InformationEdit.Name)
     {
         try
         {
             ViewTenantDataForm form = new ViewTenantDataForm(Tenant.GetTenantByID(SelectedTenant.TenantID));
             if(form.ShowDialog() == DialogResult.Cancel)
             {  }
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
Example #4
0
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     if (((Button)sender).Name == btn_EditProperty.Name)
     {
         try
         {
             ViewPropertyDataForm form = new ViewPropertyDataForm(Property.GetPropertyByID(dgv_Properties.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditTenant.Name)
     {
         try
         {
             ViewTenantDataForm form = new ViewTenantDataForm(Tenant.GetTenantByID(dgv_Tenant.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditMaintenance.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Maintenance.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
     if (((Button)sender).Name == btn_EditFinance.Name)
     {
         try
         {
             ViewOccurenceDataForm form = new ViewOccurenceDataForm(Occurence.GetOccurenceByID(dgv_Finance.SelectedRows[0].Cells[0].Value.ToString()));
             form.Show();
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }