private void button1_Click(object sender, EventArgs e) { CapaNegocio cn = new CapaNegocio(); AddProdET addEt = new AddProdET(); addEt.Nombre = textBoxAdd.Text; addEt.Description = textBoxDesc.Text; addEt.Title = textBoxTitle.Text; addEt.Observations = textBoxObservacion.Text; addEt.PriceClient = decimal.Parse(textBoxPriceClient.Text); addEt.PriceMember = decimal.Parse(textBoxPriceMember.Text); addEt.IsEnabled = true; if (cn.Insert(addEt)) { label2.Text = "Se agrego el producto"; } else { label2.Text = "No se pudo agregar"; } }
public void Update(int ID) { CapaDatos cd = new CapaDatos(); AddProdET addEt = new AddProdET(); addEt.Id = int.Parse(textBoxID.Text); addEt.Nombre = textBoxAdd.Text; addEt.Description = textBoxDesc.Text; addEt.Title = textBoxTitle.Text; addEt.Observations = textBoxObservacion.Text; addEt.PriceClient = decimal.Parse(textBoxPriceClient.Text); addEt.PriceMember = decimal.Parse(textBoxPriceMember.Text); addEt.IsEnabled = true; if (cd.Update(addEt)) { label2.Text = "Se modifico el producto"; } else { label2.Text = "No se pudo modificar"; } }
public bool Insert(AddProdET AddET) { CapaDatos cd = new CapaDatos(); return(cd.Insert(AddET)); }