Exemplo n.º 1
0
        protected void btnAceptarEliminarArticulo_Click(object sender, EventArgs e)
        {
            if (gvArticulos.FocusedRowIndex != -1)
            {
                try
                {
                    string rta = ControladorGeneral.EliminarArticulo(int.Parse(gvArticulos.GetRowValues(gvArticulos.FocusedRowIndex, "codigoArticulo").ToString()));
                    pcError.ShowOnPageLoad = true;

                    if (rta == "ok")
                    {
                        lblMensaje.Text = "El articulo se eliminó correctamente.";
                    }
                    else
                    {
                        lblMensaje.Text = "No se pudo eliminar el articulo ya que esta asociado a una nota de pedido.";
                    }

                    loadGridArticulos();
                }
                catch
                {
                }
            }
        }
Exemplo n.º 2
0
        protected void grillaArticulos_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            ASPxGridView grillaArticulos = sender as ASPxGridView;
            int          codigoArticulo  = Convert.ToInt32(e.Keys[0]);

            if (ControladorGeneral.ValidarArticuloAEliminar(codigoArticulo))
            {
                ControladorGeneral.EliminarArticulo(codigoArticulo);
                grillaArticulos.JSProperties["cpBorrar"] = "Se borró el artículo correctamente";
                e.Cancel = true;
                CargarGrilla();
            }
            else
            {
                grillaArticulos.JSProperties["cpBorrar"] = "No se puede borrar un artículo que pertenece a una tanda";
                e.Cancel = true;
            }
        }
Exemplo n.º 3
0
 protected void btnAceptarEliminarArticulo_Click(object sender, EventArgs e)
 {
     ControladorGeneral.EliminarArticulo(int.Parse(gvArticulos.GetRowValues(gvArticulos.FocusedRowIndex, "codigoArticulo").ToString()));
     gvArticulos.DataBind();
 }