Exemplo n.º 1
0
 private void btn_Submit_Click(object sender, EventArgs e)
 {
     if (FieldsAreValid())
     {
         GetFieldData();
         if (IsServiceCall)
         {
             MaintenanceItem.SubmitServiceCall(Description, DateTime.Today.Date, property, EstimatedCost, EarliestDueDate, LatestDueDate, EstimatedTimeTaken);
         }
         else
         {
             MaintenanceItem.SubmitMaintenanceRequest(ItemName, Description, DateTime.Today.Date, property, Occurence.Statuses.Active, property.CurrentTenants.ToList(), RequestedBy, EstimatedCost, EarliestDueDate, LatestDueDate, Priority, EstimatedTimeTaken);
         }
         DialogResult = DialogResult.OK;
     }
 }
 public CompleteMaintenanceItemForm(MaintenanceItem item)
 {
     InitializeComponent();
     Item = item;
 }
 public CompleteMaintenanceItemForm(MaintenanceItem item)
 {
     InitializeComponent();
     Item = item;
 }
Exemplo n.º 4
0
        private void dgv_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var hti = ((DataGridView)sender).HitTest(e.X, e.Y);

            if (hti.RowIndex >= 0 && hti.ColumnIndex >= 0)
            {
                if (sender is DataGridView)
                {
                    DataGridView source = (DataGridView)sender;
                    string       ID     = source.SelectedRows[0].Cells[0].Value.ToString();

                    string IDType = new string(ID.Take(ID.IndexOf('_')).ToArray());

                    switch (IDType)
                    {
                    case "Prop":
                    {
                        break;
                    }

                    case "Ten":
                    {
                        break;
                    }

                    case "Occ":
                    {
                        break;
                    }

                    case "Mnt":
                    {
                        ViewOccurenceDataForm form = new ViewOccurenceDataForm(MaintenanceItem.GetOccurenceByID(ID));
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            LoadMaintenanceDGV();
                        }
                        break;
                    }

                    case "Inc":
                    {
                        ViewOccurenceDataForm form = new ViewOccurenceDataForm(Incident.GetOccurenceByID(ID));
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            LoadFinanceDGV();
                        }
                        break;
                    }

                    case "Pay":
                    {
                        ViewOccurenceDataForm form = new ViewOccurenceDataForm(Incident.GetOccurenceByID(ID));
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            LoadFinanceDGV();
                        }
                        break;
                    }

                    case "Note":
                    {
                        ViewNoteDataForm form = new ViewNoteDataForm(SelectedTenant.Notes.Find(i => i.NoteID == ID), dgv_Notes);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            LoadNoteDGV();
                        }
                        break;
                    }
                    }
                }
            }
        }