-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateWorkOrder.cs
More file actions
58 lines (49 loc) · 1.79 KB
/
Copy pathCreateWorkOrder.cs
File metadata and controls
58 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AviationMaintenanceManagementSystem.Features;
using AviationMaintenanceManagementSystem.ModelClasses;
using AviationMaintenanceManagementSystem.Data_CRUDops_;
//This form is used to create a new work order. It is a child form of the WorkOrderForm form.
namespace AviationMaintenanceManagementSystem
{
public partial class CreateWorkOrder : Form
{
private readonly IWorkOrderFeature _workOrderFeature;
public CreateWorkOrder(IWorkOrderFeature workOrderFeature)
{
_workOrderFeature = workOrderFeature;
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
{
var workOrder = new ActualWorkOrder
{
JobNumber = txtJobNumber.Text,
Discrepancy = txtDiscrepancy.Text,
CorrectiveAction = txtCorrectiveAction.Text,
Notes = txtNotes.Text,
Date = DateTime.Parse(txtDate.Text),
Time = DateTime.Parse(txtTime.Text),
EquipmentStatus = txtEquipmentStatus.Text,
WorkCenterId = int.Parse(txtWorkCenterId.Text)
};
_workOrderFeature.CreateWorkOrder(workOrder);
MessageBox.Show("Work Order Created Successfully");
this.Close();
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
// Close the form without saving any data
this.Close();
}
}
}