//protected void btneditar_Click(object sender, EventArgs e) //{ // pnlEditar.Visible = true; // hdfEditar.Value = "1"; // CargarEditar(int.Parse(hdfEditar.Value.ToString())); //} //private void CargarEditar(int IDOferta) //{ // NOferta oferta = new NOferta(); // var objOferta = oferta.Traer(IDOferta); // txteditar.Text = objOferta.Descripcion; //} //protected void btnGuardarEditar_Click(object sender, EventArgs e) //{ // NOferta oferta = new NOferta(); // var objOferta = oferta.Traer(int.Parse(hdfEditar.Value.ToString())); // objOferta.Descripcion = txteditar.Text; // if (oferta.Update(objOferta)) // { // string fun = "funciono"; // CargarGV(); // } // else // { // } //} protected void btnEliminar_Command(object sender, CommandEventArgs e) { int id = int.Parse(e.CommandArgument.ToString()); NOferta noferta = new NOferta(); noferta.Delete(id); ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal('Se Ha eliminado con exito la oferta!', 'Felicidades, Presione Ok!', 'success') </script>"); Response.Redirect("HomeEncargado.aspx"); }
protected void BtnEliminarOferta_Click(object sender, EventArgs e) { string id = Request.QueryString["id"]; int idProd = int.Parse(id); NOferta noferta = new NOferta(); noferta.Delete(idProd); ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal('Se Ha eliminado con exito la oferta!', 'Felicidades, Presione Ok!', 'success') </script>"); Response.Redirect("HomeEncargado.aspx"); }