private void button1_Click(object sender, EventArgs e) { try { customerService = new Order_Graber_DataService.Services.CustomerService(); CUSTOMERS newCustomer = new CUSTOMERS() { document_type = textBox1.Text, document_nro = textBox2.Text, customer_name = textBox3.Text, address = textBox4.Text, phone = textBox5.Text, email = textBox6.Text, state = textBox7.Text, }; customerService.InsertCustomer(newCustomer); Datos Check = new Datos(); Check.Show(); Hide(); } catch { MessageBox.Show("Error"); } }
public ActionResult Create(CUSTOMERS datosFront) { try { customerService = new Order_Graber_DataService.Services.CustomerService(); CUSTOMERS newCustomer = new CUSTOMERS() { document_type = datosFront.document_type, document_nro = datosFront.document_nro, customer_name = datosFront.customer_name, address = datosFront.address, phone = datosFront.phone, email = datosFront.email, state = datosFront.state }; customerService.InsertCustomer(newCustomer); return(RedirectToAction("IndexCustomer")); } catch { return(View()); } }