public AddSheetForm(Sheet existing) { InitializeComponent(); haveSheet = existing; if(existing != null) { sheetEstimatedArrivalPicker.Value = existing.EstimatedArrival; sheetJobNumberBox.Text = existing.JobNumber.ToString(); sheetQuantityBox.Text = existing.Quantity.ToString(); sheetSizeBox.Text = existing.Size; sheetThicknessBox.Text = existing.Thickness; sheetTypeBox.Text = existing.StockType; } }
private void button1_Click(object sender, EventArgs e) { if(this.sheetTypeBox.Text == "" || this.sheetThicknessBox.Text == "" || this.sheetQuantityBox.Text == "" || this.sheetJobNumberBox.Text == "" || this.sheetSizeBox.Text == "") { MessageBox.Show("Please enter a value for all fields."); } else { if (haveSheet != null) { } else { Sheet newSheet = new Sheet(Int32.Parse(this.sheetQuantityBox.Text), this.sheetEstimatedArrivalPicker.Value, Int32.Parse(this.sheetQuantityBox.Text), this.sheetSizeBox.Text, this.sheetThicknessBox.Text, this.sheetTypeBox.Text, false); newSheet.InsertSheet(); } this.Close(); } }
private void editButton_Click(object sender, EventArgs e) { if(tabControl1.SelectedTab.Name == sheetTab.Name) { if(listView1.SelectedItems.Count >= 1) { Sheet thisSheet = new Sheet(Int32.Parse(listView1.SelectedItems[0].Name)); } else { MessageBox.Show("Please select an item to edit."); } } else if (tabControl1.SelectedTab.Name == lamTab.Name) { if (listView2.SelectedItems.Count >= 1) { Laminate thisLam = new Laminate(Int32.Parse(listView2.SelectedItems[0].Name)); } else { MessageBox.Show("Please select an item to edit."); } } else if (tabControl1.SelectedTab.Name == edgeTab.Name) { if (listView3.SelectedItems.Count >= 1) { Edgetape thisSheet = new Edgetape(Int32.Parse(listView3.SelectedItems[0].Name)); } else { MessageBox.Show("Please select an item to edit."); } } }