public ActionResult Create(ORDERS datosFront) { try { orderService = new Order_Graber_DataService.Services.OrderService(); ORDERS newOrder = new ORDERS() { client_id = datosFront.client_id, order_date = datosFront.order_date, total_order = datosFront.total_order, state = datosFront.state, }; orderService.InsertOrder(newOrder); return(RedirectToAction("IndexOrder")); } catch { return(View()); } }
private void button2_Click(object sender, EventArgs e) { try { orderService = new Order_Graber_DataService.Services.OrderService(); ORDERS newOrder = new ORDERS() { client_id = Decimal.ToInt32(numericUpDown1.Value), order_date = dateTime.Value, total_order = Decimal.ToDouble(numericUpDown2.Value), state = textBox1.Text, }; orderService.InsertOrder(newOrder); Datos Check = new Datos(); Check.Show(); Hide(); } catch { MessageBox.Show("Error"); } }