private void delete_btn_Click(object sender, EventArgs e) { service.removeDetail(orderID, detailID); displayWindow displayWindow = (displayWindow)this.Owner; displayWindow.renewService(service); this.Close(); }
private void modi_btn_Click(object sender, EventArgs e) { displayWindow displayWindow = new displayWindow(service); if (displayWindow != null && !displayWindow.IsDisposed) { displayWindow.Show(this); } }
private void confirm_btn_Click(object sender, EventArgs e) { displayWindow display = (displayWindow)this.Owner; bool numParse = int.TryParse(num_text.Text, out int num); bool unitParse = float.TryParse(unitPrice_text.Text, out float unitPrice); if (numParse && unitParse) { OrderDetails newDetail = new OrderDetails(objID_text.Text, objName_text.Text, supllier_text.Text, buyer_text.Text, int.Parse(num_text.Text), int.Parse(unitPrice_text.Text)); display.renewCell(cellIndex, newDetail, detailID); this.Close(); } else { add_text.ForeColor = Color.Red; add_text.Text = "Number character illegal!"; } }
private void confirm_btn_Click(object sender, EventArgs e) { string objID = objID_text.Text; string objName = objName_text.Text; string supplier = supllier_text.Text; string buyer = buyer_text.Text; bool numConvert = int.TryParse(num_text.Text, out int num); bool unitPriceConvert = float.TryParse(unitPrice_text.Text, out float unitPrice); bool totalPriceConvert = float.TryParse(totalPrice_text.Text, out float totalPrice); string numStr = ""; string unitPriceStr = ""; string totalStr = ""; if (!(numConvert && unitPriceConvert && totalPriceConvert) && (num_text.Text != "" && unitPrice_text.Text != "" && totalPrice_text.Text != "")) { warning warningWindow = new warning(); warningWindow.setText("Warning!", "Character illegal."); warningWindow.Show(); return; } if (numConvert) { numStr = num_sign.SelectedItem.ToString() + num.ToString(); } if (unitPriceConvert) { unitPriceStr = unitPrice_sign.SelectedItem.ToString() + unitPrice.ToString(); } if (totalPriceConvert) { totalStr = totalPrice_sign.SelectedItem.ToString() + totalPrice.ToString(); } List <Order> results = service.find(objID, objName, supplier, buyer, numStr, unitPriceStr, totalStr); displayWindow displayWindow = (displayWindow)this.Owner; displayWindow.refresh(results); this.Close(); }